@feedmepos/ui-library 1.1.13 → 1.1.14

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 (24) hide show
  1. package/dist/CHANGELOG.md +12 -1
  2. package/dist/components/chart/bar/FmBar.vue.d.ts +5 -4
  3. package/dist/components/chart/line/FmLine.vue.d.ts +5 -4
  4. package/dist/components/chart/pie/FmPie.vue.d.ts +9 -5
  5. package/dist/components/form/simple-calendar/simple-date-range-picker/FmSimpleDateRangePicker.vue.d.ts +3 -1
  6. package/dist/components/form/simple-calendar/simple-date-range-picker/FmSimpleDateRangePickerDesktop.vue.d.ts +2 -0
  7. package/dist/components/form/simple-calendar/simple-date-range-picker/FmSimpleDateRangePickerMobile.vue.d.ts +2 -0
  8. package/dist/components/menu/menu-divider/FmMenuDivider.vue.d.ts +1 -1
  9. package/dist/components.d.ts +83 -52
  10. package/dist/federation/FmBar.vue_vue_type_script_setup_true_lang-DaTQIxt5.js +1 -0
  11. package/dist/federation/FmLine.vue_vue_type_script_setup_true_lang-DaLWoT69.js +1 -0
  12. package/dist/federation/FmPie.vue_vue_type_script_setup_true_lang-Dyd3pOmV.js +2 -0
  13. package/dist/federation/{__federation_expose_FmBarChart-C1CozpXh.js → __federation_expose_FmBarChart-Cy6PL_FZ.js} +1 -1
  14. package/dist/federation/{__federation_expose_FmLineChart-DKuJkFxI.js → __federation_expose_FmLineChart-TTJujI_x.js} +1 -1
  15. package/dist/federation/{__federation_expose_FmPieChart-XCRZxPEM.js → __federation_expose_FmPieChart-BYQUKFrn.js} +1 -1
  16. package/dist/federation/feedmepos-ui-components.js +1 -1
  17. package/dist/federation/index-VYKpj56Q.js +2 -0
  18. package/dist/feedmepos-ui-library.js +3250 -3216
  19. package/dist/feedmepos-ui-library.umd.cjs +10 -10
  20. package/package.json +1 -1
  21. package/dist/federation/FmBar.vue_vue_type_script_setup_true_lang-biLsMyS6.js +0 -1
  22. package/dist/federation/FmLine.vue_vue_type_script_setup_true_lang-HmI1WAqt.js +0 -1
  23. package/dist/federation/FmPie.vue_vue_type_script_setup_true_lang-DHl1zHt0.js +0 -2
  24. package/dist/federation/index-YguELkrT.js +0 -2
@@ -1,4 +1,4 @@
1
- (function(de,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],r):(de=typeof globalThis<"u"?globalThis:de||self,r(de["feedmepos-ui-library"]={},de.Vue,de.VueRouter))})(this,function(de,r,gt){"use strict";var Mk=Object.defineProperty;var Vk=(de,r,gt)=>r in de?Mk(de,r,{enumerable:!0,configurable:!0,writable:!0,value:gt}):de[r]=gt;var T=(de,r,gt)=>(Vk(de,typeof r!="symbol"?r+"":r,gt),gt);var _r;const Ms={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},iu=t=>"config"in t&&"globalProperties"in t.config,su=t=>{let e;return t==="vue2"?e=!1:t==="vue3"?e=!0:e=iu(t),e?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},Vs=t=>typeof t=="string"&&t!=="auto",Bs=(t,e)=>{t.dataset.vWaveBoundary=Vs(e)?e:"true"},lu=({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},au=(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 io(t,e,n,o){const i=t-n,s=e-o;return Math.sqrt(i*i+s*s)}function du(t,e,{width:n,height:o}){const i=io(t,e,0,0),s=io(t,e,n,0),l=io(t,e,0,o),a=io(t,e,n,o);return Math.max(i,s,l,a)}const cu=({x:t,y:e},{top:n,left:o})=>({x:t-o,y:e-n}),Cr="vWaveCountInternal";function uu(t){const e=xr(t);Es(t,e+1)}function fu(t){const e=xr(t);Es(t,e-1)}function Es(t,e){t.dataset[Cr]=e.toString()}function xr(t){var e;return parseInt((e=t.dataset[Cr])!==null&&e!==void 0?e:"0",10)}function hu(t){delete t.dataset[Cr]}const Sr=(t,e,n)=>{const o=e.getBoundingClientRect(),i=window.getComputedStyle(e),{x:s,y:l}=cu(t,o),a=2.05*du(s,l,o),d=lu(i,n.tagName),c=au(s,l,a,n);uu(e);let u="";i.position==="static"&&(e.style.position&&(u=e.style.position),e.style.position="relative"),d.appendChild(c),e.appendChild(d);let f=!1;const h=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",h),document.removeEventListener("pointercancel",h)),f?m():f=!0},m=()=>{c.style.transition=`opacity ${n.dissolveDuration}s linear`,c.style.opacity="0",setTimeout(()=>{d.remove(),fu(e),xr(e)===0&&(hu(e),e.style.position=u)},n.dissolveDuration*1e3)};document.addEventListener("pointerup",h),document.addEventListener("pointercancel",h);const p=setTimeout(()=>{document.removeEventListener("pointercancel",g),requestAnimationFrame(()=>{c.style.transform="translate(-50%,-50%) scale(1)",c.style.opacity=`${n.finalOpacity}`,setTimeout(()=>h(),n.duration*1e3)})},n.cancellationPeriod),g=()=>{clearTimeout(p),d.remove(),document.removeEventListener("pointerup",h),document.removeEventListener("pointercancel",h),document.removeEventListener("pointercancel",g)};document.addEventListener("pointercancel",g)},hn=new WeakMap,Ps=(t={},e="vue3")=>{const n=Object.assign(Object.assign({},Ms),t),o=su(e),i=a=>{const d=a.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${d}"]`).forEach(u=>Sr(a,u,Object.assign(Object.assign({},n),hn.get(u))))},s={[o.mounted](a,{value:d={}}){var c;hn.set(a,d),Bs(a,(c=d&&d.trigger)!==null&&c!==void 0?c:n.trigger),a.addEventListener("pointerdown",u=>{if(hn.get(a)===!1)return;const f=Object.assign(Object.assign({},n),hn.get(a));if(f.trigger===!1)return Sr(u,a,f);if(Vs(f.trigger))return;const h=a.querySelector('[data-v-wave-trigger="true"]');!h&&f.trigger===!0||h&&!u.composedPath().includes(h)||Sr(u,a,f)})},[o.updated](a,{value:d={}}){var c;hn.set(a,d),Bs(a,(c=d&&d.trigger)!==null&&c!==void 0?c:n.trigger)}},l={[o.mounted](a,{arg:d="true"}){a.dataset.vWaveTrigger=d,d!=="true"&&a.addEventListener("pointerdown",i)},[o.updated](a,{arg:d="true"}){a.dataset.vWaveTrigger=d,d==="true"?a.removeEventListener("pointerdown",i):a.addEventListener("pointerdown",i)}};return{wave:s,vWave:s,waveTrigger:l,vWaveTrigger:l}},mu={install(t,e={}){if(this.installed)return;this.installed=!0;const n=Object.assign(Object.assign({},Ms),e),{vWave:o,vWaveTrigger:i}=Ps(n,t);t.directive(n.directive,o),t.directive(`${n.directive}-trigger`,i)},installed:!1,createLocalWaveDirective:Ps},pu={class:"gap-8 inline-flex items-center relative select-none"},gu={key:0,class:"fm-typo-body-sm-400 justify-center"},bu=r.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"},class:{default:void 0}},setup(t){const e=t,n=r.computed(()=>e.value&&e.value>99?"99+":e.value);return(o,i)=>(r.openBlock(),r.createElementBlock("div",pu,[r.renderSlot(o.$slots,"default",{},void 0,!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-badge",e.class??`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?(r.openBlock(),r.createElementBlock("span",gu,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)],2)]))}}),J=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Ft=J(bu,[["__scopeId","data-v-b401ca12"]]);function yu(){var t;return(t=r.getCurrentInstance())==null?void 0:t.emit}function q(t,e){const n=yu(),o=r.ref(t[e]);return r.watch(()=>t[e],()=>{o.value=t[e]}),r.computed({get(){return o.value},set(s){o.value=s,n==null||n(`update:${String(e)}`,s)}})}const $u=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,wu=/^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}[)]$/,_u=/^^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*[)]$/,ku=/^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*[)]$/,Cu=/^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 mn(t){return[$u,wu,_u,ku,Cu].some(e=>e.test(t))}function vr(t,e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(n)return`rgba(${parseInt(n[1],16)},${parseInt(n[2],16)},${parseInt(n[3],16)},${e})`;if(t.startsWith("rgb")){const o=t.split(",");if(o.length===3)return[...o.slice(0,2),o[2].replace(")",`,${e})`)].join(",");if(o.length===4)return[...o.slice(0,3),`${e})`].join(",")}return""}function pn(t){const e=getComputedStyle(document.documentElement).getPropertyValue(`--${t}`)||t;return e.startsWith("rgb")||e.startsWith("#")?e:null}const H=J(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(t){const e=t,n=r.computed(()=>{const s=[],l={};return s.push(o()),s.push(i()),mn(e.color)?l.color=e.color:s.push(`text-fm-color-${e.color}`),{class:s.join(" "),style:l}});function o(){return`fm-icon--${e.outline?"outlined":"rounded"}`}function i(){return`fm-icon--${e.size}`}return(s,l)=>(r.openBlock(),r.createElementBlock("span",r.mergeProps({class:"fm-icon"},n.value),r.toDisplayString(e.name),17))}}),[["__scopeId","data-v-acf7a3d2"]]);function xu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function Ns(t){return typeof t=="function"?t():r.unref(t)}const Su=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vu=Object.prototype.toString,Du=t=>vu.call(t)==="[object Object]",Dr=()=>{};function Mu(t){var e;const n=Ns(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Fs=Su?window:void 0;function Mr(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=Fs):[e,n,o,i]=t,!e)return Dr;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const s=[],l=()=>{s.forEach(u=>u()),s.length=0},a=(u,f,h,m)=>(u.addEventListener(f,h,m),()=>u.removeEventListener(f,h,m)),d=r.watch(()=>[Mu(e),Ns(i)],([u,f])=>{if(l(),!u)return;const h=Du(f)?{...f}:f;s.push(...n.flatMap(m=>o.map(p=>a(u,m,p,h))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return xu(c),c}function Vu(t,e={}){const{threshold:n=50,onSwipe:o,onSwipeEnd:i,onSwipeStart:s,passive:l=!0,window:a=Fs}=e,d=r.reactive({x:0,y:0}),c=r.reactive({x:0,y:0}),u=r.computed(()=>d.x-c.x),f=r.computed(()=>d.y-c.y),{max:h,abs:m}=Math,p=r.computed(()=>h(m(u.value),m(f.value))>=n),g=r.ref(!1),b=r.computed(()=>p.value?m(u.value)>m(f.value)?u.value>0?"left":"right":f.value>0?"up":"down":"none"),y=D=>[D.touches[0].clientX,D.touches[0].clientY],k=(D,v)=>{d.x=D,d.y=v},M=(D,v)=>{c.x=D,c.y=v};let w;const _=Bu(a==null?void 0:a.document);l?w=_?{passive:!0}:{capture:!1}:w=_?{passive:!1,capture:!0}:{capture:!0};const F=D=>{g.value&&(i==null||i(D,b.value)),g.value=!1},$=[Mr(t,"touchstart",D=>{if(D.touches.length!==1)return;w.capture&&!w.passive&&D.preventDefault();const[v,x]=y(D);k(v,x),M(v,x),s==null||s(D)},w),Mr(t,"touchmove",D=>{if(D.touches.length!==1)return;const[v,x]=y(D);M(v,x),!g.value&&p.value&&(g.value=!0),g.value&&(o==null||o(D))},w),Mr(t,["touchend","touchcancel"],F,w)];return{isPassiveEventSupported:_,isSwiping:g,direction:b,coordsStart:d,coordsEnd:c,lengthX:u,lengthY:f,stop:()=>$.forEach(D=>D())}}function Bu(t){if(!t)return!1;let e=!1;const n={get passive(){return e=!0,!1}};return t.addEventListener("x",Dr,n),t.removeEventListener("x",Dr),e}const gn=J(r.defineComponent({__name:"FmOverlay",props:{onClose:{type:Function},dismissAway:{type:Boolean},zIndex:{},preventBackdropEvent:{type:Boolean},transparent:{type:Boolean},centerContent:{type:Boolean}},setup(t){const e=t,n=r.ref(null),o=i=>{var s;e.dismissAway&&n.value&&i.target===n.value&&((s=e.onClose)==null||s.call(e))};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"overlayRef",ref:n,class:r.normalizeClass([[i.preventBackdropEvent?"pointer-events-none":"pointer-events-auto",i.transparent?"bg-transparent":"bg-fm-color-overlay-background",{"fm-overlay--center":e.centerContent,"z-50":e.zIndex===void 0}],"fm-overlay"]),style:r.normalizeStyle({zIndex:e.zIndex}),onClick:s[0]||(s[0]=l=>o(l))},[r.renderSlot(i.$slots,"default",{},void 0,!0)],6))}}),[["__scopeId","data-v-6ebaa300"]]),Eu=[(t=>(r.pushScopeId("data-v-99e1e6f2"),t=t(),r.popScopeId(),t))(()=>r.createElementVNode("div",{class:"fm-bottom-sheet--gesture--stick"},null,-1))],Pu={class:"fm-bottom-sheet--header"},Nu={class:"fm-bottom-sheet--header--content"},Fu={key:0},Ru={class:"overflow-y-auto"},Au={class:"flex gap-8 items-center"},Vr=J(r.defineComponent({__name:"FmBottomSheet",props:{header:{default:""},modelValue:{type:Boolean,default:!1},dismissAway:{type:Boolean,default:!1},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=r.ref(null),o=r.ref(null),i=r.ref(0),{direction:s,lengthY:l}=Vu(n,{passive:!1,threshold:0,onSwipe(){s.value==="down"&&(i.value=Math.min(l.value,0))},onSwipeEnd(){var c;const d=(c=o.value)==null?void 0:c.clientHeight;d&&i.value<-d/2?a.value=!1:i.value=0}}),a=q(e,"modelValue");return r.watch(a,d=>{d&&(i.value=0)}),(d,c)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{onClick:c[0]||(c[0]=u=>a.value=!0)},[r.renderSlot(d.$slots,"bottom-sheet-button",{},void 0,!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.unref(a)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":e.dismissAway,"z-index":e.zIndex,onClose:c[2]||(c[2]=u=>a.value=!1)},{default:r.withCtx(()=>[r.createVNode(r.Transition,{appear:"",name:"slide"},{default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"wrapperRef",ref:o,style:r.normalizeStyle({bottom:`${i.value}px`}),class:"fm-bottom-sheet"},[r.createElementVNode("div",{ref_key:"gestureRef",ref:n,class:"fm-bottom-sheet--gesture"},Eu,512),r.createElementVNode("div",Pu,[r.createElementVNode("div",Nu,[r.createElementVNode("div",{class:"flex h-24 items-center justify-center w-24",onClick:c[1]||(c[1]=u=>a.value=!1)},[r.createVNode(H,{name:"arrow_back"})]),r.renderSlot(d.$slots,"bottom-sheet-header",{},()=>[d.header?(r.openBlock(),r.createElementBlock("div",Fu,r.toDisplayString(d.header),1)):r.createCommentVNode("",!0)],!0)])]),r.createElementVNode("div",Ru,[r.renderSlot(d.$slots,"default",{},void 0,!0)]),r.createElementVNode("div",Au,[r.renderSlot(d.$slots,"bottom-sheet-footer",{},void 0,!0)])],4)]),_:3})]),_:3},8,["dismiss-away","z-index"])):r.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-99e1e6f2"]]),Ou={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Iu=["onMouseenter"],Tu={key:0},zu=r.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(t){const e=gt.useRoute(),n=gt.useRouter();r.onMounted(async()=>{await n.isReady();const p=o.items.findIndex(g=>g.route==e.path);p!=-1&&!o.items[p].disabled&&(i.value=p)});const o=t,i=r.ref(-1),s=r.ref(-1),l=r.ref(" / "),a=r.ref("... /"),d=r.ref(!1),c=p=>i.value===p?"selected":s.value===p?"hovered":o.items[p].disabled?"disabled":"default",u=p=>{o.items[p].disabled||(i.value=p)},f=p=>p!=o.items.length-1,h=p=>!d.value&&o.items.length>5&&p>=2&&p<o.items.length-2,m=()=>{d.value=!d.value};return(p,g)=>{const b=r.resolveComponent("RouterLink");return r.openBlock(),r.createElementBlock("nav",null,[r.createElementVNode("ul",Ou,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.items,(y,k)=>(r.openBlock(),r.createElementBlock("li",{key:k,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:M=>s.value=k,onMouseleave:g[0]||(g[0]=M=>s.value=-1)},[h(k)?k===3&&!d.value?(r.openBlock(),r.createElementBlock("a",{key:1,onClick:m},r.toDisplayString(a.value),1)):r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(b,{key:0,class:r.normalizeClass([c(k),"fm-typo-body-md-400"]),to:y.disabled?"":y.route,onClick:M=>u(k)},{default:r.withCtx(()=>[r.createElementVNode("span",null,r.toDisplayString(y.label),1),f(k)?(r.openBlock(),r.createElementBlock("span",Tu,r.toDisplayString(l.value),1)):r.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Iu))),128))])])}}});function so(t){return typeof t=="number"?t:typeof t=="string"&&isFinite(+t)?+t:null}const Lu={class:"relative"},Hu=["stroke-width"],Yu=["stroke-width","stroke-dashoffset"],ju=["stroke-width","stroke-dashoffset"],Wu={key:0};var lo=(t=>(t[t.md=2.5]="md",t[t.lg=2]="lg",t[t.xl=1.75]="xl",t[t.xxl=1.5]="xxl",t))(lo||{});const Zt=J(r.defineComponent({__name:"FmCircularProgress",props:{currentStep:{default:void 0},totalSteps:{default:void 0},indeterminate:{type:Boolean,default:void 0},size:{default:"xxl"},color:{default:"primary"}},setup(t){const e=t,n=r.computed(()=>{const s=so(e.currentStep),l=so(e.totalSteps),a=e.indeterminate??(s===null||l===null);return{currentStep:a?null:Math.min(s,l),totalSteps:l,indeterminate:a}}),o=r.computed(()=>{const s=so(e.currentStep),l=so(e.totalSteps);if(typeof s!="number"||typeof l!="number")return"10 200";const a=48,d=Math.min(1,s/l);return isNaN(d)?"0 200":`${d*a} 200`}),i=r.computed(()=>{const s=new Array,l={};return e.color?(mn(e.color)?l.color=e.color:s.push(`text-fm-color-${e.color}`),{class:s.join(" "),style:l}):{class:s.join(" "),style:l}});return(s,l)=>(r.openBlock(),r.createElementBlock("div",Lu,[r.createElementVNode("div",{class:r.normalizeClass(["fm-progress fm-typo-body-sm-400 flex items-center justify-center",{"fm-progress--indeterminate":n.value.indeterminate,[`fm-progress--${s.size}`]:!0}])},[(r.openBlock(),r.createElementBlock("svg",{class:r.normalizeClass(["absolute h-full left-0 top-0 w-full",i.value.class]),style:r.normalizeStyle(i.value.style),viewBox:"0 0 18 18"},[n.value.indeterminate?(r.openBlock(),r.createElementBlock("circle",{key:0,class:"spinner","stroke-width":lo[s.size],fill:"none",stroke:"currentColor",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dasharray":"10 200","stroke-dashoffset":"0"},null,8,Hu)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("circle",{"stroke-width":lo[s.size],fill:"none",stroke:"var(--fm-color-neutral-gray-100)",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dashoffset":s.currentStep===0?"10px":"0",style:r.normalizeStyle({transform:"rotate(270deg)",strokeDasharray:"100 200",transformOrigin:"center",transition:"stroke-dasharray ease-out 250ms"})},null,12,Yu),r.createElementVNode("circle",{"stroke-width":lo[s.size],fill:"none",stroke:"currentColor",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dashoffset":s.currentStep===0?"10px":"0",style:r.normalizeStyle({transform:"rotate(270deg)",strokeDasharray:o.value,transformOrigin:"center",transition:"stroke-dasharray ease-out 250ms"})},null,12,ju)],64))],6)),!n.value.indeterminate&&s.size==="xxl"?(r.openBlock(),r.createElementBlock("div",Wu,r.toDisplayString(n.value.currentStep)+" of "+r.toDisplayString(n.value.totalSteps),1)):r.createCommentVNode("",!0)],2)]))}}),[["__scopeId","data-v-c8665c2d"]]),Uu=["disabled","type"],Gu={class:"-translate-x-1/2 -translate-y-1/2 absolute left-1/2 top-1/2 transform"},U=J(r.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"},prependIcon:{default:""},appendIcon:{default:""},loading:{type:Boolean,default:!1},disableIconStatus:{type:Boolean}},setup(t){const e=t,n=r.ref(!1),o=r.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 border-1 border-fm-color-neutral-black",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-typo-primary rounded-lg",plain:"bg-transparent text-fm-color-primary",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl min-h-56 min-w-56 !p-16"};function s(l){e.disableIconStatus?n.value=!1:n.value=l}return(l,a)=>{const d=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("button",{ref:"buttonEl",class:r.normalizeClass(`
1
+ (function(de,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],r):(de=typeof globalThis<"u"?globalThis:de||self,r(de["feedmepos-ui-library"]={},de.Vue,de.VueRouter))})(this,function(de,r,gt){"use strict";var Mk=Object.defineProperty;var Vk=(de,r,gt)=>r in de?Mk(de,r,{enumerable:!0,configurable:!0,writable:!0,value:gt}):de[r]=gt;var T=(de,r,gt)=>(Vk(de,typeof r!="symbol"?r+"":r,gt),gt);var _r;const Ms={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},iu=t=>"config"in t&&"globalProperties"in t.config,su=t=>{let e;return t==="vue2"?e=!1:t==="vue3"?e=!0:e=iu(t),e?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},Vs=t=>typeof t=="string"&&t!=="auto",Bs=(t,e)=>{t.dataset.vWaveBoundary=Vs(e)?e:"true"},lu=({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},au=(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 io(t,e,n,o){const i=t-n,s=e-o;return Math.sqrt(i*i+s*s)}function du(t,e,{width:n,height:o}){const i=io(t,e,0,0),s=io(t,e,n,0),l=io(t,e,0,o),a=io(t,e,n,o);return Math.max(i,s,l,a)}const cu=({x:t,y:e},{top:n,left:o})=>({x:t-o,y:e-n}),Cr="vWaveCountInternal";function uu(t){const e=xr(t);Es(t,e+1)}function fu(t){const e=xr(t);Es(t,e-1)}function Es(t,e){t.dataset[Cr]=e.toString()}function xr(t){var e;return parseInt((e=t.dataset[Cr])!==null&&e!==void 0?e:"0",10)}function hu(t){delete t.dataset[Cr]}const Sr=(t,e,n)=>{const o=e.getBoundingClientRect(),i=window.getComputedStyle(e),{x:s,y:l}=cu(t,o),a=2.05*du(s,l,o),d=lu(i,n.tagName),c=au(s,l,a,n);uu(e);let u="";i.position==="static"&&(e.style.position&&(u=e.style.position),e.style.position="relative"),d.appendChild(c),e.appendChild(d);let f=!1;const h=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",h),document.removeEventListener("pointercancel",h)),f?m():f=!0},m=()=>{c.style.transition=`opacity ${n.dissolveDuration}s linear`,c.style.opacity="0",setTimeout(()=>{d.remove(),fu(e),xr(e)===0&&(hu(e),e.style.position=u)},n.dissolveDuration*1e3)};document.addEventListener("pointerup",h),document.addEventListener("pointercancel",h);const p=setTimeout(()=>{document.removeEventListener("pointercancel",g),requestAnimationFrame(()=>{c.style.transform="translate(-50%,-50%) scale(1)",c.style.opacity=`${n.finalOpacity}`,setTimeout(()=>h(),n.duration*1e3)})},n.cancellationPeriod),g=()=>{clearTimeout(p),d.remove(),document.removeEventListener("pointerup",h),document.removeEventListener("pointercancel",h),document.removeEventListener("pointercancel",g)};document.addEventListener("pointercancel",g)},hn=new WeakMap,Ps=(t={},e="vue3")=>{const n=Object.assign(Object.assign({},Ms),t),o=su(e),i=a=>{const d=a.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${d}"]`).forEach(u=>Sr(a,u,Object.assign(Object.assign({},n),hn.get(u))))},s={[o.mounted](a,{value:d={}}){var c;hn.set(a,d),Bs(a,(c=d&&d.trigger)!==null&&c!==void 0?c:n.trigger),a.addEventListener("pointerdown",u=>{if(hn.get(a)===!1)return;const f=Object.assign(Object.assign({},n),hn.get(a));if(f.trigger===!1)return Sr(u,a,f);if(Vs(f.trigger))return;const h=a.querySelector('[data-v-wave-trigger="true"]');!h&&f.trigger===!0||h&&!u.composedPath().includes(h)||Sr(u,a,f)})},[o.updated](a,{value:d={}}){var c;hn.set(a,d),Bs(a,(c=d&&d.trigger)!==null&&c!==void 0?c:n.trigger)}},l={[o.mounted](a,{arg:d="true"}){a.dataset.vWaveTrigger=d,d!=="true"&&a.addEventListener("pointerdown",i)},[o.updated](a,{arg:d="true"}){a.dataset.vWaveTrigger=d,d==="true"?a.removeEventListener("pointerdown",i):a.addEventListener("pointerdown",i)}};return{wave:s,vWave:s,waveTrigger:l,vWaveTrigger:l}},mu={install(t,e={}){if(this.installed)return;this.installed=!0;const n=Object.assign(Object.assign({},Ms),e),{vWave:o,vWaveTrigger:i}=Ps(n,t);t.directive(n.directive,o),t.directive(`${n.directive}-trigger`,i)},installed:!1,createLocalWaveDirective:Ps},pu={class:"gap-8 inline-flex items-center relative select-none"},gu={key:0,class:"fm-typo-body-sm-400 justify-center"},bu=r.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"},class:{default:void 0}},setup(t){const e=t,n=r.computed(()=>e.value&&e.value>99?"99+":e.value);return(o,i)=>(r.openBlock(),r.createElementBlock("div",pu,[r.renderSlot(o.$slots,"default",{},void 0,!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-badge",e.class??`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?(r.openBlock(),r.createElementBlock("span",gu,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)],2)]))}}),J=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Ft=J(bu,[["__scopeId","data-v-b401ca12"]]);function yu(){var t;return(t=r.getCurrentInstance())==null?void 0:t.emit}function q(t,e){const n=yu(),o=r.ref(t[e]);return r.watch(()=>t[e],()=>{o.value=t[e]}),r.computed({get(){return o.value},set(s){o.value=s,n==null||n(`update:${String(e)}`,s)}})}const $u=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,wu=/^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}[)]$/,_u=/^^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*[)]$/,ku=/^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*[)]$/,Cu=/^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 mn(t){return[$u,wu,_u,ku,Cu].some(e=>e.test(t))}function vr(t,e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(n)return`rgba(${parseInt(n[1],16)},${parseInt(n[2],16)},${parseInt(n[3],16)},${e})`;if(t.startsWith("rgb")){const o=t.split(",");if(o.length===3)return[...o.slice(0,2),o[2].replace(")",`,${e})`)].join(",");if(o.length===4)return[...o.slice(0,3),`${e})`].join(",")}return""}function pn(t){const e=getComputedStyle(document.documentElement).getPropertyValue(`--${t}`)||t;return e.startsWith("rgb")||e.startsWith("#")?e:null}const H=J(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(t){const e=t,n=r.computed(()=>{const s=[],l={};return s.push(o()),s.push(i()),mn(e.color)?l.color=e.color:s.push(`text-fm-color-${e.color}`),{class:s.join(" "),style:l}});function o(){return`fm-icon--${e.outline?"outlined":"rounded"}`}function i(){return`fm-icon--${e.size}`}return(s,l)=>(r.openBlock(),r.createElementBlock("span",r.mergeProps({class:"fm-icon"},n.value),r.toDisplayString(e.name),17))}}),[["__scopeId","data-v-acf7a3d2"]]);function xu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function Ns(t){return typeof t=="function"?t():r.unref(t)}const Su=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vu=Object.prototype.toString,Du=t=>vu.call(t)==="[object Object]",Dr=()=>{};function Mu(t){var e;const n=Ns(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Fs=Su?window:void 0;function Mr(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=Fs):[e,n,o,i]=t,!e)return Dr;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const s=[],l=()=>{s.forEach(u=>u()),s.length=0},a=(u,f,h,m)=>(u.addEventListener(f,h,m),()=>u.removeEventListener(f,h,m)),d=r.watch(()=>[Mu(e),Ns(i)],([u,f])=>{if(l(),!u)return;const h=Du(f)?{...f}:f;s.push(...n.flatMap(m=>o.map(p=>a(u,m,p,h))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return xu(c),c}function Vu(t,e={}){const{threshold:n=50,onSwipe:o,onSwipeEnd:i,onSwipeStart:s,passive:l=!0,window:a=Fs}=e,d=r.reactive({x:0,y:0}),c=r.reactive({x:0,y:0}),u=r.computed(()=>d.x-c.x),f=r.computed(()=>d.y-c.y),{max:h,abs:m}=Math,p=r.computed(()=>h(m(u.value),m(f.value))>=n),g=r.ref(!1),b=r.computed(()=>p.value?m(u.value)>m(f.value)?u.value>0?"left":"right":f.value>0?"up":"down":"none"),y=k=>[k.touches[0].clientX,k.touches[0].clientY],C=(k,S)=>{d.x=k,d.y=S},v=(k,S)=>{c.x=k,c.y=S};let _;const x=Bu(a==null?void 0:a.document);l?_=x?{passive:!0}:{capture:!1}:_=x?{passive:!1,capture:!0}:{capture:!0};const N=k=>{g.value&&(i==null||i(k,b.value)),g.value=!1},E=[Mr(t,"touchstart",k=>{if(k.touches.length!==1)return;_.capture&&!_.passive&&k.preventDefault();const[S,w]=y(k);C(S,w),v(S,w),s==null||s(k)},_),Mr(t,"touchmove",k=>{if(k.touches.length!==1)return;const[S,w]=y(k);v(S,w),!g.value&&p.value&&(g.value=!0),g.value&&(o==null||o(k))},_),Mr(t,["touchend","touchcancel"],N,_)];return{isPassiveEventSupported:x,isSwiping:g,direction:b,coordsStart:d,coordsEnd:c,lengthX:u,lengthY:f,stop:()=>E.forEach(k=>k())}}function Bu(t){if(!t)return!1;let e=!1;const n={get passive(){return e=!0,!1}};return t.addEventListener("x",Dr,n),t.removeEventListener("x",Dr),e}const gn=J(r.defineComponent({__name:"FmOverlay",props:{onClose:{type:Function},dismissAway:{type:Boolean},zIndex:{},preventBackdropEvent:{type:Boolean},transparent:{type:Boolean},centerContent:{type:Boolean}},setup(t){const e=t,n=r.ref(null),o=i=>{var s;e.dismissAway&&n.value&&i.target===n.value&&((s=e.onClose)==null||s.call(e))};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"overlayRef",ref:n,class:r.normalizeClass([[i.preventBackdropEvent?"pointer-events-none":"pointer-events-auto",i.transparent?"bg-transparent":"bg-fm-color-overlay-background",{"fm-overlay--center":e.centerContent,"z-50":e.zIndex===void 0}],"fm-overlay"]),style:r.normalizeStyle({zIndex:e.zIndex}),onClick:s[0]||(s[0]=l=>o(l))},[r.renderSlot(i.$slots,"default",{},void 0,!0)],6))}}),[["__scopeId","data-v-6ebaa300"]]),Eu=[(t=>(r.pushScopeId("data-v-99e1e6f2"),t=t(),r.popScopeId(),t))(()=>r.createElementVNode("div",{class:"fm-bottom-sheet--gesture--stick"},null,-1))],Pu={class:"fm-bottom-sheet--header"},Nu={class:"fm-bottom-sheet--header--content"},Fu={key:0},Ru={class:"overflow-y-auto"},Au={class:"flex gap-8 items-center"},Vr=J(r.defineComponent({__name:"FmBottomSheet",props:{header:{default:""},modelValue:{type:Boolean,default:!1},dismissAway:{type:Boolean,default:!1},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=r.ref(null),o=r.ref(null),i=r.ref(0),{direction:s,lengthY:l}=Vu(n,{passive:!1,threshold:0,onSwipe(){s.value==="down"&&(i.value=Math.min(l.value,0))},onSwipeEnd(){var c;const d=(c=o.value)==null?void 0:c.clientHeight;d&&i.value<-d/2?a.value=!1:i.value=0}}),a=q(e,"modelValue");return r.watch(a,d=>{d&&(i.value=0)}),(d,c)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{onClick:c[0]||(c[0]=u=>a.value=!0)},[r.renderSlot(d.$slots,"bottom-sheet-button",{},void 0,!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.unref(a)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":e.dismissAway,"z-index":e.zIndex,onClose:c[2]||(c[2]=u=>a.value=!1)},{default:r.withCtx(()=>[r.createVNode(r.Transition,{appear:"",name:"slide"},{default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"wrapperRef",ref:o,style:r.normalizeStyle({bottom:`${i.value}px`}),class:"fm-bottom-sheet"},[r.createElementVNode("div",{ref_key:"gestureRef",ref:n,class:"fm-bottom-sheet--gesture"},Eu,512),r.createElementVNode("div",Pu,[r.createElementVNode("div",Nu,[r.createElementVNode("div",{class:"flex h-24 items-center justify-center w-24",onClick:c[1]||(c[1]=u=>a.value=!1)},[r.createVNode(H,{name:"arrow_back"})]),r.renderSlot(d.$slots,"bottom-sheet-header",{},()=>[d.header?(r.openBlock(),r.createElementBlock("div",Fu,r.toDisplayString(d.header),1)):r.createCommentVNode("",!0)],!0)])]),r.createElementVNode("div",Ru,[r.renderSlot(d.$slots,"default",{},void 0,!0)]),r.createElementVNode("div",Au,[r.renderSlot(d.$slots,"bottom-sheet-footer",{},void 0,!0)])],4)]),_:3})]),_:3},8,["dismiss-away","z-index"])):r.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-99e1e6f2"]]),Ou={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Iu=["onMouseenter"],Tu={key:0},zu=r.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(t){const e=gt.useRoute(),n=gt.useRouter();r.onMounted(async()=>{await n.isReady();const p=o.items.findIndex(g=>g.route==e.path);p!=-1&&!o.items[p].disabled&&(i.value=p)});const o=t,i=r.ref(-1),s=r.ref(-1),l=r.ref(" / "),a=r.ref("... /"),d=r.ref(!1),c=p=>i.value===p?"selected":s.value===p?"hovered":o.items[p].disabled?"disabled":"default",u=p=>{o.items[p].disabled||(i.value=p)},f=p=>p!=o.items.length-1,h=p=>!d.value&&o.items.length>5&&p>=2&&p<o.items.length-2,m=()=>{d.value=!d.value};return(p,g)=>{const b=r.resolveComponent("RouterLink");return r.openBlock(),r.createElementBlock("nav",null,[r.createElementVNode("ul",Ou,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.items,(y,C)=>(r.openBlock(),r.createElementBlock("li",{key:C,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:v=>s.value=C,onMouseleave:g[0]||(g[0]=v=>s.value=-1)},[h(C)?C===3&&!d.value?(r.openBlock(),r.createElementBlock("a",{key:1,onClick:m},r.toDisplayString(a.value),1)):r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(b,{key:0,class:r.normalizeClass([c(C),"fm-typo-body-md-400"]),to:y.disabled?"":y.route,onClick:v=>u(C)},{default:r.withCtx(()=>[r.createElementVNode("span",null,r.toDisplayString(y.label),1),f(C)?(r.openBlock(),r.createElementBlock("span",Tu,r.toDisplayString(l.value),1)):r.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Iu))),128))])])}}});function so(t){return typeof t=="number"?t:typeof t=="string"&&isFinite(+t)?+t:null}const Lu={class:"relative"},Hu=["stroke-width"],Yu=["stroke-width","stroke-dashoffset"],ju=["stroke-width","stroke-dashoffset"],Wu={key:0};var lo=(t=>(t[t.md=2.5]="md",t[t.lg=2]="lg",t[t.xl=1.75]="xl",t[t.xxl=1.5]="xxl",t))(lo||{});const Zt=J(r.defineComponent({__name:"FmCircularProgress",props:{currentStep:{default:void 0},totalSteps:{default:void 0},indeterminate:{type:Boolean,default:void 0},size:{default:"xxl"},color:{default:"primary"}},setup(t){const e=t,n=r.computed(()=>{const s=so(e.currentStep),l=so(e.totalSteps),a=e.indeterminate??(s===null||l===null);return{currentStep:a?null:Math.min(s,l),totalSteps:l,indeterminate:a}}),o=r.computed(()=>{const s=so(e.currentStep),l=so(e.totalSteps);if(typeof s!="number"||typeof l!="number")return"10 200";const a=48,d=Math.min(1,s/l);return isNaN(d)?"0 200":`${d*a} 200`}),i=r.computed(()=>{const s=new Array,l={};return e.color?(mn(e.color)?l.color=e.color:s.push(`text-fm-color-${e.color}`),{class:s.join(" "),style:l}):{class:s.join(" "),style:l}});return(s,l)=>(r.openBlock(),r.createElementBlock("div",Lu,[r.createElementVNode("div",{class:r.normalizeClass(["fm-progress fm-typo-body-sm-400 flex items-center justify-center",{"fm-progress--indeterminate":n.value.indeterminate,[`fm-progress--${s.size}`]:!0}])},[(r.openBlock(),r.createElementBlock("svg",{class:r.normalizeClass(["absolute h-full left-0 top-0 w-full",i.value.class]),style:r.normalizeStyle(i.value.style),viewBox:"0 0 18 18"},[n.value.indeterminate?(r.openBlock(),r.createElementBlock("circle",{key:0,class:"spinner","stroke-width":lo[s.size],fill:"none",stroke:"currentColor",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dasharray":"10 200","stroke-dashoffset":"0"},null,8,Hu)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("circle",{"stroke-width":lo[s.size],fill:"none",stroke:"var(--fm-color-neutral-gray-100)",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dashoffset":s.currentStep===0?"10px":"0",style:r.normalizeStyle({transform:"rotate(270deg)",strokeDasharray:"100 200",transformOrigin:"center",transition:"stroke-dasharray ease-out 250ms"})},null,12,Yu),r.createElementVNode("circle",{"stroke-width":lo[s.size],fill:"none",stroke:"currentColor",cx:"50%",cy:"50%",r:7.75,"stroke-linecap":"round","stroke-dashoffset":s.currentStep===0?"10px":"0",style:r.normalizeStyle({transform:"rotate(270deg)",strokeDasharray:o.value,transformOrigin:"center",transition:"stroke-dasharray ease-out 250ms"})},null,12,ju)],64))],6)),!n.value.indeterminate&&s.size==="xxl"?(r.openBlock(),r.createElementBlock("div",Wu,r.toDisplayString(n.value.currentStep)+" of "+r.toDisplayString(n.value.totalSteps),1)):r.createCommentVNode("",!0)],2)]))}}),[["__scopeId","data-v-c8665c2d"]]),Uu=["disabled","type"],Gu={class:"-translate-x-1/2 -translate-y-1/2 absolute left-1/2 top-1/2 transform"},U=J(r.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"},prependIcon:{default:""},appendIcon:{default:""},loading:{type:Boolean,default:!1},disableIconStatus:{type:Boolean}},setup(t){const e=t,n=r.ref(!1),o=r.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 border-1 border-fm-color-neutral-black",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-typo-primary rounded-lg",plain:"bg-transparent text-fm-color-primary",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl min-h-56 min-w-56 !p-16"};function s(l){e.disableIconStatus?n.value=!1:n.value=l}return(l,a)=>{const d=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("button",{ref:"buttonEl",class:r.normalizeClass(`
2
2
  fm-btn
3
3
  ${o.value}
4
4
  fm-btn--${l.size}
@@ -6,7 +6,7 @@
6
6
  fm-btn--${l.variant}
7
7
  ${l.disabled||l.loading?"fm-btn--disabled":""}
8
8
  ${n.value&&l.variant==="plain"?"!text-fm-color-system-warning-400":""}
9
- `),disabled:l.disabled,type:l.type,onMousedown:a[0]||(a[0]=()=>s(!0)),onMouseleave:a[1]||(a[1]=()=>s(!1)),onMouseup:a[2]||(a[2]=()=>s(!1))},[l.icon&&l.iconPosition==="prepend"||l.prependIcon?(r.openBlock(),r.createBlock(H,{key:0,class:r.normalizeClass({invisible:l.loading}),color:l.disabled?"neutral-gray-200":l.iconColor??"",name:l.icon||l.prependIcon,outline:!n.value,size:"md"},null,8,["class","color","name","outline"])):r.createCommentVNode("",!0),l.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass([{invisible:l.loading},"fm-typo-body-lg-700 line-clamp-1"])},r.toDisplayString(l.label),3)):r.createCommentVNode("",!0),l.icon&&l.iconPosition==="append"||l.appendIcon?(r.openBlock(),r.createBlock(H,{key:2,class:r.normalizeClass({invisible:l.loading}),color:l.disabled?"neutral-gray-200":l.iconColor??"",name:l.icon||l.appendIcon,outline:!n.value,size:"md"},null,8,["class","color","name","outline"])):r.createCommentVNode("",!0),r.createElementVNode("div",Gu,[l.loading?(r.openBlock(),r.createBlock(Zt,{key:0,color:"neutral-gray-300",size:"md"})):r.createCommentVNode("",!0)])],42,Uu)),[[d,!l.disabled&&!l.loading&&l.variant!=="plain"]])}}}),[["__scopeId","data-v-a4928ba0"]]),qu={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},Xu=["disabled","v-wave","onClick","onMousedown"],Ku=r.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=c=>{o("update:modelValue",c)},s=r.ref(null),l=c=>{s.value=c},a=c=>c.disabled||n.disabled,d=c=>JSON.stringify(c)===JSON.stringify(n.modelValue);return(c,u)=>(r.openBlock(),r.createElementBlock("div",qu,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(f,h)=>(r.openBlock(),r.createElementBlock("button",{key:h,class:r.normalizeClass([{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":d(f),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(f)},"border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[5px]"]),disabled:a(f),"v-wave":a(f),type:"button",onClick:m=>i(f),onMousedown:m=>l(f),onMouseleave:u[0]||(u[0]=m=>l(null)),onMouseup:u[1]||(u[1]=m=>l(null))},[f.icon?(r.openBlock(),r.createBlock(H,{key:0,color:a(f)?"neutral-gray-200":d(f)?"primary":"",name:f.icon,outline:JSON.stringify(s.value)!==JSON.stringify(f)&&!d(f),size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0),f.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass([[a(f)?"text-fm-color-typo-disabled":d(f)?"text-fm-color-primary":"text-fm-color-typo-primary"],"fm-typo-body-lg-700"])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0)],42,Xu))),128))]))}}),Rs=Symbol.for("fm:form"),ye=Symbol.for("fm:form-state"),As=Symbol.for("fm:radio-group"),Os=Symbol.for("fm:stepper"),Is=Symbol.for("fm:dialog"),Ts=Symbol.for("fm:menu"),zs=Symbol.for("fm:menu-to-item"),Br=Symbol.for("fm:snackbar"),bt=Symbol.for("fm:card"),Zu=r.defineComponent({__name:"FmCard",props:{variant:{default:"elevated"},horizontal:{type:Boolean,default:!1},disabled:{type:Boolean}},setup(t){const e=t;return r.provide(bt,{disabled:e.disabled,horizontal:e.horizontal}),(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([`fm-card--${n.variant}`,{"fm-card--horizontal":n.horizontal}])},[r.renderSlot(n.$slots,"default",{disabled:e.disabled})],2))}}),Ju=r.defineComponent({__name:"FmCardActionArea",props:{disabled:{type:Boolean,default:!1}},setup(t){const e=r.inject(bt,null);return(n,o)=>{var s,l;const i=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass((s=r.unref(e))!=null&&s.disabled||n.disabled?"cursor-not-allowed":"cursor-pointer")},[r.renderSlot(n.$slots,"default")],2)),[[i,!((l=r.unref(e))!=null&&l.disabled)&&!n.disabled]])}}}),Er=r.defineComponent({__name:"FmCardSection",setup(t){const e=r.inject(bt,null);return(n,o)=>{var i;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card__section",{"fm-card__subtitle--disabled":(i=r.unref(e))==null?void 0:i.disabled}])},[r.renderSlot(n.$slots,"default")],2)}}}),Qu={class:"fm-card__actions"},ef=r.defineComponent({__name:"FmCardActions",setup(t){const e=r.inject(bt,null);return(n,o)=>(r.openBlock(),r.createBlock(Er,null,{default:r.withCtx(()=>{var i;return[r.createElementVNode("div",Qu,[r.renderSlot(n.$slots,"default",{disabled:((i=r.unref(e))==null?void 0:i.disabled)??!1})])]}),_:3}))}}),Ls=r.defineComponent({__name:"FmCardTitle",setup(t){const e=r.inject(bt,null);return(n,o)=>{var i;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card__title",{"fm-card__title--disabled":(i=r.unref(e))==null?void 0:i.disabled}])},[r.renderSlot(n.$slots,"default")],2)}}}),Hs=r.defineComponent({__name:"FmCardSubtitle",setup(t){const e=r.inject(bt,null);return(n,o)=>{var i;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card__subtitle",{"fm-card__subtitle--disabled":(i=r.unref(e))==null?void 0:i.disabled}])},[r.renderSlot(n.$slots,"default")],2)}}}),tf={class:"flex flex-col gap-4"},nf=r.defineComponent({__name:"FmCardHeader",props:{title:{default:""},subtitle:{default:""}},setup(t){const e=r.inject(bt,null);return(n,o)=>(r.openBlock(),r.createBlock(Er,{class:"fm-card__header"},{default:r.withCtx(()=>{var i,s;return[r.createElementVNode("div",tf,[n.title?(r.openBlock(),r.createBlock(Ls,{key:0,disabled:(i=r.unref(e))==null?void 0:i.disabled},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.title),1)]),_:1},8,["disabled"])):r.createCommentVNode("",!0),n.subtitle?(r.openBlock(),r.createBlock(Hs,{key:1,disabled:(s=r.unref(e))==null?void 0:s.disabled},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.subtitle),1)]),_:1},8,["disabled"])):r.createCommentVNode("",!0)])]}),_:1}))}}),of=["src","width"],rf=r.defineComponent({__name:"FmCardMedia",props:{src:{},width:{default:"100%"}},setup(t){const e=r.inject(bt,null);return(n,o)=>{var i,s;return r.openBlock(),r.createElementBlock("img",{src:n.src,class:r.normalizeClass(["object-cover",[{"opacity-60":((i=r.unref(e))==null?void 0:i.disabled)??!1},(s=r.unref(e))!=null&&s.horizontal?"aspect-square":"aspect-4/3"]]),width:n.width},null,10,of)}}}),Ys=r.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},rightIcon:{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},variant:{default:"plain"}},emits:["chip-closed"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.ref(!1);function l(p){n.selectable&&(s.value=p)}const a=()=>{!n.selectable||n.disabled||(i.value=!i.value)},d=p=>{p.stopPropagation(),!n.disabled&&o("chip-closed")};r.onMounted(()=>{i.value=n.selected}),r.watch(()=>n.selected,()=>{i.value=n.selected});function c(p,g,b){if(p)return"text-fm-color-typo-disabled";switch(b){case"plain":return g?"text-fm-color-neutral-white":"";case"neutral":case"info":case"success":case"critical":return"text-fm-color-neutral-white";case"warning":return"text-fm-color-neutral-black"}}function u(p,g,b){if(p)return"bg-fm-color-neutral-gray-100 cursor-not-allowed";switch(b){case"plain":return g?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100";case"neutral":return"bg-fm-color-neutral-black";case"info":return"bg-fm-color-secondary-blueberry";case"success":return"bg-fm-color-secondary-mint";case"critical":return"bg-fm-color-secondary-salmon";case"warning":return"bg-fm-color-secondary-mustard"}}const f=r.ref(),h=r.ref(!1);function m(p=0){if(n.label&&!(!f.value&&p>500)){if(!f.value){r.nextTick(()=>m(p+1));return}h.value=f.value.offsetWidth<f.value.scrollWidth}}return r.onMounted(()=>{m()}),(p,g)=>{const b=r.resolveDirective("tooltip");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center",p.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",u(p.disabled,i.value,p.variant),{"cursor-pointer":p.selectable&&!p.disabled,"hover:bg-fm-color-opacity-sm":!i.value&&!p.disabled&&p.selectable}]),onClick:a,onMousedown:g[0]||(g[0]=()=>l(!0)),onMouseleave:g[1]||(g[1]=()=>l(!1)),onMouseup:g[2]||(g[2]=()=>l(!1))},[r.renderSlot(p.$slots,"default",{},()=>[p.icon?(r.openBlock(),r.createBlock(H,{key:0,color:p.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black",name:p.icon,outline:!s.value&&!i.value,size:"sm"},null,8,["color","name","outline"])):r.createCommentVNode("",!0),p.label?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"labelRef",ref:f,class:r.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",c(p.disabled,i.value,p.variant)])},r.toDisplayString(p.label),3)):r.createCommentVNode("",!0),p.rightIcon?(r.openBlock(),r.createBlock(H,{key:2,color:p.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black",name:p.rightIcon,outline:!s.value&&!i.value,size:"sm"},null,8,["color","name","outline"])):r.createCommentVNode("",!0)]),p.removable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex items-center justify-center rounded-xxxl",!i.value&&!p.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":p.disabled,"cursor-pointer":p.selectable&&!p.disabled}]),onClick:d},[r.createVNode(H,{color:p.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black",name:"close",size:"sm"},null,8,["color"])],2)):r.createCommentVNode("",!0)],34)),[[b,h.value?p.label:null]])}}}),Pr=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(t,{emit:e}){const n=t,o=e,i=r.ref(null),s=r.ref(0),l=r.ref(null),a=r.ref(),d=()=>{var h,m;if(!i.value)return;const u=i.value.getBoundingClientRect();s.value>0&&l.value&&((h=a.value)==null||h.splice(l.value,1)),s.value=0;let f=0;Array.from(i.value.children).forEach((p,g)=>{const b=p.getBoundingClientRect(),y=b.y-u.y;f=Math.max(b.height*2+4,f),y>f&&(s.value+=1,l.value=l.value===null?g:g-s.value)}),s.value>0&&l.value&&((m=a.value)==null||m.splice(l.value,0,{label:`+${s.value}`,removable:!1,selectable:!1,compact:n.compact}))},c=u=>{o("chip-closed",u)};return r.onMounted(()=>{a.value=n.items,d(),new ResizeObserver(()=>{d()}).observe(i.value)}),r.watch(()=>n.items,()=>{a.value=n.items,d()}),(u,f)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chipsContainer",ref:i,class:r.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",u.compact?"max-h-48":"max-h-64"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(h,m)=>(r.openBlock(),r.createBlock(Ys,{key:m,label:h.label,icon:h.icon,selected:h.selected,removable:h.removable!==void 0?h.removable:u.removable,selectable:h.selectable!==void 0?h.selectable:u.selectable,disabled:h.disabled!==void 0?h.disabled:u.disabled,compact:u.compact,variant:h.variant,onChipClosed:p=>c(m)},null,8,["label","icon","selected","removable","selectable","disabled","compact","variant","onChipClosed"]))),128))],2))}}),sf={class:"flex h-48 items-center justify-center w-48"},js=r.defineComponent({__name:"FmDialogContent",props:{modelValue:{type:Boolean,default:!1},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=r.ref(null),i=r.ref(!1),s=r.ref(!1),l=d=>{const c=d.scrollHeight,u=d.scrollTop+d.clientHeight;s.value=c===u,i.value=d.scrollTop===0},a=d=>{d.stopPropagation();const c=d.target;l(c)};return r.watchEffect(()=>{o.value&&l(o.value)}),(d,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-dialog",`min-w-[${d.minWidth}px] max-w-[min(calc(100%-48px),560px)] max-h-[600px]`])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-dialog--header","flex items-center justify-between","fm-typo-title-sm-700 text-fm-color-typo-primary",!i.value&&"fm-shadow-light-300"])},[r.renderSlot(d.$slots,"dialog-header"),r.createElementVNode("div",sf,[d.closeButton?(r.openBlock(),r.createBlock(H,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:c[0]||(c[0]=u=>n("update:modelValue",!1))})):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"fm-dialog--content overflow-y-auto",onScrollPassive:a},[r.renderSlot(d.$slots,"default")],544),d.$slots["dialog-footer"]?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-dialog--footer","flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse",!s.value&&"shadow-[0_-8px_16px_0px_rgba(199,199,204,0.24)]"])},[r.renderSlot(d.$slots,"dialog-footer")],2)):r.createCommentVNode("",!0)],2))}});function yt(){const t=r.ref(window.innerWidth),e=()=>{t.value=window.innerWidth};r.onMounted(()=>{window.addEventListener("resize",e)}),r.onUnmounted(()=>{window.removeEventListener("resize",e)});const n=r.computed(()=>({xs:t.value>=0&&t.value<=647,sm:t.value>=648&&t.value<=959,md:t.value>=960&&t.value<=1247,lg:t.value>=1248})),o={xs:[0,647],sm:[648,959],md:[960,1247],lg:[1248,1/0]};function i(a){return o[a]}function s(a){const d=o[a][1];return t.value<=d}function l(a){return!!o[a]}return{breakpoints:n,isAtMost:s,getBreakpointsBoundary:i,isBreakpointKeyword:l}}function lf(){const t=r.inject(Is);if(!t)throw new Error("No provider");return t}function af(){var t;return(t=r.getCurrentInstance())==null?void 0:t.emit}function df(){const t=af();return{emitData(e){t==null||t("dialog:emit-data",e)}}}function bn(){const t=r.ref(!1);function e(){t.value=!0}function n(){t.value=!1}return{focus:e,blur:n,isFocused:t}}function Ws(t,e){const n=r.ref([]);function o(){const s=[];if(e.value&&e.value.length>0)for(const l of e.value){const d=(typeof l=="function"?l:()=>l)(t.value);d!==!0&&s.push(d)}return n.value=s,n.value}function i(){n.value=[]}return{validate:o,resetValidation:i,errorMessages:n}}function Us(t,e=null,n=null){let o=null;const i=q(t,"modelValue"),s=r.ref(!0),l=r.inject(Rs,null),{validate:a,resetValidation:d,errorMessages:c}=Ws(i,r.toRef(()=>t.rules)),u=(f=n)=>{s.value=!0,d(),f&&typeof f=="function"&&f(),i.value=e};return r.onMounted(()=>{l&&(o=l.register({validate:a,resetValidation:d,resetValue:u}))}),r.onUnmounted(()=>{l&&l.unregister(o)}),r.watch(()=>i.value,()=>{s.value=!1,i.value!==e&&a()}),r.watch(()=>t.focused,f=>{s.value=!1,f||a()}),{validate:a,resetValidation:d,errorMessages:c,resetValue:u,isPristine:s}}function cf(){return r.inject(Br)}const uf=r.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=q(n,"modelValue"),s=document.body.style.overflow;return r.watch(()=>i,l=>{l?document.body.style.overflow="hidden":document.body.style.overflow=s}),(l,a)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{onClick:a[1]||(a[1]=d=>i.value=!0)},[r.renderSlot(l.$slots,"dialog-button",{onClick:a[0]||(a[0]=d=>i.value=!0)})]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"fm-dialog"},{default:r.withCtx(()=>[r.unref(i)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":l.overlay,"prevent-backdrop-event":!l.overlay,transparent:!l.overlay,"center-content":"","z-index":l.zIndex,onClose:a[3]||(a[3]=d=>o("update:modelValue",!1))},{default:r.withCtx(()=>[r.createVNode(js,{"close-button":l.closeButton,"min-width":l.minWidth,"model-value":r.unref(i),"onUpdate:modelValue":a[2]||(a[2]=d=>i.value=d)},{"dialog-header":r.withCtx(()=>[r.renderSlot(l.$slots,"dialog-header")]),"dialog-footer":r.withCtx(()=>[r.renderSlot(l.$slots,"dialog-footer")]),default:r.withCtx(()=>[r.renderSlot(l.$slots,"default")]),_:3},8,["close-button","min-width","model-value"])]),_:3},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):r.createCommentVNode("",!0)]),_:3})]))],64))}}),ff={class:"fm-drop-field"},hf=["accept","disabled"],mf=J(r.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=r.ref(!1),s=r.ref(),l=r.ref(),a=r.ref(),d=_=>{n.disabled||(_.stopPropagation(),_.preventDefault())},c=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!0)},u=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1)},f=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1,h(_))},h=_=>{var $;a.value=(($=_.dataTransfer)==null?void 0:$.files)??_.target.files;const F=a.value;if(s.value=p(F[0]),l.value=g(F[0]),s.value&&l.value)o("file-upload",F[0]);else{const S=m();o("file-rejected",[{file:F[0],reason:S}])}},m=()=>{const _=[];return s.value||_.push("invalid-type"),l.value||_.push("invalid-size"),_},p=_=>{if(!n.accept)return!0;const F=n.accept.split(",").map($=>$.trim());for(const $ of F)if(b($)){if(k($)===k(_.type))return!0}else if(y(_)===$||_.type===$)return!0;return!1},g=_=>_.size<=n.maxFileSize,b=_=>_.indexOf("*")!==-1,y=_=>"."+_.name.split(".").pop(),k=_=>_.substring(0,_.indexOf("/")),M=r.computed(()=>{if(i.value)return"Drop file to upload";if(s.value){if(!l.value)return`File size exceeds ${n.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),w=r.computed(()=>a.value?!s.value||!l.value:!1);return(_,F)=>(r.openBlock(),r.createElementBlock("label",ff,[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":w.value&&!_.disabled,"fm-drop-field__container--disabled":_.disabled}]),onDragenter:d,onDragover:c,onDragleave:u,onDrop:f},[(i.value||w.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":w.value})},r.toDisplayString(M.value),3)):(r.openBlock(),r.createBlock(U,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:_.disabled},null,8,["disabled"])),r.renderSlot(_.$slots,"accept-text",{},()=>[n.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 ${n.accept}`),3)):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:_.accept,disabled:_.disabled,onChange:h},null,40,hf)],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 ${n.maxFileSize*1e-6}mb`),3)],!0)]))}}),[["__scopeId","data-v-c914dc32"]]),pf={},gf={class:"flex-grow"};function bf(t,e){return r.openBlock(),r.createElementBlock("div",gf)}const $t=J(pf,[["render",bf]]),yf={install:t=>{const e={currentDialog:{vNode:null,container:null},open:n=>{const o={primary:[],secondary:[],tertiary:[]},i=new Array,s={onPrimary:u=>(o.primary.push(u),s),onSecondary:u=>(o.secondary.push(u),s),onTertiary:u=>(o.tertiary.push(u),s),onClose:u=>(i.push(u),s)};function l(){e.close()}const a=document.createElement("div");document.body.appendChild(a);const d=r.markRaw(Gs),c=r.createVNode(d,{...n,unmount:l,storedFunctions:o,"onDialog-closed"(u){i.forEach(f=>f(u))}});return c.appContext=t._context,r.render(c,a),e.currentDialog.vNode=c,e.currentDialog.container=a,s},close:()=>{const{vNode:n,container:o}=e.currentDialog;n===null&&o===null||(o&&r.render(null,o),e.currentDialog={vNode:null,container:null})}};t.config.globalProperties.$dialog=e,t.provide(Is,e)}},$f={key:0,class:"block relative"},wf={key:1,class:"fm-typo-body-md-400 text-fm-color-neutral-black"},Gs=r.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},dismissAway:{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},zIndex:{default:void 0}},emits:["dialog-opened","dialog-closed"],setup(t,{emit:e}){const n=r.ref(!1),o=r.ref(),i=r.computed(()=>s.primaryActions||s.secondaryActions||s.tertiaryActions),s=t,l=e,a=()=>{s.overlay&&(n.value=!1,setTimeout(()=>{s.unmount()},500))},d=(c,u)=>{s.storedFunctions[u].forEach(f=>f(o.value)),c.close&&a()};return r.onMounted(()=>{l("dialog-opened"),n.value=!0}),r.onUnmounted(()=>{l("dialog-closed",o.value)}),(c,u)=>(r.openBlock(),r.createBlock(r.Transition,{name:"fm-dialog"},{default:r.withCtx(()=>[n.value?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":c.overlay,"prevent-backdrop-event":!c.overlay,transparent:!c.overlay,"center-content":"","z-index":s.zIndex,onClose:a},{default:r.withCtx(()=>[c.dialogComponent?(r.openBlock(),r.createElementBlock("div",$f,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.dialogComponent),r.normalizeProps(r.guardReactiveProps(c.dialogComponentProps)),null,16)),c.closeButton?(r.openBlock(),r.createBlock(H,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:a})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createBlock(js,{key:1,modelValue:n.value,"onUpdate:modelValue":u[4]||(u[4]=f=>n.value=f),"close-button":c.closeButton,"min-width":c.minWidth},r.createSlots({"dialog-header":r.withCtx(()=>[r.createElementVNode("div",null,r.toDisplayString(c.title??"Notification"),1)]),default:r.withCtx(()=>[c.contentComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.contentComponent),r.mergeProps({key:0},c.contentComponentProps,{"onDialog:emitData":u[0]||(u[0]=f=>o.value=f)}),null,16)):(r.openBlock(),r.createElementBlock("div",wf,r.toDisplayString(c.message),1))]),_:2},[i.value?{name:"dialog-footer",fn:r.withCtx(()=>[c.tertiaryActions?(r.openBlock(),r.createBlock(U,{key:0,label:c.tertiaryActions.text,variant:c.tertiaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:u[1]||(u[1]=f=>d(c.tertiaryActions,"tertiary"))},null,8,["label","variant"])):r.createCommentVNode("",!0),r.createVNode($t,{class:"sm:hidden xs:hidden"}),c.secondaryActions?(r.openBlock(),r.createBlock(U,{key:1,label:c.secondaryActions.text,variant:c.secondaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:u[2]||(u[2]=f=>d(c.secondaryActions,"secondary"))},null,8,["label","variant"])):r.createCommentVNode("",!0),c.primaryActions?(r.openBlock(),r.createBlock(U,{key:2,label:c.primaryActions.text,variant:c.primaryActions.variant??"primary",class:"sm:w-full xs:w-full",size:"md",onClick:u[3]||(u[3]=f=>d(c.primaryActions,"primary"))},null,8,["label","variant"])):r.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["modelValue","close-button","min-width"]))]),_:1},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):r.createCommentVNode("",!0)]),_:1}))}});/*!
9
+ `),disabled:l.disabled,type:l.type,onMousedown:a[0]||(a[0]=()=>s(!0)),onMouseleave:a[1]||(a[1]=()=>s(!1)),onMouseup:a[2]||(a[2]=()=>s(!1))},[l.icon&&l.iconPosition==="prepend"||l.prependIcon?(r.openBlock(),r.createBlock(H,{key:0,class:r.normalizeClass({invisible:l.loading}),color:l.disabled?"neutral-gray-200":l.iconColor??"",name:l.icon||l.prependIcon,outline:!n.value,size:"md"},null,8,["class","color","name","outline"])):r.createCommentVNode("",!0),l.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass([{invisible:l.loading},"fm-typo-body-lg-700 line-clamp-1"])},r.toDisplayString(l.label),3)):r.createCommentVNode("",!0),l.icon&&l.iconPosition==="append"||l.appendIcon?(r.openBlock(),r.createBlock(H,{key:2,class:r.normalizeClass({invisible:l.loading}),color:l.disabled?"neutral-gray-200":l.iconColor??"",name:l.icon||l.appendIcon,outline:!n.value,size:"md"},null,8,["class","color","name","outline"])):r.createCommentVNode("",!0),r.createElementVNode("div",Gu,[l.loading?(r.openBlock(),r.createBlock(Zt,{key:0,color:"neutral-gray-300",size:"md"})):r.createCommentVNode("",!0)])],42,Uu)),[[d,!l.disabled&&!l.loading&&l.variant!=="plain"]])}}}),[["__scopeId","data-v-a4928ba0"]]),qu={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},Xu=["disabled","v-wave","onClick","onMousedown"],Ku=r.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=c=>{o("update:modelValue",c)},s=r.ref(null),l=c=>{s.value=c},a=c=>c.disabled||n.disabled,d=c=>JSON.stringify(c)===JSON.stringify(n.modelValue);return(c,u)=>(r.openBlock(),r.createElementBlock("div",qu,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(f,h)=>(r.openBlock(),r.createElementBlock("button",{key:h,class:r.normalizeClass([{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":d(f),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(f)},"border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[5px]"]),disabled:a(f),"v-wave":a(f),type:"button",onClick:m=>i(f),onMousedown:m=>l(f),onMouseleave:u[0]||(u[0]=m=>l(null)),onMouseup:u[1]||(u[1]=m=>l(null))},[f.icon?(r.openBlock(),r.createBlock(H,{key:0,color:a(f)?"neutral-gray-200":d(f)?"primary":"",name:f.icon,outline:JSON.stringify(s.value)!==JSON.stringify(f)&&!d(f),size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0),f.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass([[a(f)?"text-fm-color-typo-disabled":d(f)?"text-fm-color-primary":"text-fm-color-typo-primary"],"fm-typo-body-lg-700"])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0)],42,Xu))),128))]))}}),Rs=Symbol.for("fm:form"),ye=Symbol.for("fm:form-state"),As=Symbol.for("fm:radio-group"),Os=Symbol.for("fm:stepper"),Is=Symbol.for("fm:dialog"),Ts=Symbol.for("fm:menu"),zs=Symbol.for("fm:menu-to-item"),Br=Symbol.for("fm:snackbar"),bt=Symbol.for("fm:card"),Zu=r.defineComponent({__name:"FmCard",props:{variant:{default:"elevated"},horizontal:{type:Boolean,default:!1},disabled:{type:Boolean}},setup(t){const e=t;return r.provide(bt,{disabled:e.disabled,horizontal:e.horizontal}),(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([`fm-card--${n.variant}`,{"fm-card--horizontal":n.horizontal}])},[r.renderSlot(n.$slots,"default",{disabled:e.disabled})],2))}}),Ju=r.defineComponent({__name:"FmCardActionArea",props:{disabled:{type:Boolean,default:!1}},setup(t){const e=r.inject(bt,null);return(n,o)=>{var s,l;const i=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass((s=r.unref(e))!=null&&s.disabled||n.disabled?"cursor-not-allowed":"cursor-pointer")},[r.renderSlot(n.$slots,"default")],2)),[[i,!((l=r.unref(e))!=null&&l.disabled)&&!n.disabled]])}}}),Er=r.defineComponent({__name:"FmCardSection",setup(t){const e=r.inject(bt,null);return(n,o)=>{var i;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card__section",{"fm-card__subtitle--disabled":(i=r.unref(e))==null?void 0:i.disabled}])},[r.renderSlot(n.$slots,"default")],2)}}}),Qu={class:"fm-card__actions"},ef=r.defineComponent({__name:"FmCardActions",setup(t){const e=r.inject(bt,null);return(n,o)=>(r.openBlock(),r.createBlock(Er,null,{default:r.withCtx(()=>{var i;return[r.createElementVNode("div",Qu,[r.renderSlot(n.$slots,"default",{disabled:((i=r.unref(e))==null?void 0:i.disabled)??!1})])]}),_:3}))}}),Ls=r.defineComponent({__name:"FmCardTitle",setup(t){const e=r.inject(bt,null);return(n,o)=>{var i;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card__title",{"fm-card__title--disabled":(i=r.unref(e))==null?void 0:i.disabled}])},[r.renderSlot(n.$slots,"default")],2)}}}),Hs=r.defineComponent({__name:"FmCardSubtitle",setup(t){const e=r.inject(bt,null);return(n,o)=>{var i;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card__subtitle",{"fm-card__subtitle--disabled":(i=r.unref(e))==null?void 0:i.disabled}])},[r.renderSlot(n.$slots,"default")],2)}}}),tf={class:"flex flex-col gap-4"},nf=r.defineComponent({__name:"FmCardHeader",props:{title:{default:""},subtitle:{default:""}},setup(t){const e=r.inject(bt,null);return(n,o)=>(r.openBlock(),r.createBlock(Er,{class:"fm-card__header"},{default:r.withCtx(()=>{var i,s;return[r.createElementVNode("div",tf,[n.title?(r.openBlock(),r.createBlock(Ls,{key:0,disabled:(i=r.unref(e))==null?void 0:i.disabled},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.title),1)]),_:1},8,["disabled"])):r.createCommentVNode("",!0),n.subtitle?(r.openBlock(),r.createBlock(Hs,{key:1,disabled:(s=r.unref(e))==null?void 0:s.disabled},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.subtitle),1)]),_:1},8,["disabled"])):r.createCommentVNode("",!0)])]}),_:1}))}}),of=["src","width"],rf=r.defineComponent({__name:"FmCardMedia",props:{src:{},width:{default:"100%"}},setup(t){const e=r.inject(bt,null);return(n,o)=>{var i,s;return r.openBlock(),r.createElementBlock("img",{src:n.src,class:r.normalizeClass(["object-cover",[{"opacity-60":((i=r.unref(e))==null?void 0:i.disabled)??!1},(s=r.unref(e))!=null&&s.horizontal?"aspect-square":"aspect-4/3"]]),width:n.width},null,10,of)}}}),Ys=r.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},rightIcon:{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},variant:{default:"plain"}},emits:["chip-closed"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.ref(!1);function l(p){n.selectable&&(s.value=p)}const a=()=>{!n.selectable||n.disabled||(i.value=!i.value)},d=p=>{p.stopPropagation(),!n.disabled&&o("chip-closed")};r.onMounted(()=>{i.value=n.selected}),r.watch(()=>n.selected,()=>{i.value=n.selected});function c(p,g,b){if(p)return"text-fm-color-typo-disabled";switch(b){case"plain":return g?"text-fm-color-neutral-white":"";case"neutral":case"info":case"success":case"critical":return"text-fm-color-neutral-white";case"warning":return"text-fm-color-neutral-black"}}function u(p,g,b){if(p)return"bg-fm-color-neutral-gray-100 cursor-not-allowed";switch(b){case"plain":return g?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100";case"neutral":return"bg-fm-color-neutral-black";case"info":return"bg-fm-color-secondary-blueberry";case"success":return"bg-fm-color-secondary-mint";case"critical":return"bg-fm-color-secondary-salmon";case"warning":return"bg-fm-color-secondary-mustard"}}const f=r.ref(),h=r.ref(!1);function m(p=0){if(n.label&&!(!f.value&&p>500)){if(!f.value){r.nextTick(()=>m(p+1));return}h.value=f.value.offsetWidth<f.value.scrollWidth}}return r.onMounted(()=>{m()}),(p,g)=>{const b=r.resolveDirective("tooltip");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center",p.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",u(p.disabled,i.value,p.variant),{"cursor-pointer":p.selectable&&!p.disabled,"hover:bg-fm-color-opacity-sm":!i.value&&!p.disabled&&p.selectable}]),onClick:a,onMousedown:g[0]||(g[0]=()=>l(!0)),onMouseleave:g[1]||(g[1]=()=>l(!1)),onMouseup:g[2]||(g[2]=()=>l(!1))},[r.renderSlot(p.$slots,"default",{},()=>[p.icon?(r.openBlock(),r.createBlock(H,{key:0,color:p.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black",name:p.icon,outline:!s.value&&!i.value,size:"sm"},null,8,["color","name","outline"])):r.createCommentVNode("",!0),p.label?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"labelRef",ref:f,class:r.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",c(p.disabled,i.value,p.variant)])},r.toDisplayString(p.label),3)):r.createCommentVNode("",!0),p.rightIcon?(r.openBlock(),r.createBlock(H,{key:2,color:p.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black",name:p.rightIcon,outline:!s.value&&!i.value,size:"sm"},null,8,["color","name","outline"])):r.createCommentVNode("",!0)]),p.removable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex items-center justify-center rounded-xxxl",!i.value&&!p.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":p.disabled,"cursor-pointer":p.selectable&&!p.disabled}]),onClick:d},[r.createVNode(H,{color:p.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black",name:"close",size:"sm"},null,8,["color"])],2)):r.createCommentVNode("",!0)],34)),[[b,h.value?p.label:null]])}}}),Pr=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(t,{emit:e}){const n=t,o=e,i=r.ref(null),s=r.ref(0),l=r.ref(null),a=r.ref(),d=()=>{var h,m;if(!i.value)return;const u=i.value.getBoundingClientRect();s.value>0&&l.value&&((h=a.value)==null||h.splice(l.value,1)),s.value=0;let f=0;Array.from(i.value.children).forEach((p,g)=>{const b=p.getBoundingClientRect(),y=b.y-u.y;f=Math.max(b.height*2+4,f),y>f&&(s.value+=1,l.value=l.value===null?g:g-s.value)}),s.value>0&&l.value&&((m=a.value)==null||m.splice(l.value,0,{label:`+${s.value}`,removable:!1,selectable:!1,compact:n.compact}))},c=u=>{o("chip-closed",u)};return r.onMounted(()=>{a.value=n.items,d(),new ResizeObserver(()=>{d()}).observe(i.value)}),r.watch(()=>n.items,()=>{a.value=n.items,d()}),(u,f)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chipsContainer",ref:i,class:r.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",u.compact?"max-h-48":"max-h-64"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(h,m)=>(r.openBlock(),r.createBlock(Ys,{key:m,label:h.label,icon:h.icon,selected:h.selected,removable:h.removable!==void 0?h.removable:u.removable,selectable:h.selectable!==void 0?h.selectable:u.selectable,disabled:h.disabled!==void 0?h.disabled:u.disabled,compact:u.compact,variant:h.variant,onChipClosed:p=>c(m)},null,8,["label","icon","selected","removable","selectable","disabled","compact","variant","onChipClosed"]))),128))],2))}}),sf={class:"flex h-48 items-center justify-center w-48"},js=r.defineComponent({__name:"FmDialogContent",props:{modelValue:{type:Boolean,default:!1},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=r.ref(null),i=r.ref(!1),s=r.ref(!1),l=d=>{const c=d.scrollHeight,u=d.scrollTop+d.clientHeight;s.value=c===u,i.value=d.scrollTop===0},a=d=>{d.stopPropagation();const c=d.target;l(c)};return r.watchEffect(()=>{o.value&&l(o.value)}),(d,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-dialog",`min-w-[${d.minWidth}px] max-w-[min(calc(100%-48px),560px)] max-h-[600px]`])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-dialog--header","flex items-center justify-between","fm-typo-title-sm-700 text-fm-color-typo-primary",!i.value&&"fm-shadow-light-300"])},[r.renderSlot(d.$slots,"dialog-header"),r.createElementVNode("div",sf,[d.closeButton?(r.openBlock(),r.createBlock(H,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:c[0]||(c[0]=u=>n("update:modelValue",!1))})):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"fm-dialog--content overflow-y-auto",onScrollPassive:a},[r.renderSlot(d.$slots,"default")],544),d.$slots["dialog-footer"]?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-dialog--footer","flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse",!s.value&&"shadow-[0_-8px_16px_0px_rgba(199,199,204,0.24)]"])},[r.renderSlot(d.$slots,"dialog-footer")],2)):r.createCommentVNode("",!0)],2))}});function yt(){const t=r.ref(window.innerWidth),e=()=>{t.value=window.innerWidth};r.onMounted(()=>{window.addEventListener("resize",e)}),r.onUnmounted(()=>{window.removeEventListener("resize",e)});const n=r.computed(()=>({xs:t.value>=0&&t.value<=647,sm:t.value>=648&&t.value<=959,md:t.value>=960&&t.value<=1247,lg:t.value>=1248})),o={xs:[0,647],sm:[648,959],md:[960,1247],lg:[1248,1/0]};function i(a){return o[a]}function s(a){const d=o[a][1];return t.value<=d}function l(a){return!!o[a]}return{breakpoints:n,isAtMost:s,getBreakpointsBoundary:i,isBreakpointKeyword:l}}function lf(){const t=r.inject(Is);if(!t)throw new Error("No provider");return t}function af(){var t;return(t=r.getCurrentInstance())==null?void 0:t.emit}function df(){const t=af();return{emitData(e){t==null||t("dialog:emit-data",e)}}}function bn(){const t=r.ref(!1);function e(){t.value=!0}function n(){t.value=!1}return{focus:e,blur:n,isFocused:t}}function Ws(t,e){const n=r.ref([]);function o(){const s=[];if(e.value&&e.value.length>0)for(const l of e.value){const d=(typeof l=="function"?l:()=>l)(t.value);d!==!0&&s.push(d)}return n.value=s,n.value}function i(){n.value=[]}return{validate:o,resetValidation:i,errorMessages:n}}function Us(t,e=null,n=null){let o=null;const i=q(t,"modelValue"),s=r.ref(!0),l=r.inject(Rs,null),{validate:a,resetValidation:d,errorMessages:c}=Ws(i,r.toRef(()=>t.rules)),u=(f=n)=>{s.value=!0,d(),f&&typeof f=="function"&&f(),i.value=e};return r.onMounted(()=>{l&&(o=l.register({validate:a,resetValidation:d,resetValue:u}))}),r.onUnmounted(()=>{l&&l.unregister(o)}),r.watch(()=>i.value,()=>{s.value=!1,i.value!==e&&a()}),r.watch(()=>t.focused,f=>{s.value=!1,f||a()}),{validate:a,resetValidation:d,errorMessages:c,resetValue:u,isPristine:s}}function cf(){return r.inject(Br)}const uf=r.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=q(n,"modelValue"),s=document.body.style.overflow;return r.watch(()=>i,l=>{l?document.body.style.overflow="hidden":document.body.style.overflow=s}),(l,a)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{onClick:a[1]||(a[1]=d=>i.value=!0)},[r.renderSlot(l.$slots,"dialog-button",{onClick:a[0]||(a[0]=d=>i.value=!0)})]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"fm-dialog"},{default:r.withCtx(()=>[r.unref(i)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":l.overlay,"prevent-backdrop-event":!l.overlay,transparent:!l.overlay,"center-content":"","z-index":l.zIndex,onClose:a[3]||(a[3]=d=>o("update:modelValue",!1))},{default:r.withCtx(()=>[r.createVNode(js,{"close-button":l.closeButton,"min-width":l.minWidth,"model-value":r.unref(i),"onUpdate:modelValue":a[2]||(a[2]=d=>i.value=d)},{"dialog-header":r.withCtx(()=>[r.renderSlot(l.$slots,"dialog-header")]),"dialog-footer":r.withCtx(()=>[r.renderSlot(l.$slots,"dialog-footer")]),default:r.withCtx(()=>[r.renderSlot(l.$slots,"default")]),_:3},8,["close-button","min-width","model-value"])]),_:3},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):r.createCommentVNode("",!0)]),_:3})]))],64))}}),ff={class:"fm-drop-field"},hf=["accept","disabled"],mf=J(r.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=r.ref(!1),s=r.ref(),l=r.ref(),a=r.ref(),d=x=>{n.disabled||(x.stopPropagation(),x.preventDefault())},c=x=>{n.disabled||(x.stopPropagation(),x.preventDefault(),i.value=!0)},u=x=>{n.disabled||(x.stopPropagation(),x.preventDefault(),i.value=!1)},f=x=>{n.disabled||(x.stopPropagation(),x.preventDefault(),i.value=!1,h(x))},h=x=>{var E;a.value=((E=x.dataTransfer)==null?void 0:E.files)??x.target.files;const N=a.value;if(s.value=p(N[0]),l.value=g(N[0]),s.value&&l.value)o("file-upload",N[0]);else{const R=m();o("file-rejected",[{file:N[0],reason:R}])}},m=()=>{const x=[];return s.value||x.push("invalid-type"),l.value||x.push("invalid-size"),x},p=x=>{if(!n.accept)return!0;const N=n.accept.split(",").map(E=>E.trim());for(const E of N)if(b(E)){if(C(E)===C(x.type))return!0}else if(y(x)===E||x.type===E)return!0;return!1},g=x=>x.size<=n.maxFileSize,b=x=>x.indexOf("*")!==-1,y=x=>"."+x.name.split(".").pop(),C=x=>x.substring(0,x.indexOf("/")),v=r.computed(()=>{if(i.value)return"Drop file to upload";if(s.value){if(!l.value)return`File size exceeds ${n.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),_=r.computed(()=>a.value?!s.value||!l.value:!1);return(x,N)=>(r.openBlock(),r.createElementBlock("label",ff,[r.renderSlot(x.$slots,"label",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[x.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(x.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":_.value&&!x.disabled,"fm-drop-field__container--disabled":x.disabled}]),onDragenter:d,onDragover:c,onDragleave:u,onDrop:f},[(i.value||_.value)&&!x.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":_.value})},r.toDisplayString(v.value),3)):(r.openBlock(),r.createBlock(U,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:x.disabled},null,8,["disabled"])),r.renderSlot(x.$slots,"accept-text",{},()=>[n.accept?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-md-400",[x.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Accepts ${n.accept}`),3)):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:x.accept,disabled:x.disabled,onChange:h},null,40,hf)],34),r.renderSlot(x.$slots,"helper-text",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-sm-400",[x.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Max size ${n.maxFileSize*1e-6}mb`),3)],!0)]))}}),[["__scopeId","data-v-c914dc32"]]),pf={},gf={class:"flex-grow"};function bf(t,e){return r.openBlock(),r.createElementBlock("div",gf)}const $t=J(pf,[["render",bf]]),yf={install:t=>{const e={currentDialog:{vNode:null,container:null},open:n=>{const o={primary:[],secondary:[],tertiary:[]},i=new Array,s={onPrimary:u=>(o.primary.push(u),s),onSecondary:u=>(o.secondary.push(u),s),onTertiary:u=>(o.tertiary.push(u),s),onClose:u=>(i.push(u),s)};function l(){e.close()}const a=document.createElement("div");document.body.appendChild(a);const d=r.markRaw(Gs),c=r.createVNode(d,{...n,unmount:l,storedFunctions:o,"onDialog-closed"(u){i.forEach(f=>f(u))}});return c.appContext=t._context,r.render(c,a),e.currentDialog.vNode=c,e.currentDialog.container=a,s},close:()=>{const{vNode:n,container:o}=e.currentDialog;n===null&&o===null||(o&&r.render(null,o),e.currentDialog={vNode:null,container:null})}};t.config.globalProperties.$dialog=e,t.provide(Is,e)}},$f={key:0,class:"block relative"},wf={key:1,class:"fm-typo-body-md-400 text-fm-color-neutral-black"},Gs=r.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},dismissAway:{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},zIndex:{default:void 0}},emits:["dialog-opened","dialog-closed"],setup(t,{emit:e}){const n=r.ref(!1),o=r.ref(),i=r.computed(()=>s.primaryActions||s.secondaryActions||s.tertiaryActions),s=t,l=e,a=()=>{s.overlay&&(n.value=!1,setTimeout(()=>{s.unmount()},500))},d=(c,u)=>{s.storedFunctions[u].forEach(f=>f(o.value)),c.close&&a()};return r.onMounted(()=>{l("dialog-opened"),n.value=!0}),r.onUnmounted(()=>{l("dialog-closed",o.value)}),(c,u)=>(r.openBlock(),r.createBlock(r.Transition,{name:"fm-dialog"},{default:r.withCtx(()=>[n.value?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":c.overlay,"prevent-backdrop-event":!c.overlay,transparent:!c.overlay,"center-content":"","z-index":s.zIndex,onClose:a},{default:r.withCtx(()=>[c.dialogComponent?(r.openBlock(),r.createElementBlock("div",$f,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.dialogComponent),r.normalizeProps(r.guardReactiveProps(c.dialogComponentProps)),null,16)),c.closeButton?(r.openBlock(),r.createBlock(H,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:a})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createBlock(js,{key:1,modelValue:n.value,"onUpdate:modelValue":u[4]||(u[4]=f=>n.value=f),"close-button":c.closeButton,"min-width":c.minWidth},r.createSlots({"dialog-header":r.withCtx(()=>[r.createElementVNode("div",null,r.toDisplayString(c.title??"Notification"),1)]),default:r.withCtx(()=>[c.contentComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.contentComponent),r.mergeProps({key:0},c.contentComponentProps,{"onDialog:emitData":u[0]||(u[0]=f=>o.value=f)}),null,16)):(r.openBlock(),r.createElementBlock("div",wf,r.toDisplayString(c.message),1))]),_:2},[i.value?{name:"dialog-footer",fn:r.withCtx(()=>[c.tertiaryActions?(r.openBlock(),r.createBlock(U,{key:0,label:c.tertiaryActions.text,variant:c.tertiaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:u[1]||(u[1]=f=>d(c.tertiaryActions,"tertiary"))},null,8,["label","variant"])):r.createCommentVNode("",!0),r.createVNode($t,{class:"sm:hidden xs:hidden"}),c.secondaryActions?(r.openBlock(),r.createBlock(U,{key:1,label:c.secondaryActions.text,variant:c.secondaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:u[2]||(u[2]=f=>d(c.secondaryActions,"secondary"))},null,8,["label","variant"])):r.createCommentVNode("",!0),c.primaryActions?(r.openBlock(),r.createBlock(U,{key:2,label:c.primaryActions.text,variant:c.primaryActions.variant??"primary",class:"sm:w-full xs:w-full",size:"md",onClick:u[3]||(u[3]=f=>d(c.primaryActions,"primary"))},null,8,["label","variant"])):r.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["modelValue","close-button","min-width"]))]),_:1},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):r.createCommentVNode("",!0)]),_:1}))}});/*!
10
10
  * @kurkle/color v0.3.2
11
11
  * https://github.com/kurkle/color#readme
12
12
  * (c) 2023 Jukka Kurkela
@@ -16,21 +16,21 @@
16
16
  * https://www.chartjs.org
17
17
  * (c) 2024 Chart.js Contributors
18
18
  * Released under the MIT License
19
- */function nt(){}const Yf=(()=>{let t=0;return()=>t++})();function Q(t){return t===null||typeof t>"u"}function re(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 ce(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Pe(t,e){return ce(t)?t:e}function G(t,e){return typeof t>"u"?e:t}const jf=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,tl=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function oe(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function te(t,e,n,o){let i,s,l;if(re(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(l=Object.keys(t),s=l.length,i=0;i<s;i++)e.call(n,t[l[i]],l[i])}function fo(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 ho(t){if(re(t))return t.map(ho);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]]=ho(t[n[i]]);return e}return t}function nl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Wf(t,e,n,o){if(!nl(t))return;const i=e[t],s=n[t];Z(i)&&Z(s)?_n(i,s,o):e[t]=ho(s)}function _n(t,e,n){const o=re(e)?e:[e],i=o.length;if(!Z(t))return t;n=n||{};const s=n.merger||Wf;let l;for(let a=0;a<i;++a){if(l=o[a],!Z(l))continue;const d=Object.keys(l);for(let c=0,u=d.length;c<u;++c)s(d[c],t,l,n)}return t}function kn(t,e){return _n(t,e,{merger:Uf})}function Uf(t,e,n){if(!nl(t))return;const o=e[t],i=n[t];Z(o)&&Z(i)?kn(o,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ho(i))}const ol={"":t=>t,x:t=>t.x,y:t=>t.y};function Gf(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 qf(t){const e=Gf(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function kt(t,e){return(ol[e]||(ol[e]=qf(e)))(t)}function Ir(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Cn=t=>typeof t<"u",Ct=t=>typeof t=="function",rl=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Xf(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const ie=Math.PI,se=2*ie,Kf=se+ie,mo=Number.POSITIVE_INFINITY,Zf=ie/180,me=ie/2,Rt=ie/4,il=ie*2/3,xt=Math.log10,Ge=Math.sign;function xn(t,e,n){return Math.abs(t-e)<n}function sl(t){const e=Math.round(t);t=xn(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(xt(t))),o=t/n;return(o<=1?1:o<=2?2:o<=5?5:10)*n}function Jf(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 Qt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Qf(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function ll(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 Le(t){return t*(ie/180)}function Tr(t){return t*(180/ie)}function al(t){if(!ce(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function dl(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*ie&&(s+=se),{angle:s,distance:i}}function zr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function eh(t,e){return(t-e+Kf)%se-ie}function Ne(t){return(t%se+se)%se}function Sn(t,e,n,o){const i=Ne(t),s=Ne(e),l=Ne(n),a=Ne(s-i),d=Ne(l-i),c=Ne(i-s),u=Ne(i-l);return i===s||i===l||o&&s===l||a>d&&c<u}function $e(t,e,n){return Math.max(e,Math.min(n,t))}function th(t){return $e(t,-32768,32767)}function ot(t,e,n,o=1e-6){return t>=Math.min(e,n)-o&&t<=Math.max(e,n)+o}function Lr(t,e,n){n=n||(l=>t[l]<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 rt=(t,e,n,o)=>Lr(t,n,o?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),nh=(t,e,n)=>Lr(t,n,o=>t[o][e]>=n);function oh(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 cl=["push","pop","shift","splice","unshift"];function rh(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),cl.forEach(n=>{const o="_onData"+Ir(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const l=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[o]=="function"&&a[o](...s)}),l}})})}function ul(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)&&(cl.forEach(s=>{delete t[s]}),delete t._chartjs)}function fl(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const hl=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ml(t,e){let n=[],o=!1;return function(...i){n=i,o||(o=!0,hl.call(window,()=>{o=!1,t.apply(e,n)}))}}function ih(t,e){let n;return function(...o){return e?(clearTimeout(n),n=setTimeout(t,e,o)):t.apply(this,o),e}}const Hr=t=>t==="start"?"left":t==="end"?"right":"center",ke=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,sh=(t,e,n,o)=>t===(o?"left":"right")?n:t==="center"?(e+n)/2:e;function pl(t,e,n){const o=e.length;let i=0,s=o;if(t._sorted){const{iScale:l,_parsed:a}=t,d=l.axis,{min:c,max:u,minDefined:f,maxDefined:h}=l.getUserBounds();f&&(i=$e(Math.min(rt(a,d,c).lo,n?o:rt(e,d,l.getPixelForValue(c)).lo),0,o-1)),h?s=$e(Math.max(rt(a,l.axis,u,!0).hi+1,n?0:rt(e,d,l.getPixelForValue(u),!0).hi+1),i,o)-i:s=o-i}return{start:i,count:s}}function gl(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 po=t=>t===0||t===1,bl=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*se/n)),yl=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*se/n)+1,vn={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*me)+1,easeOutSine:t=>Math.sin(t*me),easeInOutSine:t=>-.5*(Math.cos(ie*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=>po(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=>po(t)?t:bl(t,.075,.3),easeOutElastic:t=>po(t)?t:yl(t,.075,.3),easeInOutElastic(t){return po(t)?t:t<.5?.5*bl(t*2,.1125,.45):.5+.5*yl(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-vn.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?vn.easeInBounce(t*2)*.5:vn.easeOutBounce(t*2-1)*.5+.5};function Yr(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function $l(t){return Yr(t)?t:new wn(t)}function jr(t){return Yr(t)?t:new wn(t).saturate(.5).darken(.1).hexString()}const lh=["x","y","borderWidth","radius","tension"],ah=["color","borderColor","backgroundColor"];function dh(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:ah},numbers:{type:"number",properties:lh}}),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 ch(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const wl=new Map;function uh(t,e){e=e||{};const n=t+JSON.stringify(e);let o=wl.get(n);return o||(o=new Intl.NumberFormat(t,e),wl.set(n,o)),o}function Dn(t,e,n){return uh(e,n).format(t)}const _l={values(t){return re(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 c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=fh(t,n)}const l=xt(Math.abs(s)),a=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),d={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(d,this.options.ticks.format),Dn(t,o,d)},logarithmic(t,e,n){if(t===0)return"0";const o=n[e].significand||t/Math.pow(10,Math.floor(xt(t)));return[1,2,3,5,10,15].includes(o)||e>.8*n.length?_l.numeric.call(this,t,e,n):""}};function fh(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 go={formatters:_l};function hh(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:go.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 At=Object.create(null),Wr=Object.create(null);function Mn(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 Ur(t,e,n){return typeof e=="string"?_n(Mn(t,e),n):_n(Mn(t,""),e)}class mh{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)=>jr(i.backgroundColor),this.hoverBorderColor=(o,i)=>jr(i.borderColor),this.hoverColor=(o,i)=>jr(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 Ur(this,e,n)}get(e){return Mn(this,e)}describe(e,n){return Ur(Wr,e,n)}override(e,n){return Ur(At,e,n)}route(e,n,o,i){const s=Mn(this,e),l=Mn(this,o),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const d=this[a],c=l[i];return Z(d)?Object.assign({},c,d):G(d,c)},set(d){this[a]=d}}})}apply(e){e.forEach(n=>n(this))}}var ue=new mh({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dh,ch,hh]);function ph(t){return!t||Q(t.size)||Q(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function bo(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 gh(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 l=0;const a=n.length;let d,c,u,f,h;for(d=0;d<a;d++)if(f=n[d],f!=null&&!re(f))l=bo(t,i,s,l,f);else if(re(f))for(c=0,u=f.length;c<u;c++)h=f[c],h!=null&&!re(h)&&(l=bo(t,i,s,l,h));t.restore();const m=s.length/2;if(m>n.length){for(d=0;d<m;d++)delete i[s[d]];s.splice(0,m)}return l}function Ot(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 kl(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Gr(t,e,n,o){Cl(t,e,n,o,null)}function Cl(t,e,n,o,i){let s,l,a,d,c,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let b=(p||0)*Zf;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,o),t.rotate(b),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(g)||g<=0)){switch(t.beginPath(),m){default:i?t.ellipse(n,o,i/2,g,0,0,se):t.arc(n,o,g,0,se),t.closePath();break;case"triangle":u=i?i/2:g,t.moveTo(n+Math.sin(b)*u,o-Math.cos(b)*g),b+=il,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*g),b+=il,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*g),t.closePath();break;case"rectRounded":c=g*.516,d=g-c,l=Math.cos(b+Rt)*d,f=Math.cos(b+Rt)*(i?i/2-c:d),a=Math.sin(b+Rt)*d,h=Math.sin(b+Rt)*(i?i/2-c:d),t.arc(n-f,o-a,c,b-ie,b-me),t.arc(n+h,o-l,c,b-me,b),t.arc(n+f,o+a,c,b,b+me),t.arc(n-h,o+l,c,b+me,b+ie),t.closePath();break;case"rect":if(!p){d=Math.SQRT1_2*g,u=i?i/2:d,t.rect(n-u,o-d,2*u,2*d);break}b+=Rt;case"rectRot":f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+h,o-l),t.lineTo(n+f,o+a),t.lineTo(n-h,o+l),t.closePath();break;case"crossRot":b+=Rt;case"cross":f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+h,o-l),t.lineTo(n-h,o+l);break;case"star":f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+h,o-l),t.lineTo(n-h,o+l),b+=Rt,f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+h,o-l),t.lineTo(n-h,o+l);break;case"line":l=i?i/2:Math.cos(b)*g,a=Math.sin(b)*g,t.moveTo(n-l,o-a),t.lineTo(n+l,o+a);break;case"dash":t.moveTo(n,o),t.lineTo(n+Math.cos(b)*(i?i/2:g),o+Math.sin(b)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function it(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 yo(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function $o(t){t.restore()}function bh(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 yh(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 $h(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Q(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 wh(t,e,n,o,i){if(i.strikethrough||i.underline){const s=t.measureText(o),l=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,d=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(d+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(l,u),t.lineTo(a,u),t.stroke()}}function _h(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function It(t,e,n,o,i,s={}){const l=re(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let d,c;for(t.save(),t.font=i.string,$h(t,s),d=0;d<l.length;++d)c=l[d],s.backdrop&&_h(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Q(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(c,n,o,s.maxWidth)),t.fillText(c,n,o,s.maxWidth),wh(t,n,o,c,s),o+=Number(i.lineHeight);t.restore()}function Vn(t,e){const{x:n,y:o,w:i,h:s,radius:l}=e;t.arc(n+l.topLeft,o+l.topLeft,l.topLeft,1.5*ie,ie,!0),t.lineTo(n,o+s-l.bottomLeft),t.arc(n+l.bottomLeft,o+s-l.bottomLeft,l.bottomLeft,ie,me,!0),t.lineTo(n+i-l.bottomRight,o+s),t.arc(n+i-l.bottomRight,o+s-l.bottomRight,l.bottomRight,me,0,!0),t.lineTo(n+i,o+l.topRight),t.arc(n+i-l.topRight,o+l.topRight,l.topRight,0,-me,!0),t.lineTo(n+l.topLeft,o)}const kh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ch=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xh(t,e){const n=(""+t).match(kh);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 Sh=t=>+t||0;function qr(t,e){const n={},o=Z(e),i=o?Object.keys(e):e,s=Z(t)?o?l=>G(t[l],t[e[l]]):l=>t[l]:()=>t;for(const l of i)n[l]=Sh(s(l));return n}function xl(t){return qr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Tt(t){return qr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ce(t){const e=xl(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||ue.font;let n=G(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let o=G(t.style,e.style);o&&!(""+o).match(Ch)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const i={family:G(t.family,e.family),lineHeight:xh(G(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:G(t.weight,e.weight),string:""};return i.string=ph(i),i}function Bn(t,e,n,o){let i=!0,s,l,a;for(s=0,l=t.length;s<l;++s)if(a=t[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),i=!1),n!==void 0&&re(a)&&(a=a[n%a.length],i=!1),a!==void 0))return o&&!i&&(o.cacheable=!1),a}function vh(t,e,n){const{min:o,max:i}=t,s=tl(e,(i-o)/2),l=(a,d)=>n&&a===0?0:a+d;return{min:l(o,-Math.abs(s)),max:l(i,s)}}function St(t,e){return Object.assign(Object.create(t),e)}function Xr(t,e=[""],n,o,i=()=>t[0]){const s=n||t;typeof o>"u"&&(o=Vl("_fallback",t));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:o,_getTarget:i,override:a=>Xr([a,...t],e,s,o)};return new Proxy(l,{deleteProperty(a,d){return delete a[d],delete a._keys,delete t[0][d],!0},get(a,d){return vl(a,d,()=>Fh(d,e,t,a))},getOwnPropertyDescriptor(a,d){return Reflect.getOwnPropertyDescriptor(a._scopes[0],d)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,d){return Bl(a).includes(d)},ownKeys(a){return Bl(a)},set(a,d,c){const u=a._storage||(a._storage=i());return a[d]=u[d]=c,delete a._keys,!0}})}function en(t,e,n,o){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Sl(t,o),setContext:s=>en(t,s,n,o),override:s=>en(t.override(s),e,n,o)};return new Proxy(i,{deleteProperty(s,l){return delete s[l],delete t[l],!0},get(s,l,a){return vl(s,l,()=>Mh(s,l,a))},getOwnPropertyDescriptor(s,l){return s._descriptors.allKeys?Reflect.has(t,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,l)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,l){return Reflect.has(t,l)},ownKeys(){return Reflect.ownKeys(t)},set(s,l,a){return t[l]=a,delete s[l],!0}})}function Sl(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:Ct(n)?n:()=>n,isIndexable:Ct(o)?o:()=>o}}const Dh=(t,e)=>t?t+Ir(e):e,Kr=(t,e)=>Z(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function vl(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const o=n();return t[e]=o,o}function Mh(t,e,n){const{_proxy:o,_context:i,_subProxy:s,_descriptors:l}=t;let a=o[e];return Ct(a)&&l.isScriptable(e)&&(a=Vh(e,a,t,n)),re(a)&&a.length&&(a=Bh(e,a,t,l.isIndexable)),Kr(e,a)&&(a=en(a,i,s&&s[e],l)),a}function Vh(t,e,n,o){const{_proxy:i,_context:s,_subProxy:l,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let d=e(s,l||o);return a.delete(t),Kr(t,d)&&(d=Zr(i._scopes,i,t,d)),d}function Bh(t,e,n,o){const{_proxy:i,_context:s,_subProxy:l,_descriptors:a}=n;if(typeof s.index<"u"&&o(t))return e[s.index%e.length];if(Z(e[0])){const d=e,c=i._scopes.filter(u=>u!==d);e=[];for(const u of d){const f=Zr(c,i,t,u);e.push(en(f,s,l&&l[t],a))}}return e}function Dl(t,e,n){return Ct(t)?t(e,n):t}const Eh=(t,e)=>t===!0?e:typeof t=="string"?kt(e,t):void 0;function Ph(t,e,n,o,i){for(const s of e){const l=Eh(n,s);if(l){t.add(l);const a=Dl(l._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==o)return a}else if(l===!1&&typeof o<"u"&&n!==o)return null}return!1}function Zr(t,e,n,o){const i=e._rootScopes,s=Dl(e._fallback,n,o),l=[...t,...i],a=new Set;a.add(o);let d=Ml(a,l,n,s||n,o);return d===null||typeof s<"u"&&s!==n&&(d=Ml(a,l,s,d,o),d===null)?!1:Xr(Array.from(a),[""],i,s,()=>Nh(e,n,o))}function Ml(t,e,n,o,i){for(;n;)n=Ph(t,e,n,o,i);return n}function Nh(t,e,n){const o=t._getTarget();e in o||(o[e]={});const i=o[e];return re(i)&&Z(n)?n:i||{}}function Fh(t,e,n,o){let i;for(const s of e)if(i=Vl(Dh(s,t),n),typeof i<"u")return Kr(t,i)?Zr(n,o,t,i):i}function Vl(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function Bl(t){let e=t._keys;return e||(e=t._keys=Rh(t._scopes)),e}function Rh(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 El(t,e,n,o){const{iScale:i}=t,{key:s="r"}=this._parsing,l=new Array(o);let a,d,c,u;for(a=0,d=o;a<d;++a)c=a+n,u=e[c],l[a]={r:i.parse(kt(u,s),c)};return l}const Ah=Number.EPSILON||1e-14,tn=(t,e)=>e<t.length&&!t[e].skip&&t[e],Pl=t=>t==="x"?"y":"x";function Oh(t,e,n,o){const i=t.skip?e:t,s=e,l=n.skip?e:n,a=zr(s,i),d=zr(l,s);let c=a/(a+d),u=d/(a+d);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=o*c,h=o*u;return{previous:{x:s.x-f*(l.x-i.x),y:s.y-f*(l.y-i.y)},next:{x:s.x+h*(l.x-i.x),y:s.y+h*(l.y-i.y)}}}function Ih(t,e,n){const o=t.length;let i,s,l,a,d,c=tn(t,0);for(let u=0;u<o-1;++u)if(d=c,c=tn(t,u+1),!(!d||!c)){if(xn(e[u],0,Ah)){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)&&(l=3/Math.sqrt(a),n[u]=i*l*e[u],n[u+1]=s*l*e[u])}}function Th(t,e,n="x"){const o=Pl(n),i=t.length;let s,l,a,d=tn(t,0);for(let c=0;c<i;++c){if(l=a,a=d,d=tn(t,c+1),!a)continue;const u=a[n],f=a[o];l&&(s=(u-l[n])/3,a[`cp1${n}`]=u-s,a[`cp1${o}`]=f-s*e[c]),d&&(s=(d[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${o}`]=f+s*e[c])}}function zh(t,e="x"){const n=Pl(e),o=t.length,i=Array(o).fill(0),s=Array(o);let l,a,d,c=tn(t,0);for(l=0;l<o;++l)if(a=d,d=c,c=tn(t,l+1),!!d){if(c){const u=c[e]-d[e];i[l]=u!==0?(c[n]-d[n])/u:0}s[l]=a?c?Ge(i[l-1])!==Ge(i[l])?0:(i[l-1]+i[l])/2:i[l-1]:i[l]}Ih(t,i,s),Th(t,s,e)}function wo(t,e,n){return Math.max(Math.min(t,n),e)}function Lh(t,e){let n,o,i,s,l,a=it(t[0],e);for(n=0,o=t.length;n<o;++n)l=s,s=a,a=n<o-1&&it(t[n+1],e),s&&(i=t[n],l&&(i.cp1x=wo(i.cp1x,e.left,e.right),i.cp1y=wo(i.cp1y,e.top,e.bottom)),a&&(i.cp2x=wo(i.cp2x,e.left,e.right),i.cp2y=wo(i.cp2y,e.top,e.bottom)))}function Hh(t,e,n,o,i){let s,l,a,d;if(e.spanGaps&&(t=t.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")zh(t,i);else{let c=o?t[t.length-1]:t[0];for(s=0,l=t.length;s<l;++s)a=t[s],d=Oh(c,a,t[Math.min(s+1,l-(o?0:1))%l],e.tension),a.cp1x=d.previous.x,a.cp1y=d.previous.y,a.cp2x=d.next.x,a.cp2y=d.next.y,c=a}e.capBezierPoints&&Lh(t,n)}function Jr(){return typeof window<"u"&&typeof document<"u"}function Qr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function _o(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 ko=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Yh(t,e){return ko(t).getPropertyValue(e)}const jh=["top","right","bottom","left"];function zt(t,e,n){const o={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=jh[i];o[s]=parseFloat(t[e+"-"+s+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const Wh=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Uh(t,e){const n=t.touches,o=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=o;let l=!1,a,d;if(Wh(i,s,t.target))a=i,d=s;else{const c=e.getBoundingClientRect();a=o.clientX-c.left,d=o.clientY-c.top,l=!0}return{x:a,y:d,box:l}}function Lt(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:o}=e,i=ko(n),s=i.boxSizing==="border-box",l=zt(i,"padding"),a=zt(i,"border","width"),{x:d,y:c,box:u}=Uh(t,n),f=l.left+(u&&a.left),h=l.top+(u&&a.top);let{width:m,height:p}=e;return s&&(m-=l.width+a.width,p-=l.height+a.height),{x:Math.round((d-f)/m*n.width/o),y:Math.round((c-h)/p*n.height/o)}}function Gh(t,e,n){let o,i;if(e===void 0||n===void 0){const s=Qr(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const l=s.getBoundingClientRect(),a=ko(s),d=zt(a,"border","width"),c=zt(a,"padding");e=l.width-c.width-d.width,n=l.height-c.height-d.height,o=_o(a.maxWidth,s,"clientWidth"),i=_o(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:o||mo,maxHeight:i||mo}}const Co=t=>Math.round(t*10)/10;function qh(t,e,n,o){const i=ko(t),s=zt(i,"margin"),l=_o(i.maxWidth,t,"clientWidth")||mo,a=_o(i.maxHeight,t,"clientHeight")||mo,d=Gh(t,e,n);let{width:c,height:u}=d;if(i.boxSizing==="content-box"){const h=zt(i,"border","width"),m=zt(i,"padding");c-=m.width+h.width,u-=m.height+h.height}return c=Math.max(0,c-s.width),u=Math.max(0,o?c/o:u-s.height),c=Co(Math.min(c,l,d.maxWidth)),u=Co(Math.min(u,a,d.maxHeight)),c&&!u&&(u=Co(c/2)),(e!==void 0||n!==void 0)&&o&&d.height&&u>d.height&&(u=d.height,c=Co(Math.floor(u*o))),{width:c,height:u}}function Nl(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 l=t.canvas;return l.style&&(n||!l.style.height&&!l.style.width)&&(l.style.height=`${t.height}px`,l.style.width=`${t.width}px`),t.currentDevicePixelRatio!==o||l.height!==i||l.width!==s?(t.currentDevicePixelRatio=o,l.height=i,l.width=s,t.ctx.setTransform(o,0,0,o,0,0),!0):!1}const Xh=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Jr()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Fl(t,e){const n=Yh(t,e),o=n&&n.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function Ht(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function Kh(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 Zh(t,e,n,o){const i={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},l=Ht(t,i,n),a=Ht(i,s,n),d=Ht(s,e,n),c=Ht(l,a,n),u=Ht(a,d,n);return Ht(c,u,n)}const Jh=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}}},Qh=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function nn(t,e,n){return t?Jh(e,n):Qh()}function Rl(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 Al(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ol(t){return t==="angle"?{between:Sn,compare:eh,normalize:Ne}:{between:ot,compare:(e,n)=>e-n,normalize:e=>e}}function Il({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 em(t,e,n){const{property:o,start:i,end:s}=n,{between:l,normalize:a}=Ol(o),d=e.length;let{start:c,end:u,loop:f}=t,h,m;if(f){for(c+=d,u+=d,h=0,m=d;h<m&&l(a(e[c%d][o]),i,s);++h)c--,u--;c%=d,u%=d}return u<c&&(u+=d),{start:c,end:u,loop:f,style:t.style}}function Tl(t,e,n){if(!n)return[t];const{property:o,start:i,end:s}=n,l=e.length,{compare:a,between:d,normalize:c}=Ol(o),{start:u,end:f,loop:h,style:m}=em(t,e,n),p=[];let g=!1,b=null,y,k,M;const w=()=>d(i,M,y)&&a(i,M)!==0,_=()=>a(s,y)===0||d(s,M,y),F=()=>g||w(),$=()=>!g||_();for(let S=u,D=u;S<=f;++S)k=e[S%l],!k.skip&&(y=c(k[o]),y!==M&&(g=d(y,i,s),b===null&&F()&&(b=a(y,i)===0?S:D),b!==null&&$()&&(p.push(Il({start:b,end:S,loop:h,count:l,style:m})),b=null),D=S,M=y));return b!==null&&p.push(Il({start:b,end:f,loop:h,count:l,style:m})),p}function zl(t,e){const n=[],o=t.segments;for(let i=0;i<o.length;i++){const s=Tl(o[i],t.points,e);s.length&&n.push(...s)}return n}function tm(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 nm(t,e,n,o){const i=t.length,s=[];let l=e,a=t[e],d;for(d=e+1;d<=n;++d){const c=t[d%i];c.skip||c.stop?a.skip||(o=!1,s.push({start:e%i,end:(d-1)%i,loop:o}),e=l=c.stop?d:null):(l=d,a.skip&&(e=d)),a=c}return l!==null&&s.push({start:e%i,end:l%i,loop:o}),s}function om(t,e){const n=t.points,o=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:l,end:a}=tm(n,i,s,o);if(o===!0)return Ll(t,[{start:l,end:a,loop:s}],n,e);const d=a<l?a+i:a,c=!!t._fullLoop&&l===0&&a===i-1;return Ll(t,nm(n,l,d,c),n,e)}function Ll(t,e,n,o){return!o||!o.setContext||!n?e:rm(t,e,n,o)}function rm(t,e,n,o){const i=t._chart.getContext(),s=Hl(t.options),{_datasetIndex:l,options:{spanGaps:a}}=t,d=n.length,c=[];let u=s,f=e[0].start,h=f;function m(p,g,b,y){const k=a?-1:1;if(p!==g){for(p+=d;n[p%d].skip;)p-=k;for(;n[g%d].skip;)g+=k;p%d!==g%d&&(c.push({start:p%d,end:g%d,loop:b,style:y}),u=y,f=g%d)}}for(const p of e){f=a?f:p.start;let g=n[f%d],b;for(h=f+1;h<=p.end;h++){const y=n[h%d];b=Hl(o.setContext(St(i,{type:"segment",p0:g,p1:y,p0DataIndex:(h-1)%d,p1DataIndex:h%d,datasetIndex:l}))),im(b,u)&&m(f,h-1,p.loop,u),g=y,u=b}f<h-1&&m(f,h-1,p.loop,u)}return c}function Hl(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function im(t,e){if(!e)return!1;const n=[],o=function(i,s){return Yr(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,o)!==JSON.stringify(e,o)}/*!
19
+ */function nt(){}const Yf=(()=>{let t=0;return()=>t++})();function Q(t){return t===null||typeof t>"u"}function re(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 ce(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Pe(t,e){return ce(t)?t:e}function G(t,e){return typeof t>"u"?e:t}const jf=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,tl=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function oe(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function ne(t,e,n,o){let i,s,l;if(re(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(l=Object.keys(t),s=l.length,i=0;i<s;i++)e.call(n,t[l[i]],l[i])}function fo(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 ho(t){if(re(t))return t.map(ho);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]]=ho(t[n[i]]);return e}return t}function nl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Wf(t,e,n,o){if(!nl(t))return;const i=e[t],s=n[t];Z(i)&&Z(s)?_n(i,s,o):e[t]=ho(s)}function _n(t,e,n){const o=re(e)?e:[e],i=o.length;if(!Z(t))return t;n=n||{};const s=n.merger||Wf;let l;for(let a=0;a<i;++a){if(l=o[a],!Z(l))continue;const d=Object.keys(l);for(let c=0,u=d.length;c<u;++c)s(d[c],t,l,n)}return t}function kn(t,e){return _n(t,e,{merger:Uf})}function Uf(t,e,n){if(!nl(t))return;const o=e[t],i=n[t];Z(o)&&Z(i)?kn(o,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ho(i))}const ol={"":t=>t,x:t=>t.x,y:t=>t.y};function Gf(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 qf(t){const e=Gf(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function kt(t,e){return(ol[e]||(ol[e]=qf(e)))(t)}function Ir(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Cn=t=>typeof t<"u",Ct=t=>typeof t=="function",rl=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Xf(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const ie=Math.PI,se=2*ie,Kf=se+ie,mo=Number.POSITIVE_INFINITY,Zf=ie/180,me=ie/2,Rt=ie/4,il=ie*2/3,xt=Math.log10,Ge=Math.sign;function xn(t,e,n){return Math.abs(t-e)<n}function sl(t){const e=Math.round(t);t=xn(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(xt(t))),o=t/n;return(o<=1?1:o<=2?2:o<=5?5:10)*n}function Jf(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 Qt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Qf(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function ll(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 Le(t){return t*(ie/180)}function Tr(t){return t*(180/ie)}function al(t){if(!ce(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function dl(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*ie&&(s+=se),{angle:s,distance:i}}function zr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function eh(t,e){return(t-e+Kf)%se-ie}function Ne(t){return(t%se+se)%se}function Sn(t,e,n,o){const i=Ne(t),s=Ne(e),l=Ne(n),a=Ne(s-i),d=Ne(l-i),c=Ne(i-s),u=Ne(i-l);return i===s||i===l||o&&s===l||a>d&&c<u}function $e(t,e,n){return Math.max(e,Math.min(n,t))}function th(t){return $e(t,-32768,32767)}function ot(t,e,n,o=1e-6){return t>=Math.min(e,n)-o&&t<=Math.max(e,n)+o}function Lr(t,e,n){n=n||(l=>t[l]<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 rt=(t,e,n,o)=>Lr(t,n,o?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),nh=(t,e,n)=>Lr(t,n,o=>t[o][e]>=n);function oh(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 cl=["push","pop","shift","splice","unshift"];function rh(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),cl.forEach(n=>{const o="_onData"+Ir(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const l=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[o]=="function"&&a[o](...s)}),l}})})}function ul(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)&&(cl.forEach(s=>{delete t[s]}),delete t._chartjs)}function fl(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const hl=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ml(t,e){let n=[],o=!1;return function(...i){n=i,o||(o=!0,hl.call(window,()=>{o=!1,t.apply(e,n)}))}}function ih(t,e){let n;return function(...o){return e?(clearTimeout(n),n=setTimeout(t,e,o)):t.apply(this,o),e}}const Hr=t=>t==="start"?"left":t==="end"?"right":"center",ke=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,sh=(t,e,n,o)=>t===(o?"left":"right")?n:t==="center"?(e+n)/2:e;function pl(t,e,n){const o=e.length;let i=0,s=o;if(t._sorted){const{iScale:l,_parsed:a}=t,d=l.axis,{min:c,max:u,minDefined:f,maxDefined:h}=l.getUserBounds();f&&(i=$e(Math.min(rt(a,d,c).lo,n?o:rt(e,d,l.getPixelForValue(c)).lo),0,o-1)),h?s=$e(Math.max(rt(a,l.axis,u,!0).hi+1,n?0:rt(e,d,l.getPixelForValue(u),!0).hi+1),i,o)-i:s=o-i}return{start:i,count:s}}function gl(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 po=t=>t===0||t===1,bl=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*se/n)),yl=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*se/n)+1,vn={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*me)+1,easeOutSine:t=>Math.sin(t*me),easeInOutSine:t=>-.5*(Math.cos(ie*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=>po(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=>po(t)?t:bl(t,.075,.3),easeOutElastic:t=>po(t)?t:yl(t,.075,.3),easeInOutElastic(t){return po(t)?t:t<.5?.5*bl(t*2,.1125,.45):.5+.5*yl(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-vn.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?vn.easeInBounce(t*2)*.5:vn.easeOutBounce(t*2-1)*.5+.5};function Yr(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function $l(t){return Yr(t)?t:new wn(t)}function jr(t){return Yr(t)?t:new wn(t).saturate(.5).darken(.1).hexString()}const lh=["x","y","borderWidth","radius","tension"],ah=["color","borderColor","backgroundColor"];function dh(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:ah},numbers:{type:"number",properties:lh}}),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 ch(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const wl=new Map;function uh(t,e){e=e||{};const n=t+JSON.stringify(e);let o=wl.get(n);return o||(o=new Intl.NumberFormat(t,e),wl.set(n,o)),o}function Dn(t,e,n){return uh(e,n).format(t)}const _l={values(t){return re(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 c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=fh(t,n)}const l=xt(Math.abs(s)),a=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),d={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(d,this.options.ticks.format),Dn(t,o,d)},logarithmic(t,e,n){if(t===0)return"0";const o=n[e].significand||t/Math.pow(10,Math.floor(xt(t)));return[1,2,3,5,10,15].includes(o)||e>.8*n.length?_l.numeric.call(this,t,e,n):""}};function fh(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 go={formatters:_l};function hh(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:go.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 At=Object.create(null),Wr=Object.create(null);function Mn(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 Ur(t,e,n){return typeof e=="string"?_n(Mn(t,e),n):_n(Mn(t,""),e)}class mh{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)=>jr(i.backgroundColor),this.hoverBorderColor=(o,i)=>jr(i.borderColor),this.hoverColor=(o,i)=>jr(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 Ur(this,e,n)}get(e){return Mn(this,e)}describe(e,n){return Ur(Wr,e,n)}override(e,n){return Ur(At,e,n)}route(e,n,o,i){const s=Mn(this,e),l=Mn(this,o),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const d=this[a],c=l[i];return Z(d)?Object.assign({},c,d):G(d,c)},set(d){this[a]=d}}})}apply(e){e.forEach(n=>n(this))}}var ue=new mh({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dh,ch,hh]);function ph(t){return!t||Q(t.size)||Q(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function bo(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 gh(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 l=0;const a=n.length;let d,c,u,f,h;for(d=0;d<a;d++)if(f=n[d],f!=null&&!re(f))l=bo(t,i,s,l,f);else if(re(f))for(c=0,u=f.length;c<u;c++)h=f[c],h!=null&&!re(h)&&(l=bo(t,i,s,l,h));t.restore();const m=s.length/2;if(m>n.length){for(d=0;d<m;d++)delete i[s[d]];s.splice(0,m)}return l}function Ot(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 kl(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Gr(t,e,n,o){Cl(t,e,n,o,null)}function Cl(t,e,n,o,i){let s,l,a,d,c,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let b=(p||0)*Zf;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,o),t.rotate(b),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(g)||g<=0)){switch(t.beginPath(),m){default:i?t.ellipse(n,o,i/2,g,0,0,se):t.arc(n,o,g,0,se),t.closePath();break;case"triangle":u=i?i/2:g,t.moveTo(n+Math.sin(b)*u,o-Math.cos(b)*g),b+=il,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*g),b+=il,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*g),t.closePath();break;case"rectRounded":c=g*.516,d=g-c,l=Math.cos(b+Rt)*d,f=Math.cos(b+Rt)*(i?i/2-c:d),a=Math.sin(b+Rt)*d,h=Math.sin(b+Rt)*(i?i/2-c:d),t.arc(n-f,o-a,c,b-ie,b-me),t.arc(n+h,o-l,c,b-me,b),t.arc(n+f,o+a,c,b,b+me),t.arc(n-h,o+l,c,b+me,b+ie),t.closePath();break;case"rect":if(!p){d=Math.SQRT1_2*g,u=i?i/2:d,t.rect(n-u,o-d,2*u,2*d);break}b+=Rt;case"rectRot":f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+h,o-l),t.lineTo(n+f,o+a),t.lineTo(n-h,o+l),t.closePath();break;case"crossRot":b+=Rt;case"cross":f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+h,o-l),t.lineTo(n-h,o+l);break;case"star":f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+h,o-l),t.lineTo(n-h,o+l),b+=Rt,f=Math.cos(b)*(i?i/2:g),l=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(i?i/2:g),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+h,o-l),t.lineTo(n-h,o+l);break;case"line":l=i?i/2:Math.cos(b)*g,a=Math.sin(b)*g,t.moveTo(n-l,o-a),t.lineTo(n+l,o+a);break;case"dash":t.moveTo(n,o),t.lineTo(n+Math.cos(b)*(i?i/2:g),o+Math.sin(b)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function it(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 yo(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function $o(t){t.restore()}function bh(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 yh(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 $h(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Q(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 wh(t,e,n,o,i){if(i.strikethrough||i.underline){const s=t.measureText(o),l=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,d=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(d+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(l,u),t.lineTo(a,u),t.stroke()}}function _h(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function It(t,e,n,o,i,s={}){const l=re(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let d,c;for(t.save(),t.font=i.string,$h(t,s),d=0;d<l.length;++d)c=l[d],s.backdrop&&_h(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Q(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(c,n,o,s.maxWidth)),t.fillText(c,n,o,s.maxWidth),wh(t,n,o,c,s),o+=Number(i.lineHeight);t.restore()}function Vn(t,e){const{x:n,y:o,w:i,h:s,radius:l}=e;t.arc(n+l.topLeft,o+l.topLeft,l.topLeft,1.5*ie,ie,!0),t.lineTo(n,o+s-l.bottomLeft),t.arc(n+l.bottomLeft,o+s-l.bottomLeft,l.bottomLeft,ie,me,!0),t.lineTo(n+i-l.bottomRight,o+s),t.arc(n+i-l.bottomRight,o+s-l.bottomRight,l.bottomRight,me,0,!0),t.lineTo(n+i,o+l.topRight),t.arc(n+i-l.topRight,o+l.topRight,l.topRight,0,-me,!0),t.lineTo(n+l.topLeft,o)}const kh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ch=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xh(t,e){const n=(""+t).match(kh);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 Sh=t=>+t||0;function qr(t,e){const n={},o=Z(e),i=o?Object.keys(e):e,s=Z(t)?o?l=>G(t[l],t[e[l]]):l=>t[l]:()=>t;for(const l of i)n[l]=Sh(s(l));return n}function xl(t){return qr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Tt(t){return qr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ce(t){const e=xl(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||ue.font;let n=G(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let o=G(t.style,e.style);o&&!(""+o).match(Ch)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const i={family:G(t.family,e.family),lineHeight:xh(G(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:G(t.weight,e.weight),string:""};return i.string=ph(i),i}function Bn(t,e,n,o){let i=!0,s,l,a;for(s=0,l=t.length;s<l;++s)if(a=t[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),i=!1),n!==void 0&&re(a)&&(a=a[n%a.length],i=!1),a!==void 0))return o&&!i&&(o.cacheable=!1),a}function vh(t,e,n){const{min:o,max:i}=t,s=tl(e,(i-o)/2),l=(a,d)=>n&&a===0?0:a+d;return{min:l(o,-Math.abs(s)),max:l(i,s)}}function St(t,e){return Object.assign(Object.create(t),e)}function Xr(t,e=[""],n,o,i=()=>t[0]){const s=n||t;typeof o>"u"&&(o=Vl("_fallback",t));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:o,_getTarget:i,override:a=>Xr([a,...t],e,s,o)};return new Proxy(l,{deleteProperty(a,d){return delete a[d],delete a._keys,delete t[0][d],!0},get(a,d){return vl(a,d,()=>Fh(d,e,t,a))},getOwnPropertyDescriptor(a,d){return Reflect.getOwnPropertyDescriptor(a._scopes[0],d)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,d){return Bl(a).includes(d)},ownKeys(a){return Bl(a)},set(a,d,c){const u=a._storage||(a._storage=i());return a[d]=u[d]=c,delete a._keys,!0}})}function en(t,e,n,o){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Sl(t,o),setContext:s=>en(t,s,n,o),override:s=>en(t.override(s),e,n,o)};return new Proxy(i,{deleteProperty(s,l){return delete s[l],delete t[l],!0},get(s,l,a){return vl(s,l,()=>Mh(s,l,a))},getOwnPropertyDescriptor(s,l){return s._descriptors.allKeys?Reflect.has(t,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,l)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,l){return Reflect.has(t,l)},ownKeys(){return Reflect.ownKeys(t)},set(s,l,a){return t[l]=a,delete s[l],!0}})}function Sl(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:Ct(n)?n:()=>n,isIndexable:Ct(o)?o:()=>o}}const Dh=(t,e)=>t?t+Ir(e):e,Kr=(t,e)=>Z(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function vl(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const o=n();return t[e]=o,o}function Mh(t,e,n){const{_proxy:o,_context:i,_subProxy:s,_descriptors:l}=t;let a=o[e];return Ct(a)&&l.isScriptable(e)&&(a=Vh(e,a,t,n)),re(a)&&a.length&&(a=Bh(e,a,t,l.isIndexable)),Kr(e,a)&&(a=en(a,i,s&&s[e],l)),a}function Vh(t,e,n,o){const{_proxy:i,_context:s,_subProxy:l,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let d=e(s,l||o);return a.delete(t),Kr(t,d)&&(d=Zr(i._scopes,i,t,d)),d}function Bh(t,e,n,o){const{_proxy:i,_context:s,_subProxy:l,_descriptors:a}=n;if(typeof s.index<"u"&&o(t))return e[s.index%e.length];if(Z(e[0])){const d=e,c=i._scopes.filter(u=>u!==d);e=[];for(const u of d){const f=Zr(c,i,t,u);e.push(en(f,s,l&&l[t],a))}}return e}function Dl(t,e,n){return Ct(t)?t(e,n):t}const Eh=(t,e)=>t===!0?e:typeof t=="string"?kt(e,t):void 0;function Ph(t,e,n,o,i){for(const s of e){const l=Eh(n,s);if(l){t.add(l);const a=Dl(l._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==o)return a}else if(l===!1&&typeof o<"u"&&n!==o)return null}return!1}function Zr(t,e,n,o){const i=e._rootScopes,s=Dl(e._fallback,n,o),l=[...t,...i],a=new Set;a.add(o);let d=Ml(a,l,n,s||n,o);return d===null||typeof s<"u"&&s!==n&&(d=Ml(a,l,s,d,o),d===null)?!1:Xr(Array.from(a),[""],i,s,()=>Nh(e,n,o))}function Ml(t,e,n,o,i){for(;n;)n=Ph(t,e,n,o,i);return n}function Nh(t,e,n){const o=t._getTarget();e in o||(o[e]={});const i=o[e];return re(i)&&Z(n)?n:i||{}}function Fh(t,e,n,o){let i;for(const s of e)if(i=Vl(Dh(s,t),n),typeof i<"u")return Kr(t,i)?Zr(n,o,t,i):i}function Vl(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function Bl(t){let e=t._keys;return e||(e=t._keys=Rh(t._scopes)),e}function Rh(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 El(t,e,n,o){const{iScale:i}=t,{key:s="r"}=this._parsing,l=new Array(o);let a,d,c,u;for(a=0,d=o;a<d;++a)c=a+n,u=e[c],l[a]={r:i.parse(kt(u,s),c)};return l}const Ah=Number.EPSILON||1e-14,tn=(t,e)=>e<t.length&&!t[e].skip&&t[e],Pl=t=>t==="x"?"y":"x";function Oh(t,e,n,o){const i=t.skip?e:t,s=e,l=n.skip?e:n,a=zr(s,i),d=zr(l,s);let c=a/(a+d),u=d/(a+d);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=o*c,h=o*u;return{previous:{x:s.x-f*(l.x-i.x),y:s.y-f*(l.y-i.y)},next:{x:s.x+h*(l.x-i.x),y:s.y+h*(l.y-i.y)}}}function Ih(t,e,n){const o=t.length;let i,s,l,a,d,c=tn(t,0);for(let u=0;u<o-1;++u)if(d=c,c=tn(t,u+1),!(!d||!c)){if(xn(e[u],0,Ah)){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)&&(l=3/Math.sqrt(a),n[u]=i*l*e[u],n[u+1]=s*l*e[u])}}function Th(t,e,n="x"){const o=Pl(n),i=t.length;let s,l,a,d=tn(t,0);for(let c=0;c<i;++c){if(l=a,a=d,d=tn(t,c+1),!a)continue;const u=a[n],f=a[o];l&&(s=(u-l[n])/3,a[`cp1${n}`]=u-s,a[`cp1${o}`]=f-s*e[c]),d&&(s=(d[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${o}`]=f+s*e[c])}}function zh(t,e="x"){const n=Pl(e),o=t.length,i=Array(o).fill(0),s=Array(o);let l,a,d,c=tn(t,0);for(l=0;l<o;++l)if(a=d,d=c,c=tn(t,l+1),!!d){if(c){const u=c[e]-d[e];i[l]=u!==0?(c[n]-d[n])/u:0}s[l]=a?c?Ge(i[l-1])!==Ge(i[l])?0:(i[l-1]+i[l])/2:i[l-1]:i[l]}Ih(t,i,s),Th(t,s,e)}function wo(t,e,n){return Math.max(Math.min(t,n),e)}function Lh(t,e){let n,o,i,s,l,a=it(t[0],e);for(n=0,o=t.length;n<o;++n)l=s,s=a,a=n<o-1&&it(t[n+1],e),s&&(i=t[n],l&&(i.cp1x=wo(i.cp1x,e.left,e.right),i.cp1y=wo(i.cp1y,e.top,e.bottom)),a&&(i.cp2x=wo(i.cp2x,e.left,e.right),i.cp2y=wo(i.cp2y,e.top,e.bottom)))}function Hh(t,e,n,o,i){let s,l,a,d;if(e.spanGaps&&(t=t.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")zh(t,i);else{let c=o?t[t.length-1]:t[0];for(s=0,l=t.length;s<l;++s)a=t[s],d=Oh(c,a,t[Math.min(s+1,l-(o?0:1))%l],e.tension),a.cp1x=d.previous.x,a.cp1y=d.previous.y,a.cp2x=d.next.x,a.cp2y=d.next.y,c=a}e.capBezierPoints&&Lh(t,n)}function Jr(){return typeof window<"u"&&typeof document<"u"}function Qr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function _o(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 ko=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Yh(t,e){return ko(t).getPropertyValue(e)}const jh=["top","right","bottom","left"];function zt(t,e,n){const o={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=jh[i];o[s]=parseFloat(t[e+"-"+s+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const Wh=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Uh(t,e){const n=t.touches,o=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=o;let l=!1,a,d;if(Wh(i,s,t.target))a=i,d=s;else{const c=e.getBoundingClientRect();a=o.clientX-c.left,d=o.clientY-c.top,l=!0}return{x:a,y:d,box:l}}function Lt(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:o}=e,i=ko(n),s=i.boxSizing==="border-box",l=zt(i,"padding"),a=zt(i,"border","width"),{x:d,y:c,box:u}=Uh(t,n),f=l.left+(u&&a.left),h=l.top+(u&&a.top);let{width:m,height:p}=e;return s&&(m-=l.width+a.width,p-=l.height+a.height),{x:Math.round((d-f)/m*n.width/o),y:Math.round((c-h)/p*n.height/o)}}function Gh(t,e,n){let o,i;if(e===void 0||n===void 0){const s=Qr(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const l=s.getBoundingClientRect(),a=ko(s),d=zt(a,"border","width"),c=zt(a,"padding");e=l.width-c.width-d.width,n=l.height-c.height-d.height,o=_o(a.maxWidth,s,"clientWidth"),i=_o(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:o||mo,maxHeight:i||mo}}const Co=t=>Math.round(t*10)/10;function qh(t,e,n,o){const i=ko(t),s=zt(i,"margin"),l=_o(i.maxWidth,t,"clientWidth")||mo,a=_o(i.maxHeight,t,"clientHeight")||mo,d=Gh(t,e,n);let{width:c,height:u}=d;if(i.boxSizing==="content-box"){const h=zt(i,"border","width"),m=zt(i,"padding");c-=m.width+h.width,u-=m.height+h.height}return c=Math.max(0,c-s.width),u=Math.max(0,o?c/o:u-s.height),c=Co(Math.min(c,l,d.maxWidth)),u=Co(Math.min(u,a,d.maxHeight)),c&&!u&&(u=Co(c/2)),(e!==void 0||n!==void 0)&&o&&d.height&&u>d.height&&(u=d.height,c=Co(Math.floor(u*o))),{width:c,height:u}}function Nl(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 l=t.canvas;return l.style&&(n||!l.style.height&&!l.style.width)&&(l.style.height=`${t.height}px`,l.style.width=`${t.width}px`),t.currentDevicePixelRatio!==o||l.height!==i||l.width!==s?(t.currentDevicePixelRatio=o,l.height=i,l.width=s,t.ctx.setTransform(o,0,0,o,0,0),!0):!1}const Xh=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Jr()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Fl(t,e){const n=Yh(t,e),o=n&&n.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function Ht(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function Kh(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 Zh(t,e,n,o){const i={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},l=Ht(t,i,n),a=Ht(i,s,n),d=Ht(s,e,n),c=Ht(l,a,n),u=Ht(a,d,n);return Ht(c,u,n)}const Jh=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}}},Qh=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function nn(t,e,n){return t?Jh(e,n):Qh()}function Rl(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 Al(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ol(t){return t==="angle"?{between:Sn,compare:eh,normalize:Ne}:{between:ot,compare:(e,n)=>e-n,normalize:e=>e}}function Il({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 em(t,e,n){const{property:o,start:i,end:s}=n,{between:l,normalize:a}=Ol(o),d=e.length;let{start:c,end:u,loop:f}=t,h,m;if(f){for(c+=d,u+=d,h=0,m=d;h<m&&l(a(e[c%d][o]),i,s);++h)c--,u--;c%=d,u%=d}return u<c&&(u+=d),{start:c,end:u,loop:f,style:t.style}}function Tl(t,e,n){if(!n)return[t];const{property:o,start:i,end:s}=n,l=e.length,{compare:a,between:d,normalize:c}=Ol(o),{start:u,end:f,loop:h,style:m}=em(t,e,n),p=[];let g=!1,b=null,y,C,v;const _=()=>d(i,v,y)&&a(i,v)!==0,x=()=>a(s,y)===0||d(s,v,y),N=()=>g||_(),E=()=>!g||x();for(let R=u,k=u;R<=f;++R)C=e[R%l],!C.skip&&(y=c(C[o]),y!==v&&(g=d(y,i,s),b===null&&N()&&(b=a(y,i)===0?R:k),b!==null&&E()&&(p.push(Il({start:b,end:R,loop:h,count:l,style:m})),b=null),k=R,v=y));return b!==null&&p.push(Il({start:b,end:f,loop:h,count:l,style:m})),p}function zl(t,e){const n=[],o=t.segments;for(let i=0;i<o.length;i++){const s=Tl(o[i],t.points,e);s.length&&n.push(...s)}return n}function tm(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 nm(t,e,n,o){const i=t.length,s=[];let l=e,a=t[e],d;for(d=e+1;d<=n;++d){const c=t[d%i];c.skip||c.stop?a.skip||(o=!1,s.push({start:e%i,end:(d-1)%i,loop:o}),e=l=c.stop?d:null):(l=d,a.skip&&(e=d)),a=c}return l!==null&&s.push({start:e%i,end:l%i,loop:o}),s}function om(t,e){const n=t.points,o=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:l,end:a}=tm(n,i,s,o);if(o===!0)return Ll(t,[{start:l,end:a,loop:s}],n,e);const d=a<l?a+i:a,c=!!t._fullLoop&&l===0&&a===i-1;return Ll(t,nm(n,l,d,c),n,e)}function Ll(t,e,n,o){return!o||!o.setContext||!n?e:rm(t,e,n,o)}function rm(t,e,n,o){const i=t._chart.getContext(),s=Hl(t.options),{_datasetIndex:l,options:{spanGaps:a}}=t,d=n.length,c=[];let u=s,f=e[0].start,h=f;function m(p,g,b,y){const C=a?-1:1;if(p!==g){for(p+=d;n[p%d].skip;)p-=C;for(;n[g%d].skip;)g+=C;p%d!==g%d&&(c.push({start:p%d,end:g%d,loop:b,style:y}),u=y,f=g%d)}}for(const p of e){f=a?f:p.start;let g=n[f%d],b;for(h=f+1;h<=p.end;h++){const y=n[h%d];b=Hl(o.setContext(St(i,{type:"segment",p0:g,p1:y,p0DataIndex:(h-1)%d,p1DataIndex:h%d,datasetIndex:l}))),im(b,u)&&m(f,h-1,p.loop,u),g=y,u=b}f<h-1&&m(f,h-1,p.loop,u)}return c}function Hl(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function im(t,e){if(!e)return!1;const n=[],o=function(i,s){return Yr(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,o)!==JSON.stringify(e,o)}/*!
20
20
  * Chart.js v4.4.2
21
21
  * https://www.chartjs.org
22
22
  * (c) 2024 Chart.js Contributors
23
23
  * Released under the MIT License
24
- */class sm{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],l=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:l,currentStep:Math.min(o-n.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=hl.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 l=s.length-1,a=!1,d;for(;l>=0;--l)d=s[l],d._active?(d._total>o.duration&&(o.duration=d._total),d.tick(e),a=!0):(s[l]=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 st=new sm;const Yl="transparent",lm={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=$l(t||Yl),i=o.valid&&$l(e||Yl);return i&&i.valid?i.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class am{constructor(e,n,o,i){const s=n[o];i=Bn([e.to,i,s,e.from]);const l=Bn([e.from,s,i]);this._active=!0,this._fn=e.fn||lm[e.type||typeof l],this._easing=vn[e.easing]||vn.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=l,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,l=this._duration-s;this._start=o,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Bn([e.to,n,i,e.from]),this._from=Bn([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,l=this._loop,a=this._to;let d;if(this._active=s!==a&&(l||n<o),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}d=n/o%2,d=l&&d>1?2-d:d,d=this._easing(Math.min(1,Math.max(0,d))),this._target[i]=this._fn(s,a,d)}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 jl{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Z(e))return;const n=Object.keys(ue.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Z(s))return;const l={};for(const a of n)l[a]=s[a];(re(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!o.has(a))&&o.set(a,l)})})}_animateOptions(e,n){const o=n.options,i=cm(e,o);if(!i)return[];const s=this._createAnimations(i,o);return o.$shared&&dm(e.options.$animations,o).then(()=>{e.options=o},()=>{}),s}_createAnimations(e,n){const o=this._properties,i=[],s=e.$animations||(e.$animations={}),l=Object.keys(n),a=Date.now();let d;for(d=l.length-1;d>=0;--d){const c=l[d];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(e,n));continue}const u=n[c];let f=s[c];const h=o.get(c);if(f)if(h&&f.active()){f.update(h,u,a);continue}else f.cancel();if(!h||!h.duration){e[c]=u;continue}s[c]=f=new am(h,e,c,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 st.add(this._chart,o),!0}}function dm(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 cm(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 Wl(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 um(t,e,n){if(n===!1)return!1;const o=Wl(t,n),i=Wl(e,n);return{top:i.end,right:o.end,bottom:i.start,left:o.start}}function fm(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 Ul(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 Gl(t,e,n,o={}){const i=t.keys,s=o.mode==="single";let l,a,d,c;if(e!==null){for(l=0,a=i.length;l<a;++l){if(d=+i[l],d===n){if(o.all)continue;break}c=t.values[d],ce(c)&&(s||e===0||Ge(e)===Ge(c))&&(e+=c)}return e}}function hm(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 ql(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function mm(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function pm(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 gm(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function Xl(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 Kl(t,e){const{chart:n,_cachedMeta:o}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:l,index:a}=o,d=s.axis,c=l.axis,u=mm(s,l,o),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[d]:g,[c]:b}=p,y=p._stacks||(p._stacks={});h=y[c]=gm(i,u,g),h[a]=b,h._top=Xl(h,l,!0,o.type),h._bottom=Xl(h,l,!1,o.type);const k=h._visualValues||(h._visualValues={});k[a]=b}}function ei(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function bm(t,e){return St(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ym(t,e,n){return St(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function En(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 ti=t=>t==="reset"||t==="none",Zl=(t,e)=>e?t:Object.assign({},t),$m=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Ul(n,!0),values:null};class He{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=ql(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&&En(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,o=this.getDataset(),i=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=n.xAxisID=G(o.xAxisID,ei(e,"x")),l=n.yAxisID=G(o.yAxisID,ei(e,"y")),a=n.rAxisID=G(o.rAxisID,ei(e,"r")),d=n.indexAxis,c=n.iAxisID=i(d,s,l,a),u=n.vAxisID=i(d,l,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(l),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(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&&ul(this._data,this),e._stacked&&En(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(Z(n))this._data=hm(n);else if(o!==n){if(o){ul(o,this);const i=this._cachedMeta;En(i),i._parsed=[]}n&&Object.isExtensible(n)&&rh(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=ql(n.vScale,n),n.stack!==o.stack&&(i=!0,En(n),n.stack=o.stack),this._resyncElements(e),(i||s!==n._stacked)&&Kl(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:l}=o,a=s.axis;let d=e===0&&n===i.length?!0:o._sorted,c=e>0&&o._parsed[e-1],u,f,h;if(this._parsing===!1)o._parsed=i,o._sorted=!0,h=i;else{re(i[e])?h=this.parseArrayData(o,i,e,n):Z(i[e])?h=this.parseObjectData(o,i,e,n):h=this.parsePrimitiveData(o,i,e,n);const m=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)o._parsed[u+e]=f=h[u],d&&(m()&&(d=!1),c=f);o._sorted=d}l&&Kl(this,h)}parsePrimitiveData(e,n,o,i){const{iScale:s,vScale:l}=e,a=s.axis,d=l.axis,c=s.getLabels(),u=s===l,f=new Array(i);let h,m,p;for(h=0,m=i;h<m;++h)p=h+o,f[h]={[a]:u||s.parse(c[p],p),[d]:l.parse(n[p],p)};return f}parseArrayData(e,n,o,i){const{xScale:s,yScale:l}=e,a=new Array(i);let d,c,u,f;for(d=0,c=i;d<c;++d)u=d+o,f=n[u],a[d]={x:s.parse(f[0],u),y:l.parse(f[1],u)};return a}parseObjectData(e,n,o,i){const{xScale:s,yScale:l}=e,{xAxisKey:a="x",yAxisKey:d="y"}=this._parsing,c=new Array(i);let u,f,h,m;for(u=0,f=i;u<f;++u)h=u+o,m=n[h],c[u]={x:s.parse(kt(m,a),h),y:l.parse(kt(m,d),h)};return c}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,l=n[e.axis],a={keys:Ul(i,!0),values:n._stacks[e.axis]._visualValues};return Gl(a,l,s.index,{mode:o})}updateRangeFromParsed(e,n,o,i){const s=o[n.axis];let l=s===null?NaN:s;const a=i&&o._stacks[n.axis];i&&a&&(i.values=a,l=Gl(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,l),e.max=Math.max(e.max,l)}getMinMax(e,n){const o=this._cachedMeta,i=o._parsed,s=o._sorted&&e===o.iScale,l=i.length,a=this._getOtherScale(e),d=$m(n,o,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=pm(a);let h,m;function p(){m=i[h];const g=m[a.axis];return!ce(m[e.axis])||u>g||f<g}for(h=0;h<l&&!(!p()&&(this.updateRangeFromParsed(c,e,m,d),s));++h);if(s){for(h=l-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,e,m,d);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,o=[];let i,s,l;for(i=0,s=n.length;i<s;++i)l=n[i][e.axis],ce(l)&&o.push(l);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=fm(G(this.options.clip,um(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,l=[],a=this._drawStart||0,d=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,s,a,d),u=a;u<a+d;++u){const f=i[u];f.hidden||(f.active&&c?l.push(f):f.draw(e,s))}for(u=0;u<l.length;++u)l[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 l=this._cachedMeta.data[e];s=l.$context||(l.$context=ym(this.getContext(),e,l)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=bm(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,l=e+"-"+n,a=s[l],d=this.enableOptionSharing&&Cn(o);if(a)return Zl(a,d);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),f=i?[`${e}Hover`,"hover",e,""]:[e,""],h=c.getOptionScopes(this.getDataset(),u),m=Object.keys(ue.elements[e]),p=()=>this.getContext(o,i,n),g=c.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=d,s[l]=Object.freeze(Zl(g,d))),g}_resolveAnimations(e,n,o){const i=this.chart,s=this._cachedDataOpts,l=`animation-${n}`,a=s[l];if(a)return a;let d;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);d=u.createResolver(h,this.getContext(e,o,n))}const c=new jl(i,d&&d.animations);return d&&d._cacheable&&(s[l]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||ti(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const o=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(o),l=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,o),{sharedOptions:s,includeOptions:l}}updateElement(e,n,o,i){ti(i)?Object.assign(e,o):this._resolveAnimations(n,i).update(e,o)}updateSharedOptions(e,n,o){e&&!ti(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,d,c]of this._syncList)this[a](d,c);this._syncList=[];const i=o.length,s=n.length,l=Math.min(s,i);l&&this.parse(0,l),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,l=e+n;let a;const d=c=>{for(c.length+=n,a=c.length-1;a>=l;a--)c[a]=c[a-n]};for(d(s),a=e;a<l;++a)s[a]=new this.dataElementType;this._parsing&&d(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&&En(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])}}T(He,"defaults",{}),T(He,"datasetElementType",null),T(He,"dataElementType",null);function wm(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=fl(o.sort((i,s)=>i-s))}return t._cache.$bar}function _m(t){const e=t.iScale,n=wm(e,t.type);let o=e._length,i,s,l,a;const d=()=>{l===32767||l===-32768||(Cn(a)&&(o=Math.min(o,Math.abs(l-a)||o)),a=l)};for(i=0,s=n.length;i<s;++i)l=e.getPixelForValue(n[i]),d();for(a=void 0,i=0,s=e.ticks.length;i<s;++i)l=e.getPixelForTick(i),d();return o}function km(t,e,n,o){const i=n.barThickness;let s,l;return Q(i)?(s=e.min*n.categoryPercentage,l=n.barPercentage):(s=i*o,l=1),{chunk:s/o,ratio:l,start:e.pixels[t]-s/2}}function Cm(t,e,n,o){const i=e.pixels,s=i[t];let l=t>0?i[t-1]:null,a=t<i.length-1?i[t+1]:null;const d=n.categoryPercentage;l===null&&(l=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-l);const c=s-(s-Math.min(l,a))/2*d;return{chunk:Math.abs(a-l)/2*d/o,ratio:n.barPercentage,start:c}}function xm(t,e,n,o){const i=n.parse(t[0],o),s=n.parse(t[1],o),l=Math.min(i,s),a=Math.max(i,s);let d=l,c=a;Math.abs(l)>Math.abs(a)&&(d=a,c=l),e[n.axis]=c,e._custom={barStart:d,barEnd:c,start:i,end:s,min:l,max:a}}function Jl(t,e,n,o){return re(t)?xm(t,e,n,o):e[n.axis]=n.parse(t,o),e}function Ql(t,e,n,o){const i=t.iScale,s=t.vScale,l=i.getLabels(),a=i===s,d=[];let c,u,f,h;for(c=n,u=n+o;c<u;++c)h=e[c],f={},f[i.axis]=a||i.parse(l[c],c),d.push(Jl(h,f,s,c));return d}function ni(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Sm(t,e,n){return t!==0?Ge(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function vm(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 Dm(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:l,end:a,reverse:d,top:c,bottom:u}=vm(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?i=c:(n._bottom||0)===o?i=u:(s[ea(u,l,a,d)]=!0,i=c)),s[ea(i,l,a,d)]=!0,t.borderSkipped=s}function ea(t,e,n,o){return o?(t=Mm(t,e,n),t=ta(t,n,e)):t=ta(t,e,n),t}function Mm(t,e,n){return t===e?n:t===n?e:t}function ta(t,e,n){return t==="start"?e:t==="end"?n:t}function Vm(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class xo extends He{parsePrimitiveData(e,n,o,i){return Ql(e,n,o,i)}parseArrayData(e,n,o,i){return Ql(e,n,o,i)}parseObjectData(e,n,o,i){const{iScale:s,vScale:l}=e,{xAxisKey:a="x",yAxisKey:d="y"}=this._parsing,c=s.axis==="x"?a:d,u=l.axis==="x"?a:d,f=[];let h,m,p,g;for(h=o,m=o+i;h<m;++h)g=n[h],p={},p[s.axis]=s.parse(kt(g,c),h),f.push(Jl(kt(g,u),p,l,h));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),l=s._custom,a=ni(l)?"["+l.start+", "+l.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:l,_cachedMeta:{vScale:a}}=this,d=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,i);for(let m=n;m<n+o;m++){const p=this.getParsed(m),g=s||Q(p[a.axis])?{base:d,head:d}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),y=(p._stacks||{})[a.axis],k={horizontal:c,base:g.base,enableBorderRadius:!y||ni(p._custom)||l===y._top||l===y._bottom,x:c?g.head:b.center,y:c?b.center:g.head,height:c?b.size:Math.abs(g.size),width:c?Math.abs(g.size):b.size};h&&(k.options=f||this.resolveDataElementOptions(m,e[m].active?"active":i));const M=k.options||e[m].options;Dm(k,M,y,l),Vm(k,M,u.ratio),this.updateElement(e[m],m,k,i)}}_getStacks(e,n){const{iScale:o}=this._cachedMeta,i=o.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),s=o.options.stacked,l=[],a=d=>{const c=d.controller.getParsed(n),u=c&&c[d.vScale.axis];if(Q(u)||isNaN(u))return!0};for(const d of i)if(!(n!==void 0&&a(d))&&((s===!1||l.indexOf(d.stack)===-1||s===void 0&&d.stack===void 0)&&l.push(d.stack),d.index===e))break;return l.length||l.push(void 0),l}_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,l;for(s=0,l=n.data.length;s<l;++s)i.push(o.getPixelForValue(this.getParsed(s)[o.axis],s));const a=e.barThickness;return{min:a||_m(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:l}}=this,a=s||0,d=this.getParsed(e),c=d._custom,u=ni(c);let f=d[n.axis],h=0,m=o?this.applyStack(n,d,o):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=c.barStart,m=c.barEnd-c.barStart,f!==0&&Ge(f)!==Ge(c.barEnd)&&(h=0),h+=f);const b=!Q(s)&&!u?s:h;let y=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(h+m):p=y,g=p-y,Math.abs(g)<l){g=Sm(g,n,a)*l,f===a&&(y-=g/2);const k=n.getPixelForDecimal(0),M=n.getPixelForDecimal(1),w=Math.min(k,M),_=Math.max(k,M);y=Math.max(Math.min(y,_),w),p=y+g,o&&!u&&(d._stacks[n.axis]._visualValues[i]=n.getValueForPixel(p)-n.getValueForPixel(y))}if(y===n.getPixelForValue(a)){const k=Ge(g)*n.getLineWidthForValue(a)/2;y+=k,g-=k}return{size:g,base:y,head:p,center:p+g/2}}_calculateBarIndexPixels(e,n){const o=n.scale,i=this.options,s=i.skipNull,l=G(i.maxBarThickness,1/0);let a,d;if(n.grouped){const c=s?this._getStackCount(e):n.stackCount,u=i.barThickness==="flex"?Cm(e,n,i,c):km(e,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0);a=u.start+u.chunk*f+u.chunk/2,d=Math.min(l,u.chunk*u.ratio)}else a=o.getPixelForValue(this.getParsed(e)[o.axis],e),d=Math.min(l,n.min*n.ratio);return{base:a-d/2,head:a+d/2,center:a,size:d}}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)}}T(xo,"id","bar"),T(xo,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),T(xo,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class So extends He{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,o,i){const s=super.parsePrimitiveData(e,n,o,i);for(let l=0;l<s.length;l++)s[l]._custom=this.resolveDataElementOptions(l+o).radius;return s}parseArrayData(e,n,o,i){const s=super.parseArrayData(e,n,o,i);for(let l=0;l<s.length;l++){const a=n[o+l];s[l]._custom=G(a[2],this.resolveDataElementOptions(l+o).radius)}return s}parseObjectData(e,n,o,i){const s=super.parseObjectData(e,n,o,i);for(let l=0;l<s.length;l++){const a=n[o+l];s[l]._custom=G(a&&a.r&&+a.r,this.resolveDataElementOptions(l+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,l=this.getParsed(e),a=i.getLabelForValue(l.x),d=s.getLabelForValue(l.y),c=l._custom;return{label:o[e]||"",value:"("+a+", "+d+(c?", "+c:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:l,vScale:a}=this._cachedMeta,{sharedOptions:d,includeOptions:c}=this._getSharedOptions(n,i),u=l.axis,f=a.axis;for(let h=n;h<n+o;h++){const m=e[h],p=!s&&this.getParsed(h),g={},b=g[u]=s?l.getPixelForDecimal(.5):l.getPixelForValue(p[u]),y=g[f]=s?a.getBasePixel():a.getPixelForValue(p[f]);g.skip=isNaN(b)||isNaN(y),c&&(g.options=d||this.resolveDataElementOptions(h,m.active?"active":i),s&&(g.options.radius=0)),this.updateElement(m,h,g,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+=G(o&&o._custom,s),i}}T(So,"id","bubble"),T(So,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),T(So,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Bm(t,e,n){let o=1,i=1,s=0,l=0;if(e<se){const a=t,d=a+e,c=Math.cos(a),u=Math.sin(a),f=Math.cos(d),h=Math.sin(d),m=(M,w,_)=>Sn(M,a,d,!0)?1:Math.max(w,w*n,_,_*n),p=(M,w,_)=>Sn(M,a,d,!0)?-1:Math.min(w,w*n,_,_*n),g=m(0,c,f),b=m(me,u,h),y=p(ie,c,f),k=p(ie+me,u,h);o=(g-y)/2,i=(b-k)/2,s=-(g+y)/2,l=-(b+k)/2}return{ratioX:o,ratioY:i,offsetX:s,offsetY:l}}class Yt extends He{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=d=>+o[d];if(Z(o[e])){const{key:d="value"}=this._parsing;s=c=>+kt(o[c],d)}let l,a;for(l=e,a=e+n;l<a;++l)i._parsed[l]=s(l)}}_getRotation(){return Le(this.options.rotation-90)}_getCircumference(){return Le(this.options.circumference)}_getRotationExtents(){let e=se,n=-se;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(),l=i._getCircumference();e=Math.min(e,s),n=Math.max(n,s+l)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:o}=n,i=this._cachedMeta,s=i.data,l=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(o.width,o.height)-l)/2,0),d=Math.min(jf(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=Bm(f,u,d),b=(o.width-l)/h,y=(o.height-l)/m,k=Math.max(Math.min(b,y)/2,0),M=tl(this.options.radius,k),w=Math.max(M*d,0),_=(M-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*M,this.offsetY=g*M,i.total=this.calculateTotal(),this.outerRadius=M-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,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/se)}updateElements(e,n,o,i){const s=i==="reset",l=this.chart,a=l.chartArea,c=l.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,h=s&&c.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(n,i);let y=this._getRotation(),k;for(k=0;k<n;++k)y+=this._circumference(k,s);for(k=n;k<n+o;++k){const M=this._circumference(k,s),w=e[k],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+M,circumference:M,outerRadius:p,innerRadius:m};b&&(_.options=g||this.resolveDataElementOptions(k,w.active?"active":i)),y+=M,this.updateElement(w,k,_,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)?se*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Dn(n._parsed[e],o.options.locale);return{label:i[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const o=this.chart;let i,s,l,a,d;if(!e){for(i=0,s=o.data.datasets.length;i<s;++i)if(o.isDatasetVisible(i)){l=o.getDatasetMeta(i),e=l.data,a=l.controller;break}}if(!e)return 0;for(i=0,s=e.length;i<s;++i)d=a.resolveDataElementOptions(i),d.borderAlign!=="inner"&&(n=Math.max(n,d.borderWidth||0,d.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(G(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}T(Yt,"id","doughnut"),T(Yt,"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"}),T(Yt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),T(Yt,"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,l)=>{const d=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:d.backgroundColor,strokeStyle:d.borderColor,fontColor:i,lineWidth:d.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(l),index:l}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}}});class vo extends He{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:o,data:i=[],_dataset:s}=n,l=this.chart._animationsDisabled;let{start:a,count:d}=pl(n,i,l);this._drawStart=a,this._drawCount=d,gl(n)&&(a=0,d=i.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!s._decimated,o.points=i;const c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!l,options:c},e),this.updateElements(i,a,d,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:l,vScale:a,_stacked:d,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),h=l.axis,m=a.axis,{spanGaps:p,segment:g}=this.options,b=Qt(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none",k=n+o,M=e.length;let w=n>0&&this.getParsed(n-1);for(let _=0;_<M;++_){const F=e[_],$=y?F:{};if(_<n||_>=k){$.skip=!0;continue}const S=this.getParsed(_),D=Q(S[m]),v=$[h]=l.getPixelForValue(S[h],_),x=$[m]=s||D?a.getBasePixel():a.getPixelForValue(d?this.applyStack(a,S,d):S[m],_);$.skip=isNaN(v)||isNaN(x)||D,$.stop=_>0&&Math.abs(S[h]-w[h])>b,g&&($.parsed=S,$.raw=c.data[_]),f&&($.options=u||this.resolveDataElementOptions(_,F.active?"active":i)),y||this.updateElement(F,_,$,i),w=S}}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)),l=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(o,s,l)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}T(vo,"id","line"),T(vo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),T(vo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Pn extends He{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=Dn(n._parsed[e].r,o.options.locale);return{label:i[e]||"",value:s}}parseObjectData(e,n,o,i){return El.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),l=Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0),a=(s-l)/e.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,o,i){const s=i==="reset",l=this.chart,d=l.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,h=c.getIndexAngle(0)-.5*ie;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,i,g);for(p=n;p<n+o;p++){const b=e[p];let y=m,k=m+this._computeAngle(p,i,g),M=l.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=k,s&&(d.animateScale&&(M=0),d.animateRotate&&(y=k=h));const w={x:u,y:f,innerRadius:0,outerRadius:M,startAngle:y,endAngle:k,options:this.resolveDataElementOptions(p,b.active?"active":i)};this.updateElement(b,p,w,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)?Le(this.resolveDataElementOptions(e,n).angle||o):0}}T(Pn,"id","polarArea"),T(Pn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),T(Pn,"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,l)=>{const d=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:d.backgroundColor,strokeStyle:d.borderColor,fontColor:i,lineWidth:d.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(l),index:l}})}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 oi extends Yt{}T(oi,"id","pie"),T(oi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Do extends He{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 El.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 l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:l};this.updateElement(o,void 0,a,e)}this.updateElements(i,0,i.length,e)}updateElements(e,n,o,i){const s=this._cachedMeta.rScale,l=i==="reset";for(let a=n;a<n+o;a++){const d=e[a],c=this.resolveDataElementOptions(a,d.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),f=l?s.xCenter:u.x,h=l?s.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:c};this.updateElement(d,a,m,i)}}}T(Do,"id","radar"),T(Do,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),T(Do,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Mo extends He{getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:i,yScale:s}=n,l=this.getParsed(e),a=i.getLabelForValue(l.x),d=s.getLabelForValue(l.y);return{label:o[e]||"",value:"("+a+", "+d+")"}}update(e){const n=this._cachedMeta,{data:o=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:l}=pl(n,o,i);if(this._drawStart=s,this._drawCount=l,gl(n)&&(s=0,l=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:d}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!d._decimated,a.points=o;const c=this.resolveDatasetElementOptions(e);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(o,s,l,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:l,vScale:a,_stacked:d,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),h=this.includeOptions(i,f),m=l.axis,p=a.axis,{spanGaps:g,segment:b}=this.options,y=Qt(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||s||i==="none";let M=n>0&&this.getParsed(n-1);for(let w=n;w<n+o;++w){const _=e[w],F=this.getParsed(w),$=k?_:{},S=Q(F[p]),D=$[m]=l.getPixelForValue(F[m],w),v=$[p]=s||S?a.getBasePixel():a.getPixelForValue(d?this.applyStack(a,F,d):F[p],w);$.skip=isNaN(D)||isNaN(v)||S,$.stop=w>0&&Math.abs(F[m]-M[m])>y,b&&($.parsed=F,$.raw=c.data[w]),h&&($.options=f||this.resolveDataElementOptions(w,_.active?"active":i)),k||this.updateElement(_,w,$,i),M=F}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let d=n.length-1;d>=0;--d)a=Math.max(a,n[d].size(this.resolveDataElementOptions(d))/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)),l=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,l)/2}}T(Mo,"id","scatter"),T(Mo,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),T(Mo,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Em=Object.freeze({__proto__:null,BarController:xo,BubbleController:So,DoughnutController:Yt,LineController:vo,PieController:oi,PolarAreaController:Pn,RadarController:Do,ScatterController:Mo});function jt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ri{constructor(e){T(this,"options");this.options=e||{}}static override(e){Object.assign(ri.prototype,e)}init(){}formats(){return jt()}parse(){return jt()}format(){return jt()}add(){return jt()}diff(){return jt()}startOf(){return jt()}endOf(){return jt()}}var Pm={_date:ri};function Nm(t,e,n,o){const{controller:i,data:s,_sorted:l}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&l&&s.length){const d=a._reversePixels?nh:rt;if(o){if(i._sharedOptions){const c=s[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const f=d(s,e,n-u),h=d(s,e,n+u);return{lo:f.lo,hi:h.hi}}}}else return d(s,e,n)}return{lo:0,hi:s.length-1}}function Nn(t,e,n,o,i){const s=t.getSortedVisibleDatasetMetas(),l=n[e];for(let a=0,d=s.length;a<d;++a){const{index:c,data:u}=s[a],{lo:f,hi:h}=Nm(s[a],e,l,i);for(let m=f;m<=h;++m){const p=u[m];p.skip||o(p,c,m)}}}function Fm(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,l=n?Math.abs(o.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(l,2))}}function ii(t,e,n,o,i){const s=[];return!i&&!t.isPointInArea(e)||Nn(t,n,e,function(a,d,c){!i&&!it(a,t.chartArea,0)||a.inRange(e.x,e.y,o)&&s.push({element:a,datasetIndex:d,index:c})},!0),s}function Rm(t,e,n,o){let i=[];function s(l,a,d){const{startAngle:c,endAngle:u}=l.getProps(["startAngle","endAngle"],o),{angle:f}=dl(l,{x:e.x,y:e.y});Sn(f,c,u)&&i.push({element:l,datasetIndex:a,index:d})}return Nn(t,n,e,s),i}function Am(t,e,n,o,i,s){let l=[];const a=Fm(n);let d=Number.POSITIVE_INFINITY;function c(u,f,h){const m=u.inRange(e.x,e.y,i);if(o&&!m)return;const p=u.getCenterPoint(i);if(!(!!s||t.isPointInArea(p))&&!m)return;const b=a(e,p);b<d?(l=[{element:u,datasetIndex:f,index:h}],d=b):b===d&&l.push({element:u,datasetIndex:f,index:h})}return Nn(t,n,e,c),l}function si(t,e,n,o,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!o?Rm(t,e,n,i):Am(t,e,n,o,i,s)}function na(t,e,n,o,i){const s=[],l=n==="x"?"inXRange":"inYRange";let a=!1;return Nn(t,n,e,(d,c,u)=>{d[l](e[n],i)&&(s.push({element:d,datasetIndex:c,index:u}),a=a||d.inRange(e.x,e.y,i))}),o&&!a?[]:s}var Om={evaluateInteractionItems:Nn,modes:{index(t,e,n,o){const i=Lt(e,t),s=n.axis||"x",l=n.includeInvisible||!1,a=n.intersect?ii(t,i,s,o,l):si(t,i,s,!1,o,l),d=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&d.push({element:f,datasetIndex:c.index,index:u})}),d):[]},dataset(t,e,n,o){const i=Lt(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;let a=n.intersect?ii(t,i,s,o,l):si(t,i,s,!1,o,l);if(a.length>0){const d=a[0].datasetIndex,c=t.getDatasetMeta(d).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:d,index:u})}return a},point(t,e,n,o){const i=Lt(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return ii(t,i,s,o,l)},nearest(t,e,n,o){const i=Lt(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return si(t,i,s,n.intersect,o,l)},x(t,e,n,o){const i=Lt(e,t);return na(t,i,"x",n.intersect,o)},y(t,e,n,o){const i=Lt(e,t);return na(t,i,"y",n.intersect,o)}}};const oa=["left","top","right","bottom"];function Fn(t,e){return t.filter(n=>n.pos===e)}function ra(t,e){return t.filter(n=>oa.indexOf(n.pos)===-1&&n.box.axis===e)}function Rn(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 Im(t){const e=[];let n,o,i,s,l,a;for(n=0,o=(t||[]).length;n<o;++n)i=t[n],{position:s,options:{stack:l,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:l&&s+l,stackWeight:a});return e}function Tm(t){const e={};for(const n of t){const{stack:o,pos:i,stackWeight:s}=n;if(!o||!oa.includes(i))continue;const l=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}return e}function zm(t,e){const n=Tm(t),{vBoxMaxWidth:o,hBoxMaxHeight:i}=e;let s,l,a;for(s=0,l=t.length;s<l;++s){a=t[s];const{fullSize:d}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*o:d&&e.availableWidth,a.height=i):(a.width=o,a.height=u?u*i:d&&e.availableHeight)}return n}function Lm(t){const e=Im(t),n=Rn(e.filter(c=>c.box.fullSize),!0),o=Rn(Fn(e,"left"),!0),i=Rn(Fn(e,"right")),s=Rn(Fn(e,"top"),!0),l=Rn(Fn(e,"bottom")),a=ra(e,"x"),d=ra(e,"y");return{fullSize:n,leftAndTop:o.concat(s),rightAndBottom:i.concat(d).concat(l).concat(a),chartArea:Fn(e,"chartArea"),vertical:o.concat(i).concat(d),horizontal:s.concat(l).concat(a)}}function ia(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function sa(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 Hm(t,e,n,o){const{pos:i,box:s}=n,l=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&&sa(l,s.getPadding());const a=Math.max(0,e.outerWidth-ia(l,t,"left","right")),d=Math.max(0,e.outerHeight-ia(l,t,"top","bottom")),c=a!==t.w,u=d!==t.h;return t.w=a,t.h=d,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Ym(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 jm(t,e){const n=e.maxPadding;function o(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(l=>{s[l]=Math.max(e[l],n[l])}),s}return o(t?["left","right"]:["top","bottom"])}function An(t,e,n,o){const i=[];let s,l,a,d,c,u;for(s=0,l=t.length,c=0;s<l;++s){a=t[s],d=a.box,d.update(a.width||e.w,a.height||e.h,jm(a.horizontal,e));const{same:f,other:h}=Hm(e,n,a,o);c|=f&&i.length,u=u||h,d.fullSize||i.push(a)}return c&&An(i,e,n,o)||u}function Vo(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 la(t,e,n,o){const i=n.padding;let{x:s,y:l}=e;for(const a of t){const d=a.box,c=o[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=e.w*u,h=c.size||d.height;Cn(c.start)&&(l=c.start),d.fullSize?Vo(d,i.left,l,n.outerWidth-i.right-i.left,h):Vo(d,e.left+c.placed,l,f,h),c.start=l,c.placed+=f,l=d.bottom}else{const f=e.h*u,h=c.size||d.width;Cn(c.start)&&(s=c.start),d.fullSize?Vo(d,s,i.top,h,n.outerHeight-i.bottom-i.top):Vo(d,s,e.top+c.placed,h,f),c.start=s,c.placed+=f,s=d.right}}e.x=s,e.y=l}var xe={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=Ce(t.options.layout.padding),s=Math.max(e-i.width,0),l=Math.max(n-i.height,0),a=Lm(t.boxes),d=a.vertical,c=a.horizontal;te(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=d.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:l,vBoxMaxWidth:s/2/u,hBoxMaxHeight:l/2}),h=Object.assign({},i);sa(h,Ce(o));const m=Object.assign({maxPadding:h,w:s,h:l,x:i.left,y:i.top},i),p=zm(d.concat(c),f);An(a.fullSize,m,f,p),An(d,m,f,p),An(c,m,f,p)&&An(d,m,f,p),Ym(m),la(a.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,la(a.rightAndBottom,m,f,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},te(a.chartArea,g=>{const b=g.box;Object.assign(b,t.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class aa{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 Wm extends aa{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Bo="$chartjs",Um={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},da=t=>t===null||t==="";function Gm(t,e){const n=t.style,o=t.getAttribute("height"),i=t.getAttribute("width");if(t[Bo]={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",da(i)){const s=Fl(t,"width");s!==void 0&&(t.width=s)}if(da(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Fl(t,"height");s!==void 0&&(t.height=s)}return t}const ca=Xh?{passive:!0}:!1;function qm(t,e,n){t&&t.addEventListener(e,n,ca)}function Xm(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,ca)}function Km(t,e){const n=Um[t.type]||t.type,{x:o,y:i}=Lt(t,e);return{type:n,chart:e,native:t,x:o!==void 0?o:null,y:i!==void 0?i:null}}function Eo(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Zm(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let l=!1;for(const a of s)l=l||Eo(a.addedNodes,o),l=l&&!Eo(a.removedNodes,o);l&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Jm(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let l=!1;for(const a of s)l=l||Eo(a.removedNodes,o),l=l&&!Eo(a.addedNodes,o);l&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const On=new Map;let ua=0;function fa(){const t=window.devicePixelRatio;t!==ua&&(ua=t,On.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Qm(t,e){On.size||window.addEventListener("resize",fa),On.set(t,e)}function ep(t){On.delete(t),On.size||window.removeEventListener("resize",fa)}function tp(t,e,n){const o=t.canvas,i=o&&Qr(o);if(!i)return;const s=ml((a,d)=>{const c=i.clientWidth;n(a,d),c<i.clientWidth&&n()},window),l=new ResizeObserver(a=>{const d=a[0],c=d.contentRect.width,u=d.contentRect.height;c===0&&u===0||s(c,u)});return l.observe(i),Qm(t,s),l}function li(t,e,n){n&&n.disconnect(),e==="resize"&&ep(t)}function np(t,e,n){const o=t.canvas,i=ml(s=>{t.ctx!==null&&n(Km(s,t))},t);return qm(o,e,i),i}class op extends aa{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Gm(e,n),o):null}releaseContext(e){const n=e.canvas;if(!n[Bo])return!1;const o=n[Bo].initial;["height","width"].forEach(s=>{const l=o[s];Q(l)?n.removeAttribute(s):n.setAttribute(s,l)});const i=o.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Bo],!0}addEventListener(e,n,o){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),l={attach:Zm,detach:Jm,resize:tp}[n]||np;i[n]=l(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),i=o[n];if(!i)return;({attach:li,detach:li,resize:li}[n]||Xm)(e,n,i),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,i){return qh(e,n,o,i)}isAttached(e){const n=Qr(e);return!!(n&&n.isConnected)}}function rp(t){return!Jr()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Wm:op}let lt=(_r=class{constructor(){T(this,"x");T(this,"y");T(this,"active",!1);T(this,"options");T(this,"$animations")}tooltipPosition(e){const{x:n,y:o}=this.getProps(["x","y"],e);return{x:n,y:o}}hasValue(){return Qt(this.x)&&Qt(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}},T(_r,"defaults",{}),T(_r,"defaultRoutes"),_r);function ip(t,e){const n=t.options.ticks,o=sp(t),i=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?ap(e):[],l=s.length,a=s[0],d=s[l-1],c=[];if(l>i)return dp(e,c,s,l/i),c;const u=lp(s,e,i);if(l>0){let f,h;const m=l>1?Math.round((d-a)/(l-1)):null;for(Po(e,c,u,Q(m)?0:a-m,a),f=0,h=l-1;f<h;f++)Po(e,c,u,s[f],s[f+1]);return Po(e,c,u,d,Q(m)?e.length:d+m),c}return Po(e,c,u),c}function sp(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 lp(t,e,n){const o=cp(t),i=e.length/n;if(!o)return Math.max(i,1);const s=Jf(o);for(let l=0,a=s.length-1;l<a;l++){const d=s[l];if(d>i)return d}return Math.max(i,1)}function ap(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function dp(t,e,n,o){let i=0,s=n[0],l;for(o=Math.ceil(o),l=0;l<t.length;l++)l===s&&(e.push(t[l]),i++,s=n[i*o])}function Po(t,e,n,o,i){const s=G(o,0),l=Math.min(G(i,t.length),t.length);let a=0,d,c,u;for(n=Math.ceil(n),i&&(d=i-o,n=d/Math.floor(d/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<l;c++)c===u&&(e.push(t[c]),a++,u=Math.round(s+a*n))}function cp(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 up=t=>t==="left"?"right":t==="right"?"left":t,ha=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,ma=(t,e)=>Math.min(e||t,t);function pa(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 fp(t,e,n){const o=t.ticks.length,i=Math.min(e,o-1),s=t._startPixel,l=t._endPixel,a=1e-6;let d=t.getPixelForTick(i),c;if(!(n&&(o===1?c=Math.max(d-s,l-d):e===0?c=(t.getPixelForTick(1)-d)/2:c=(d-t.getPixelForTick(i-1))/2,d+=i<e?c:-c,d<s-a||d>l+a)))return d}function hp(t,e){te(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 In(t){return t.drawTicks?t.tickLength:0}function ga(t,e){if(!t.display)return 0;const n=ge(t.font,e),o=Ce(t.padding);return(re(t.text)?t.text.length:1)*n.lineHeight+o.height}function mp(t,e){return St(t,{scale:e,type:"scale"})}function pp(t,e,n){return St(t,{tick:n,index:e,type:"tick"})}function gp(t,e,n){let o=Hr(t);return(n&&e!=="right"||!n&&e==="right")&&(o=up(o)),o}function bp(t,e,n,o){const{top:i,left:s,bottom:l,right:a,chart:d}=t,{chartArea:c,scales:u}=d;let f=0,h,m,p;const g=l-i,b=a-s;if(t.isHorizontal()){if(m=ke(o,s,a),Z(n)){const y=Object.keys(n)[0],k=n[y];p=u[y].getPixelForValue(k)+g-e}else n==="center"?p=(c.bottom+c.top)/2+g-e:p=ha(t,n,e);h=a-s}else{if(Z(n)){const y=Object.keys(n)[0],k=n[y];m=u[y].getPixelForValue(k)-b+e}else n==="center"?m=(c.left+c.right)/2-b+e:m=ha(t,n,e);p=ke(o,l,i),f=n==="left"?-me:me}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class Wt extends lt{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=Pe(e,Number.POSITIVE_INFINITY),n=Pe(n,Number.NEGATIVE_INFINITY),o=Pe(o,Number.POSITIVE_INFINITY),i=Pe(i,Number.NEGATIVE_INFINITY),{min:Pe(e,o),max:Pe(n,i),minDefined:ce(e),maxDefined:ce(n)}}getMinMax(e){let{min:n,max:o,minDefined:i,maxDefined:s}=this.getUserBounds(),l;if(i&&s)return{min:n,max:o};const a=this.getMatchingVisibleMetas();for(let d=0,c=a.length;d<c;++d)l=a[d].controller.getMinMax(this,e),i||(n=Math.min(n,l.min)),s||(o=Math.max(o,l.max));return n=s&&n>o?o:n,o=i&&n>o?n:o,{min:Pe(n,Pe(o,n)),max:Pe(o,Pe(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(){oe(this.options.beforeUpdate,[this])}update(e,n,o){const{beginAtZero:i,grace:s,ticks:l}=this.options,a=l.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=vh(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const d=a<this.ticks.length;this._convertTicksToLabels(d?pa(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=ip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),d&&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(){oe(this.options.afterUpdate,[this])}beforeSetDimensions(){oe(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(){oe(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),oe(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){oe(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=oe(n.callback,[s.value,o,e],this)}afterTickToLabelConversion(){oe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){oe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=ma(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let l=i,a,d,c;if(!this._isVisible()||!n.display||i>=s||o<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=$e(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/o:m/(o-1),f+6>a&&(a=m/(o-(e.offset?.5:1)),d=this.maxHeight-In(e.grid)-n.padding-ga(e.title,this.chart.options.font),c=Math.sqrt(f*f+h*h),l=Tr(Math.min(Math.asin($e((u.highest.height+6)/a,-1,1)),Math.asin($e(d/c,-1,1))-Math.asin($e(h/c,-1,1)))),l=Math.max(i,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){oe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){oe(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:o,title:i,grid:s}}=this,l=this._isVisible(),a=this.isHorizontal();if(l){const d=ga(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=In(s)+d):(e.height=this.maxHeight,e.width=In(s)+d),o.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:h}=this._getLabelSizes(),m=o.padding*2,p=Le(this.labelRotation),g=Math.cos(p),b=Math.sin(p);if(a){const y=o.mirror?0:b*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=o.mirror?0:g*f.width+b*h.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(c,u,b,g)}}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:l},position:a}=this.options,d=this.labelRotation!==0,c=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 h=0,m=0;d?c?(h=i*e.width,m=o*n.height):(h=o*e.height,m=i*n.width):s==="start"?m=n.width:s==="end"?h=e.width:s!=="inner"&&(h=e.width/2,m=n.width/2),this.paddingLeft=Math.max((h-u+l)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+l)*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+l,this.paddingBottom=f+l}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){oe(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++)Q(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=pa(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,l=[],a=[],d=Math.floor(n/ma(n,o));let c=0,u=0,f,h,m,p,g,b,y,k,M,w,_;for(f=0;f<n;f+=d){if(p=e[f].label,g=this._resolveTickFontOptions(f),i.font=b=g.string,y=s[b]=s[b]||{data:{},gc:[]},k=g.lineHeight,M=w=0,!Q(p)&&!re(p))M=bo(i,y.data,y.gc,M,p),w=k;else if(re(p))for(h=0,m=p.length;h<m;++h)_=p[h],!Q(_)&&!re(_)&&(M=bo(i,y.data,y.gc,M,_),w+=k);l.push(M),a.push(w),c=Math.max(M,c),u=Math.max(w,u)}hp(s,n);const F=l.indexOf(c),$=a.indexOf(u),S=D=>({width:l[D]||0,height:a[D]||0});return{first:S(0),last:S(n-1),widest:S(F),highest:S($),widths:l,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 th(this._alignToPixels?Ot(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=pp(this.getContext(),e,o))}return this.$context||(this.$context=mp(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Le(this.labelRotation),o=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),l=e.autoSkipPadding||0,a=s?s.widest.width+l:0,d=s?s.highest.height+l:0;return this.isHorizontal()?d*o>a*i?a/o:d/i:d*i<a*o?d/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:l,border:a}=i,d=s.offset,c=this.isHorizontal(),f=this.ticks.length+(d?1:0),h=In(s),m=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,b=g/2,y=function(B){return Ot(o,B,g)};let k,M,w,_,F,$,S,D,v,x,C,N;if(l==="top")k=y(this.bottom),$=this.bottom-h,D=k-b,x=y(e.top)+b,N=e.bottom;else if(l==="bottom")k=y(this.top),x=e.top,N=y(e.bottom)-b,$=k+b,D=this.top+h;else if(l==="left")k=y(this.right),F=this.right-h,S=k-b,v=y(e.left)+b,C=e.right;else if(l==="right")k=y(this.left),v=e.left,C=y(e.right)-b,F=k+b,S=this.left+h;else if(n==="x"){if(l==="center")k=y((e.top+e.bottom)/2+.5);else if(Z(l)){const B=Object.keys(l)[0],R=l[B];k=y(this.chart.scales[B].getPixelForValue(R))}x=e.top,N=e.bottom,$=k+b,D=$+h}else if(n==="y"){if(l==="center")k=y((e.left+e.right)/2);else if(Z(l)){const B=Object.keys(l)[0],R=l[B];k=y(this.chart.scales[B].getPixelForValue(R))}F=k-b,S=F-h,v=e.left,C=e.right}const E=G(i.ticks.maxTicksLimit,f),P=Math.max(1,Math.ceil(f/E));for(M=0;M<f;M+=P){const B=this.getContext(M),R=s.setContext(B),O=a.setContext(B),L=R.lineWidth,z=R.color,W=O.dash||[],X=O.dashOffset,K=R.tickWidth,ee=R.tickColor,ae=R.tickBorderDash||[],pe=R.tickBorderDashOffset;w=fp(this,M,d),w!==void 0&&(_=Ot(o,w,L),c?F=S=v=C=_:$=D=x=N=_,m.push({tx1:F,ty1:$,tx2:S,ty2:D,x1:v,y1:x,x2:C,y2:N,width:L,color:z,borderDash:W,borderDashOffset:X,tickWidth:K,tickColor:ee,tickBorderDash:ae,tickBorderDashOffset:pe}))}return this._ticksLength=f,this._borderValue=k,m}_computeLabelItems(e){const n=this.axis,o=this.options,{position:i,ticks:s}=o,l=this.isHorizontal(),a=this.ticks,{align:d,crossAlign:c,padding:u,mirror:f}=s,h=In(o.grid),m=h+u,p=f?-u:m,g=-Le(this.labelRotation),b=[];let y,k,M,w,_,F,$,S,D,v,x,C,N="middle";if(i==="top")F=this.bottom-p,$=this._getXAxisLabelAlignment();else if(i==="bottom")F=this.top+p,$=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(h);$=P.textAlign,_=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(h);$=P.textAlign,_=P.x}else if(n==="x"){if(i==="center")F=(e.top+e.bottom)/2+m;else if(Z(i)){const P=Object.keys(i)[0],B=i[P];F=this.chart.scales[P].getPixelForValue(B)+m}$=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(e.left+e.right)/2-m;else if(Z(i)){const P=Object.keys(i)[0],B=i[P];_=this.chart.scales[P].getPixelForValue(B)}$=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(d==="start"?N="top":d==="end"&&(N="bottom"));const E=this._getLabelSizes();for(y=0,k=a.length;y<k;++y){M=a[y],w=M.label;const P=s.setContext(this.getContext(y));S=this.getPixelForTick(y)+s.labelOffset,D=this._resolveTickFontOptions(y),v=D.lineHeight,x=re(w)?w.length:1;const B=x/2,R=P.color,O=P.textStrokeColor,L=P.textStrokeWidth;let z=$;l?(_=S,$==="inner"&&(y===k-1?z=this.options.reverse?"left":"right":y===0?z=this.options.reverse?"right":"left":z="center"),i==="top"?c==="near"||g!==0?C=-x*v+v/2:c==="center"?C=-E.highest.height/2-B*v+v:C=-E.highest.height+v/2:c==="near"||g!==0?C=v/2:c==="center"?C=E.highest.height/2-B*v:C=E.highest.height-x*v,f&&(C*=-1),g!==0&&!P.showLabelBackdrop&&(_+=v/2*Math.sin(g))):(F=S,C=(1-x)*v/2);let W;if(P.showLabelBackdrop){const X=Ce(P.backdropPadding),K=E.heights[y],ee=E.widths[y];let ae=C-X.top,pe=0-X.left;switch(N){case"middle":ae-=K/2;break;case"bottom":ae-=K;break}switch($){case"center":pe-=ee/2;break;case"right":pe-=ee;break;case"inner":y===k-1?pe-=ee:y>0&&(pe-=ee/2);break}W={left:pe,top:ae,width:ee+X.width,height:K+X.height,color:P.backdropColor}}b.push({label:w,font:D,textOffset:C,options:{rotation:g,color:R,strokeColor:O,strokeWidth:L,textAlign:z,textBaseline:N,translation:[_,F],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Le(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,l=this._getLabelSizes(),a=e+s,d=l.widest.width;let c,u;return n==="left"?i?(u=this.right+s,o==="near"?c="left":o==="center"?(c="center",u+=d/2):(c="right",u+=d)):(u=this.right-a,o==="near"?c="right":o==="center"?(c="center",u-=d/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,o==="near"?c="right":o==="center"?(c="center",u-=d/2):(c="left",u-=d)):(u=this.left+a,o==="near"?c="left":o==="center"?(c="center",u+=d/2):(c="right",u=this.right)):c="right",{textAlign:c,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:l}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(o,i,s,l),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,l;const a=(d,c,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(d.x,d.y),o.lineTo(c.x,c.y),o.stroke(),o.restore())};if(n.display)for(s=0,l=i.length;s<l;++s){const d=i[s];n.drawOnChartArea&&a({x:d.x1,y:d.y1},{x:d.x2,y:d.y2},d),n.drawTicks&&a({x:d.tx1,y:d.ty1},{x:d.tx2,y:d.ty2},{color:d.tickColor,width:d.tickWidth,borderDash:d.tickBorderDash,borderDashOffset:d.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:o,grid:i}}=this,s=o.setContext(this.getContext()),l=o.display?s.width:0;if(!l)return;const a=i.setContext(this.getContext(0)).lineWidth,d=this._borderValue;let c,u,f,h;this.isHorizontal()?(c=Ot(e,this.left,l)-l/2,u=Ot(e,this.right,a)+a/2,f=h=d):(f=Ot(e,this.top,l)-l/2,h=Ot(e,this.bottom,a)+a/2,c=u=d),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,i=this._computeLabelArea();i&&yo(o,i);const s=this.getLabelItems(e);for(const l of s){const a=l.options,d=l.font,c=l.label,u=l.textOffset;It(o,c,0,u,d,a)}i&&$o(o)}drawTitle(){const{ctx:e,options:{position:n,title:o,reverse:i}}=this;if(!o.display)return;const s=ge(o.font),l=Ce(o.padding),a=o.align;let d=s.lineHeight/2;n==="bottom"||n==="center"||Z(n)?(d+=l.bottom,re(o.text)&&(d+=s.lineHeight*(o.text.length-1))):d+=l.top;const{titleX:c,titleY:u,maxWidth:f,rotation:h}=bp(this,d,n,a);It(e,o.text,0,0,s,{color:o.color,maxWidth:f,rotation:h,textAlign:gp(a,n,i),textBaseline:"middle",translation:[c,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=G(e.grid&&e.grid.z,-1),i=G(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Wt.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,l;for(s=0,l=n.length;s<l;++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 ge(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class No{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;wp(n)&&(o=this.register(n));const i=this.items,s=e.id,l=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,yp(e,l,o),this.override&&ue.override(e.id,e.overrides)),l}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 ue[i]&&(delete ue[i][o],this.override&&delete At[o])}}function yp(t,e,n){const o=_n(Object.create(null),[n?ue.get(n):{},ue.get(e),t.defaults]);ue.set(e,o),t.defaultRoutes&&$p(e,t.defaultRoutes),t.descriptors&&ue.describe(e,t.descriptors)}function $p(t,e){Object.keys(e).forEach(n=>{const o=n.split("."),i=o.pop(),s=[t].concat(o).join("."),l=e[n].split("."),a=l.pop(),d=l.join(".");ue.route(s,i,d,a)})}function wp(t){return"id"in t&&"defaults"in t}class _p{constructor(){this.controllers=new No(He,"datasets",!0),this.elements=new No(lt,"elements"),this.plugins=new No(Object,"plugins"),this.scales=new No(Wt,"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):te(i,l=>{const a=o||this._getRegistryForType(l);this._exec(e,a,l)})})}_exec(e,n,o){const i=Ir(e);oe(o["before"+i],[],o),n[e](o),oe(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 qe=new _p;class kp{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),l=this._notify(s,e,n,o);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),l}_notify(e,n,o,i){i=i||{};for(const s of e){const l=s.plugin,a=l[o],d=[n,i,s.options];if(oe(a,d,l)===!1&&i.cancelable)return!1}return!0}invalidate(){Q(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=G(o.options&&o.options.plugins,{}),s=Cp(o);return i===!1&&!n?[]:Sp(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],o=this._cache,i=(s,l)=>s.filter(a=>!l.some(d=>a.plugin.id===d.plugin.id));this._notify(i(n,o),e,"stop"),this._notify(i(o,n),e,"start")}}function Cp(t){const e={},n=[],o=Object.keys(qe.plugins.items);for(let s=0;s<o.length;s++)n.push(qe.getPlugin(o[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const l=i[s];n.indexOf(l)===-1&&(n.push(l),e[l.id]=!0)}return{plugins:n,localIds:e}}function xp(t,e){return!e&&t===!1?null:t===!0?{}:t}function Sp(t,{plugins:e,localIds:n},o,i){const s=[],l=t.getContext();for(const a of e){const d=a.id,c=xp(o[d],i);c!==null&&s.push({plugin:a,options:vp(t.config,{plugin:a,local:n[d]},c,l)})}return s}function vp(t,{plugin:e,local:n},o,i){const s=t.pluginScopeKeys(e),l=t.getOptionScopes(o,s);return n&&e.defaults&&l.push(e.defaults),t.createResolver(l,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ai(t,e){const n=ue.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Dp(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Mp(t,e){return t===e?"_index_":"_value_"}function ba(t){if(t==="x"||t==="y"||t==="r")return t}function Vp(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function di(t,...e){if(ba(t))return t;for(const n of e){const o=n.axis||Vp(n.position)||t.length>1&&ba(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ya(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Bp(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 ya(t,"x",n[0])||ya(t,"y",n[0])}return{}}function Ep(t,e){const n=At[t.type]||{scales:{}},o=e.scales||{},i=ai(t.type,e),s=Object.create(null);return Object.keys(o).forEach(l=>{const a=o[l];if(!Z(a))return console.error(`Invalid scale configuration for scale: ${l}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const d=di(l,a,Bp(l,t),ue.scales[a.type]),c=Mp(d,i),u=n.scales||{};s[l]=kn(Object.create(null),[{axis:d},a,u[d],u[c]])}),t.data.datasets.forEach(l=>{const a=l.type||t.type,d=l.indexAxis||ai(a,e),u=(At[a]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Dp(f,d),m=l[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),kn(s[m],[{axis:h},o[m],u[f]])})}),Object.keys(s).forEach(l=>{const a=s[l];kn(a,[ue.scales[a.type],ue.scale])}),s}function $a(t){const e=t.options||(t.options={});e.plugins=G(e.plugins,{}),e.scales=Ep(t,e)}function wa(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Pp(t){return t=t||{},t.data=wa(t.data),$a(t),t}const _a=new Map,ka=new Set;function Fo(t,e){let n=_a.get(t);return n||(n=e(),_a.set(t,n),ka.add(n)),n}const Tn=(t,e,n)=>{const o=kt(e,n);o!==void 0&&t.add(o)};class Np{constructor(e){this._config=Pp(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=wa(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(),$a(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Fo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Fo(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Fo(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return Fo(`${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,l=this._cachedScopes(e,o),a=l.get(n);if(a)return a;const d=new Set;n.forEach(u=>{e&&(d.add(e),u.forEach(f=>Tn(d,e,f))),u.forEach(f=>Tn(d,i,f)),u.forEach(f=>Tn(d,At[s]||{},f)),u.forEach(f=>Tn(d,ue,f)),u.forEach(f=>Tn(d,Wr,f))});const c=Array.from(d);return c.length===0&&c.push(Object.create(null)),ka.has(n)&&l.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,At[n]||{},ue.datasets[n]||{},{type:n},ue,Wr]}resolveNamedOptions(e,n,o,i=[""]){const s={$shared:!0},{resolver:l,subPrefixes:a}=Ca(this._resolverCache,e,i);let d=l;if(Rp(l,n)){s.$shared=!1,o=Ct(o)?o():o;const c=this.createResolver(e,o,a);d=en(l,o,c)}for(const c of n)s[c]=d[c];return s}createResolver(e,n,o=[""],i){const{resolver:s}=Ca(this._resolverCache,e,o);return Z(n)?en(s,n,void 0,i):s}}function Ca(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:Xr(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},o.set(i,s)),s}const Fp=t=>Z(t)&&Object.getOwnPropertyNames(t).some(e=>Ct(t[e]));function Rp(t,e){const{isScriptable:n,isIndexable:o}=Sl(t);for(const i of e){const s=n(i),l=o(i),a=(l||s)&&t[i];if(s&&(Ct(a)||Fp(a))||l&&re(a))return!0}return!1}var Ap="4.4.2";const Op=["top","bottom","left","right","chartArea"];function xa(t,e){return t==="top"||t==="bottom"||Op.indexOf(t)===-1&&e==="x"}function Sa(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function va(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),oe(n&&n.onComplete,[t],e)}function Ip(t){const e=t.chart,n=e.options.animation;oe(n&&n.onProgress,[t],e)}function Da(t){return Jr()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ro={},Ma=t=>{const e=Da(t);return Object.values(Ro).filter(n=>n.canvas===e).pop()};function Tp(t,e,n){const o=Object.keys(t);for(const i of o){const s=+i;if(s>=e){const l=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=l)}}}function zp(t,e,n,o){return!n||t.type==="mouseout"?null:o?e:t}function Ao(t,e,n){return t.options.clip?t[n]:e[n]}function Lp(t,e){const{xScale:n,yScale:o}=t;return n&&o?{left:Ao(n,e,"left"),right:Ao(n,e,"right"),top:Ao(o,e,"top"),bottom:Ao(o,e,"bottom")}:e}class Ye{static register(...e){qe.add(...e),Va()}static unregister(...e){qe.remove(...e),Va()}constructor(e,n){const o=this.config=new Np(n),i=Da(e),s=Ma(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 l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||rp(i)),this.platform.updateConfig(o);const a=this.platform.acquireContext(i,l.aspectRatio),d=a&&a.canvas,c=d&&d.height,u=d&&d.width;if(this.id=Yf(),this.ctx=a,this.canvas=d,this.width=u,this.height=c,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new kp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ih(f=>this.update(f),l.resizeDelay||0),this._dataChanges=[],Ro[this.id]=this,!a||!d){console.error("Failed to create chart: can't acquire context from the given item");return}st.listen(this,"complete",va),st.listen(this,"progress",Ip),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:i,_aspectRatio:s}=this;return Q(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 qe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return kl(this.canvas,this.ctx),this}stop(){return st.stop(this),this}resize(e,n){st.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,l=this.platform.getMaximumSize(i,e,n,s),a=o.devicePixelRatio||this.platform.getDevicePixelRatio(),d=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Nl(this,a,!0)&&(this.notifyPlugins("resize",{size:l}),oe(o.onResize,[this,l],this),this.attached&&this._doResize(d)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};te(n,(o,i)=>{o.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,o=this.scales,i=Object.keys(o).reduce((l,a)=>(l[a]=!1,l),{});let s=[];n&&(s=s.concat(Object.keys(n).map(l=>{const a=n[l],d=di(l,a),c=d==="r",u=d==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),te(s,l=>{const a=l.options,d=a.id,c=di(d,a),u=G(a.type,l.dtype);(a.position===void 0||xa(a.position,c)!==xa(l.dposition))&&(a.position=l.dposition),i[d]=!0;let f=null;if(d in o&&o[d].type===u)f=o[d];else{const h=qe.getScale(u);f=new h({id:d,type:u,ctx:this.ctx,chart:this}),o[f.id]=f}f.init(a,e)}),te(i,(l,a)=>{l||delete o[a]}),te(o,l=>{xe.configure(this,l,l.options),xe.addBox(this,l)})}_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(Sa("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 l=this.getDatasetMeta(o);const a=s.type||this.config.type;if(l.type&&l.type!==a&&(this._destroyDatasetMeta(o),l=this.getDatasetMeta(o)),l.type=a,l.indexAxis=s.indexAxis||ai(a,this.options),l.order=s.order||0,l.index=o,l.label=""+s.label,l.visible=this.isDatasetVisible(o),l.controller)l.controller.updateIndex(o),l.controller.linkScales();else{const d=qe.getController(a),{datasetElementType:c,dataElementType:u}=ue.datasets[a];Object.assign(d,{dataElementType:qe.getElement(u),datasetElementType:c&&qe.getElement(c)}),l.controller=new d(this,o),e.push(l.controller)}}return this._updateMetasets(),e}_resetElements(){te(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 l=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),h=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),l=Math.max(+f.getMaxOverflow(),l)}l=this._minPadding=o.layout.autoPadding?l:0,this._updateLayout(l),i||te(s,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Sa("z","_idx"));const{_active:a,_lastEvent:d}=this;d?this._eventHandler(d,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){te(this.scales,e=>{xe.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!rl(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 l=o==="_removeElements"?-s:s;Tp(e,i,l)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,o=s=>new Set(e.filter(l=>l[0]===s).map((l,a)=>a+","+l.splice(1).join(","))),i=o(0);for(let s=1;s<n;s++)if(!rl(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;xe.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],te(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,Ct(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&&(st.has(this)?this.attached&&!st.running(this)&&st.start(this):(this.draw(),va({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 l=n[i];(!e||l.visible)&&o.push(l)}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=Lp(e,this.chartArea),l={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(i&&yo(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&&$o(n),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(e){return it(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,i){const s=Om.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=St(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),l=s.controller._resolveAnimations(void 0,i);Cn(n)?(s.data[n].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),l.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(),st.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(),kl(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ro[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,l)=>{n.addEventListener(this,s,l),e[s]=l},i=(s,l,a)=>{s.offsetX=l,s.offsetY=a,this._eventHandler(s)};te(this.options.events,s=>o(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,o=(d,c)=>{n.addEventListener(this,d,c),e[d]=c},i=(d,c)=>{e[d]&&(n.removeEventListener(this,d,c),delete e[d])},s=(d,c)=>{this.canvas&&this.resize(d,c)};let l;const a=()=>{i("attach",a),this.attached=!0,this.resize(),o("resize",s),o("detach",l)};l=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),o("attach",a)},n.isAttached(this.canvas)?a():l()}unbindEvents(){te(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},te(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,l,a,d;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,d=e.length;a<d;++a){l=e[a];const c=l&&this.getDatasetMeta(l.datasetIndex).controller;c&&c[i+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],o=e.map(({datasetIndex:s,index:l})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[l],index:l}});!fo(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=(d,c)=>d.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),l=s(n,e),a=o?e:s(e,n);l.length&&this.updateHoverStyle(l,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=l=>(l.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,l=n,a=this._getActiveElements(e,i,o,l),d=Xf(e),c=zp(e,this._lastEvent,o,d);o&&(this._lastEvent=null,oe(s.onHover,[e,a,this],this),d&&oe(s.onClick,[e,a,this],this));const u=!fo(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,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)}}T(Ye,"defaults",ue),T(Ye,"instances",Ro),T(Ye,"overrides",At),T(Ye,"registry",qe),T(Ye,"version",Ap),T(Ye,"getChart",Ma);function Va(){return te(Ye.instances,t=>t._plugins.invalidate())}function Hp(t,e,n){const{startAngle:o,pixelMargin:i,x:s,y:l,outerRadius:a,innerRadius:d}=e;let c=i/a;t.beginPath(),t.arc(s,l,a,o-c,n+c),d>i?(c=i/d,t.arc(s,l,d,n+c,o-c,!0)):t.arc(s,l,i,n+me,o-me),t.closePath(),t.clip()}function Yp(t){return qr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function jp(t,e,n,o){const i=Yp(t.options.borderRadius),s=(n-e)/2,l=Math.min(s,o*e/2),a=d=>{const c=(n-Math.min(s,d))*o/2;return $e(d,0,Math.min(s,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:$e(i.innerStart,0,l),innerEnd:$e(i.innerEnd,0,l)}}function on(t,e,n,o){return{x:n+t*Math.cos(e),y:o+t*Math.sin(e)}}function Oo(t,e,n,o,i,s){const{x:l,y:a,startAngle:d,pixelMargin:c,innerRadius:u}=e,f=Math.max(e.outerRadius+o+n-c,0),h=u>0?u+o+n+c:0;let m=0;const p=i-d;if(o){const P=u>0?u-o:0,B=f>0?f-o:0,R=(P+B)/2,O=R!==0?p*R/(R+o):p;m=(p-O)/2}const g=Math.max(.001,p*f-n/ie)/f,b=(p-g)/2,y=d+b+m,k=i-b-m,{outerStart:M,outerEnd:w,innerStart:_,innerEnd:F}=jp(e,h,f,k-y),$=f-M,S=f-w,D=y+M/$,v=k-w/S,x=h+_,C=h+F,N=y+_/x,E=k-F/C;if(t.beginPath(),s){const P=(D+v)/2;if(t.arc(l,a,f,D,P),t.arc(l,a,f,P,v),w>0){const L=on(S,v,l,a);t.arc(L.x,L.y,w,v,k+me)}const B=on(C,k,l,a);if(t.lineTo(B.x,B.y),F>0){const L=on(C,E,l,a);t.arc(L.x,L.y,F,k+me,E+Math.PI)}const R=(k-F/h+(y+_/h))/2;if(t.arc(l,a,h,k-F/h,R,!0),t.arc(l,a,h,R,y+_/h,!0),_>0){const L=on(x,N,l,a);t.arc(L.x,L.y,_,N+Math.PI,y-me)}const O=on($,y,l,a);if(t.lineTo(O.x,O.y),M>0){const L=on($,D,l,a);t.arc(L.x,L.y,M,y-me,D)}}else{t.moveTo(l,a);const P=Math.cos(D)*f+l,B=Math.sin(D)*f+a;t.lineTo(P,B);const R=Math.cos(v)*f+l,O=Math.sin(v)*f+a;t.lineTo(R,O)}t.closePath()}function Wp(t,e,n,o,i){const{fullCircles:s,startAngle:l,circumference:a}=e;let d=e.endAngle;if(s){Oo(t,e,n,o,d,i);for(let c=0;c<s;++c)t.fill();isNaN(a)||(d=l+(a%se||se))}return Oo(t,e,n,o,d,i),t.fill(),d}function Up(t,e,n,o,i){const{fullCircles:s,startAngle:l,circumference:a,options:d}=e,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=d,m=d.borderAlign==="inner";if(!c)return;t.setLineDash(f||[]),t.lineDashOffset=h,m?(t.lineWidth=c*2,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let p=e.endAngle;if(s){Oo(t,e,n,o,p,i);for(let g=0;g<s;++g)t.stroke();isNaN(a)||(p=l+(a%se||se))}m&&Hp(t,e,p),s||(Oo(t,e,n,o,p,i),t.stroke())}class zn extends lt{constructor(n){super();T(this,"circumference");T(this,"endAngle");T(this,"fullCircles");T(this,"innerRadius");T(this,"outerRadius");T(this,"pixelMargin");T(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:l,distance:a}=dl(s,{x:n,y:o}),{startAngle:d,endAngle:c,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),m=(this.options.spacing+this.options.borderWidth)/2,g=G(h,c-d)>=se||Sn(l,d,c),b=ot(a,u+m,f+m);return g&&b}getCenterPoint(n){const{x:o,y:i,startAngle:s,endAngle:l,innerRadius:a,outerRadius:d}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(s+l)/2,h=(a+d+u+c)/2;return{x:o+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:o,circumference:i}=this,s=(o.offset||0)/4,l=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=i>se?Math.floor(i/se):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const d=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(d)*s,Math.sin(d)*s);const c=1-Math.sin(Math.min(ie,i||0)),u=s*c;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,Wp(n,this,u,l,a),Up(n,this,u,l,a),n.restore()}}T(zn,"id","arc"),T(zn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),T(zn,"defaultRoutes",{backgroundColor:"backgroundColor"}),T(zn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Ba(t,e,n=e){t.lineCap=G(n.borderCapStyle,e.borderCapStyle),t.setLineDash(G(n.borderDash,e.borderDash)),t.lineDashOffset=G(n.borderDashOffset,e.borderDashOffset),t.lineJoin=G(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=G(n.borderWidth,e.borderWidth),t.strokeStyle=G(n.borderColor,e.borderColor)}function Gp(t,e,n){t.lineTo(n.x,n.y)}function qp(t){return t.stepped?bh:t.tension||t.cubicInterpolationMode==="monotone"?yh:Gp}function Ea(t,e,n={}){const o=t.length,{start:i=0,end:s=o-1}=n,{start:l,end:a}=e,d=Math.max(i,l),c=Math.min(s,a),u=i<l&&s<l||i>a&&s>a;return{count:o,start:d,loop:e.loop,ilen:c<d&&!u?o+c-d:c-d}}function Xp(t,e,n,o){const{points:i,options:s}=e,{count:l,start:a,loop:d,ilen:c}=Ea(i,n,o),u=qp(s);let{move:f=!0,reverse:h}=o||{},m,p,g;for(m=0;m<=c;++m)p=i[(a+(h?c-m:m))%l],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,g,p,h,s.stepped),g=p);return d&&(p=i[(a+(h?c:0))%l],u(t,g,p,h,s.stepped)),!!d}function Kp(t,e,n,o){const i=e.points,{count:s,start:l,ilen:a}=Ea(i,n,o),{move:d=!0,reverse:c}=o||{};let u=0,f=0,h,m,p,g,b,y;const k=w=>(l+(c?a-w:w))%s,M=()=>{g!==b&&(t.lineTo(u,b),t.lineTo(u,g),t.lineTo(u,y))};for(d&&(m=i[k(0)],t.moveTo(m.x,m.y)),h=0;h<=a;++h){if(m=i[k(h)],m.skip)continue;const w=m.x,_=m.y,F=w|0;F===p?(_<g?g=_:_>b&&(b=_),u=(f*u+w)/++f):(M(),t.lineTo(w,_),p=F,f=0,g=b=_),y=_}M()}function ci(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Kp:Xp}function Zp(t){return t.stepped?Kh:t.tension||t.cubicInterpolationMode==="monotone"?Zh:Ht}function Jp(t,e,n,o){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,o)&&i.closePath()),Ba(t,e.options),t.stroke(i)}function Qp(t,e,n,o){const{segments:i,options:s}=e,l=ci(e);for(const a of i)Ba(t,s,a.style),t.beginPath(),l(t,e,a,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const e0=typeof Path2D=="function";function t0(t,e,n,o){e0&&!e.options.segment?Jp(t,e,n,o):Qp(t,e,n,o)}class vt extends lt{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;Hh(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=om(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,l=zl(this,{property:n,start:i,end:i});if(!l.length)return;const a=[],d=Zp(o);let c,u;for(c=0,u=l.length;c<u;++c){const{start:f,end:h}=l[c],m=s[f],p=s[h];if(m===p){a.push(m);continue}const g=Math.abs((i-m[n])/(p[n]-m[n])),b=d(m,p,g,o.stepped);b[n]=e[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(e,n,o){return ci(this)(e,this,n,o)}path(e,n,o){const i=this.segments,s=ci(this);let l=this._loop;n=n||0,o=o||this.points.length-n;for(const a of i)l&=s(e,this,a,{start:n,end:n+o-1});return!!l}draw(e,n,o,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),t0(e,this,o,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}T(vt,"id","line"),T(vt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),T(vt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),T(vt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Pa(t,e,n,o){const i=t.options,{[n]:s}=t.getProps([n],o);return Math.abs(e-s)<i.radius+i.hitRadius}class Io extends lt{constructor(n){super();T(this,"parsed");T(this,"skip");T(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:l,y:a}=this.getProps(["x","y"],i);return Math.pow(n-l,2)+Math.pow(o-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,o){return Pa(this,n,"x",o)}inYRange(n,o){return Pa(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||!it(this,o,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Gr(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}T(Io,"id","point"),T(Io,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),T(Io,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Na(t,e){const{x:n,y:o,base:i,width:s,height:l}=t.getProps(["x","y","base","width","height"],e);let a,d,c,u,f;return t.horizontal?(f=l/2,a=Math.min(n,i),d=Math.max(n,i),c=o-f,u=o+f):(f=s/2,a=n-f,d=n+f,c=Math.min(o,i),u=Math.max(o,i)),{left:a,top:c,right:d,bottom:u}}function Dt(t,e,n,o){return t?0:$e(e,n,o)}function n0(t,e,n){const o=t.options.borderWidth,i=t.borderSkipped,s=xl(o);return{t:Dt(i.top,s.top,0,n),r:Dt(i.right,s.right,0,e),b:Dt(i.bottom,s.bottom,0,n),l:Dt(i.left,s.left,0,e)}}function o0(t,e,n){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,s=Tt(i),l=Math.min(e,n),a=t.borderSkipped,d=o||Z(i);return{topLeft:Dt(!d||a.top||a.left,s.topLeft,0,l),topRight:Dt(!d||a.top||a.right,s.topRight,0,l),bottomLeft:Dt(!d||a.bottom||a.left,s.bottomLeft,0,l),bottomRight:Dt(!d||a.bottom||a.right,s.bottomRight,0,l)}}function r0(t){const e=Na(t),n=e.right-e.left,o=e.bottom-e.top,i=n0(t,n/2,o/2),s=o0(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 ui(t,e,n,o){const i=e===null,s=n===null,a=t&&!(i&&s)&&Na(t,o);return a&&(i||ot(e,a.left,a.right))&&(s||ot(n,a.top,a.bottom))}function i0(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function s0(t,e){t.rect(e.x,e.y,e.w,e.h)}function fi(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,l=(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+l,radius:t.radius}}class To extends lt{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:l}=r0(this),a=i0(l.radius)?Vn:s0;e.save(),(l.w!==s.w||l.h!==s.h)&&(e.beginPath(),a(e,fi(l,n,s)),e.clip(),a(e,fi(s,-n,l)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),a(e,fi(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,o){return ui(this,e,n,o)}inXRange(e,n){return ui(this,e,null,n)}inYRange(e,n){return ui(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}}T(To,"id","bar"),T(To,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),T(To,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var l0=Object.freeze({__proto__:null,ArcElement:zn,BarElement:To,LineElement:vt,PointElement:Io});const hi=["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)"],Fa=hi.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ra(t){return hi[t%hi.length]}function Aa(t){return Fa[t%Fa.length]}function a0(t,e){return t.borderColor=Ra(e),t.backgroundColor=Aa(e),++e}function d0(t,e){return t.backgroundColor=t.data.map(()=>Ra(e++)),e}function c0(t,e){return t.backgroundColor=t.data.map(()=>Aa(e++)),e}function u0(t){let e=0;return(n,o)=>{const i=t.getDatasetMeta(o).controller;i instanceof Yt?e=d0(n,e):i instanceof Pn?e=c0(n,e):i&&(e=a0(n,e))}}function Oa(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function f0(t){return t&&(t.borderColor||t.backgroundColor)}var h0={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&&(Oa(o)||f0(i)||s&&Oa(s)))return;const l=u0(t);o.forEach(l)}};function m0(t,e,n,o,i){const s=i.samples||o;if(s>=n)return t.slice(e,e+n);const l=[],a=(n-2)/(s-2);let d=0;const c=e+n-1;let u=e,f,h,m,p,g;for(l[d++]=t[u],f=0;f<s-2;f++){let b=0,y=0,k;const M=Math.floor((f+1)*a)+1+e,w=Math.min(Math.floor((f+2)*a)+1,n)+e,_=w-M;for(k=M;k<w;k++)b+=t[k].x,y+=t[k].y;b/=_,y/=_;const F=Math.floor(f*a)+1+e,$=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:S,y:D}=t[u];for(m=p=-1,k=F;k<$;k++)p=.5*Math.abs((S-b)*(t[k].y-D)-(S-t[k].x)*(y-D)),p>m&&(m=p,h=t[k],g=k);l[d++]=h,u=g}return l[d++]=t[c],l}function p0(t,e,n,o){let i=0,s=0,l,a,d,c,u,f,h,m,p,g;const b=[],y=e+n-1,k=t[e].x,w=t[y].x-k;for(l=e;l<e+n;++l){a=t[l],d=(a.x-k)/w*o,c=a.y;const _=d|0;if(_===u)c<p?(p=c,f=l):c>g&&(g=c,h=l),i=(s*i+a.x)/++s;else{const F=l-1;if(!Q(f)&&!Q(h)){const $=Math.min(f,h),S=Math.max(f,h);$!==m&&$!==F&&b.push({...t[$],x:i}),S!==m&&S!==F&&b.push({...t[S],x:i})}l>0&&F!==m&&b.push(t[F]),b.push(a),u=_,s=0,p=g=c,f=h=m=l}}return b}function Ia(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 Ta(t){t.data.datasets.forEach(e=>{Ia(e)})}function g0(t,e){const n=e.length;let o=0,i;const{iScale:s}=t,{min:l,max:a,minDefined:d,maxDefined:c}=s.getUserBounds();return d&&(o=$e(rt(e,s.axis,l).lo,0,n-1)),c?i=$e(rt(e,s.axis,a).hi+1,o,n)-o:i=n-o,{start:o,count:i}}var b0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Ta(t);return}const o=t.width;t.data.datasets.forEach((i,s)=>{const{_data:l,indexAxis:a}=i,d=t.getDatasetMeta(s),c=l||i.data;if(Bn([a,t.options.indexAxis])==="y"||!d.controller.supportsDecimation)return;const u=t.scales[d.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:h}=g0(d,c);const m=n.threshold||4*o;if(h<=m){Ia(i);return}Q(l)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=m0(c,f,h,o,n);break;case"min-max":p=p0(c,f,h,o);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=p})},destroy(t){Ta(t)}};function y0(t,e,n){const o=t.segments,i=t.points,s=e.points,l=[];for(const a of o){let{start:d,end:c}=a;c=pi(d,c,i);const u=mi(n,i[d],i[c],a.loop);if(!e.segments){l.push({source:a,target:u,start:i[d],end:i[c]});continue}const f=zl(e,u);for(const h of f){const m=mi(n,s[h.start],s[h.end],h.loop),p=Tl(a,i,m);for(const g of p)l.push({source:g,target:h,start:{[n]:za(u,m,"start",Math.max)},end:{[n]:za(u,m,"end",Math.min)}})}}return l}function mi(t,e,n,o){if(o)return;let i=e[t],s=n[t];return t==="angle"&&(i=Ne(i),s=Ne(s)),{property:t,start:i,end:s}}function $0(t,e){const{x:n=null,y:o=null}=t||{},i=e.points,s=[];return e.segments.forEach(({start:l,end:a})=>{a=pi(l,a,i);const d=i[l],c=i[a];o!==null?(s.push({x:d.x,y:o}),s.push({x:c.x,y:o})):n!==null&&(s.push({x:n,y:d.y}),s.push({x:n,y:c.y}))}),s}function pi(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function za(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function La(t,e){let n=[],o=!1;return re(t)?(o=!0,n=t):n=$0(t,e),n.length?new vt({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function Ha(t){return t&&t.fill!==!1}function w0(t,e,n){let i=t[e].fill;const s=[e];let l;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!ce(i))return i;if(l=t[i],!l)return!1;if(l.visible)return i;s.push(i),i=l.fill}return!1}function _0(t,e,n){const o=S0(t);if(Z(o))return isNaN(o.value)?!1:o;let i=parseFloat(o);return ce(i)&&Math.floor(i)===i?k0(o[0],e,i,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function k0(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function C0(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 x0(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 S0(t){const e=t.options,n=e.fill;let o=G(n&&n.target,n);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function v0(t){const{scale:e,index:n,line:o}=t,i=[],s=o.segments,l=o.points,a=D0(e,n);a.push(La({x:null,y:e.bottom},o));for(let d=0;d<s.length;d++){const c=s[d];for(let u=c.start;u<=c.end;u++)M0(i,l[u],a)}return new vt({points:i,options:{}})}function D0(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 M0(t,e,n){const o=[];for(let i=0;i<n.length;i++){const s=n[i],{first:l,last:a,point:d}=V0(s,e,"x");if(!(!d||l&&a)){if(l)o.unshift(d);else if(t.push(d),!a)break}}t.push(...o)}function V0(t,e,n){const o=t.interpolate(e,n);if(!o)return{};const i=o[n],s=t.segments,l=t.points;let a=!1,d=!1;for(let c=0;c<s.length;c++){const u=s[c],f=l[u.start][n],h=l[u.end][n];if(ot(i,f,h)){a=i===f,d=i===h;break}}return{first:a,last:d,point:o}}class Ya{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,o){const{x:i,y:s,radius:l}=this;return n=n||{start:0,end:se},e.arc(i,s,l,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 B0(t){const{chart:e,fill:n,line:o}=t;if(ce(n))return E0(e,n);if(n==="stack")return v0(t);if(n==="shape")return!0;const i=P0(t);return i instanceof Ya?i:La(i,o)}function E0(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function P0(t){return(t.scale||{}).getPointPositionForValue?F0(t):N0(t)}function N0(t){const{scale:e={},fill:n}=t,o=C0(n,e);if(ce(o)){const i=e.isHorizontal();return{x:i?o:null,y:i?null:o}}return null}function F0(t){const{scale:e,fill:n}=t,o=e.options,i=e.getLabels().length,s=o.reverse?e.max:e.min,l=x0(n,e,s),a=[];if(o.grid.circular){const d=e.getPointPositionForValue(0,s);return new Ya({x:d.x,y:d.y,radius:e.getDistanceFromCenterForValue(l)})}for(let d=0;d<i;++d)a.push(e.getPointPositionForValue(d,l));return a}function gi(t,e,n){const o=B0(e),{line:i,scale:s,axis:l}=e,a=i.options,d=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=d||{};o&&i.points.length&&(yo(t,n),R0(t,{line:i,target:o,above:u,below:f,area:n,scale:s,axis:l}),$o(t))}function R0(t,e){const{line:n,target:o,above:i,below:s,area:l,scale:a}=e,d=n._loop?"angle":e.axis;t.save(),d==="x"&&s!==i&&(ja(t,o,l.top),Wa(t,{line:n,target:o,color:i,scale:a,property:d}),t.restore(),t.save(),ja(t,o,l.bottom)),Wa(t,{line:n,target:o,color:s,scale:a,property:d}),t.restore()}function ja(t,e,n){const{segments:o,points:i}=e;let s=!0,l=!1;t.beginPath();for(const a of o){const{start:d,end:c}=a,u=i[d],f=i[pi(d,c,i)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),l=!!e.pathSegment(t,a,{move:l}),l?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Wa(t,e){const{line:n,target:o,property:i,color:s,scale:l}=e,a=y0(n,o,i);for(const{source:d,target:c,start:u,end:f}of a){const{style:{backgroundColor:h=s}={}}=d,m=o!==!0;t.save(),t.fillStyle=h,A0(t,l,m&&mi(i,u,f)),t.beginPath();const p=!!n.pathSegment(t,d);let g;if(m){p?t.closePath():Ua(t,o,f,i);const b=!!o.pathSegment(t,c,{move:p,reverse:!0});g=p&&b,g||Ua(t,o,u,i)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function A0(t,e,n){const{top:o,bottom:i}=e.chart.chartArea,{property:s,start:l,end:a}=n||{};s==="x"&&(t.beginPath(),t.rect(l,o,a-l,i-o),t.clip())}function Ua(t,e,n,o){const i=e.interpolate(n,o);i&&t.lineTo(i.x,i.y)}var O0={id:"filler",afterDatasetsUpdate(t,e,n){const o=(t.data.datasets||[]).length,i=[];let s,l,a,d;for(l=0;l<o;++l)s=t.getDatasetMeta(l),a=s.dataset,d=null,a&&a.options&&a instanceof vt&&(d={visible:t.isDatasetVisible(l),index:l,fill:_0(a,l,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=d,i.push(d);for(l=0;l<o;++l)d=i[l],!(!d||d.fill===!1)&&(d.fill=w0(i,l,n.propagate))},beforeDraw(t,e,n){const o=n.drawTime==="beforeDraw",i=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let l=i.length-1;l>=0;--l){const a=i[l].$filler;a&&(a.line.updateControlPoints(s,a.axis),o&&a.fill&&gi(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;Ha(s)&&gi(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!Ha(o)||n.drawTime!=="beforeDatasetDraw"||gi(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ga=(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)}},I0=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class qa extends lt{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=oe(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=ge(o.font),s=i.size,l=this._computeTitleHeight(),{boxWidth:a,itemHeight:d}=Ga(o,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(l,s,a,d)+10):(u=this.maxHeight,c=this._fitCols(l,i,a,d)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,o,i){const{ctx:s,maxWidth:l,options:{labels:{padding:a}}}=this,d=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let f=e;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const b=o+n/2+s.measureText(p.text).width;(g===0||c[c.length-1]+b+2*a>l)&&(f+=u,c[c.length-(g>0?0:1)]=0,m+=u,h++),d[g]={left:0,top:m,row:h,width:b,height:i},c[c.length-1]+=b+a}),f}_fitCols(e,n,o,i){const{ctx:s,maxHeight:l,options:{labels:{padding:a}}}=this,d=this.legendHitBoxes=[],c=this.columnSizes=[],u=l-e;let f=a,h=0,m=0,p=0,g=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:k,itemHeight:M}=T0(o,n,s,b,i);y>0&&m+M+2*a>u&&(f+=h+a,c.push({width:h,height:m}),p+=h+a,g++,h=m=0),d[y]={left:p,top:m,col:g,width:k,height:M},h=Math.max(h,k),m+=M+a}),f+=h,c.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:i},rtl:s}}=this,l=nn(s,this.left,this.width);if(this.isHorizontal()){let a=0,d=ke(o,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,d=ke(o,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+e+i,c.left=l.leftForLtr(l.x(d),c.width),d+=c.width+i}else{let a=0,d=ke(o,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,d=ke(o,this.top+e+i,this.bottom-this.columnSizes[a].height)),c.top=d,c.left+=this.left+i,c.left=l.leftForLtr(l.x(c.left),c.width),d+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;yo(e,this),this._draw(),$o(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:o,ctx:i}=this,{align:s,labels:l}=e,a=ue.color,d=nn(e.rtl,this.left,this.width),c=ge(l.font),{padding:u}=l,f=c.size,h=f/2;let m;this.drawTitle(),i.textAlign=d.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:b}=Ga(l,f),y=function(F,$,S){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;i.save();const D=G(S.lineWidth,1);if(i.fillStyle=G(S.fillStyle,a),i.lineCap=G(S.lineCap,"butt"),i.lineDashOffset=G(S.lineDashOffset,0),i.lineJoin=G(S.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=G(S.strokeStyle,a),i.setLineDash(G(S.lineDash,[])),l.usePointStyle){const v={radius:g*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:D},x=d.xPlus(F,p/2),C=$+h;Cl(i,v,x,C,l.pointStyleWidth&&p)}else{const v=$+Math.max((f-g)/2,0),x=d.leftForLtr(F,p),C=Tt(S.borderRadius);i.beginPath(),Object.values(C).some(N=>N!==0)?Vn(i,{x,y:v,w:p,h:g,radius:C}):i.rect(x,v,p,g),i.fill(),D!==0&&i.stroke()}i.restore()},k=function(F,$,S){It(i,S.text,F,$+b/2,c,{strikethrough:S.hidden,textAlign:d.textAlign(S.textAlign)})},M=this.isHorizontal(),w=this._computeTitleHeight();M?m={x:ke(s,this.left+u,this.right-o[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:ke(s,this.top+w+u,this.bottom-n[0].height),line:0},Rl(this.ctx,e.textDirection);const _=b+u;this.legendItems.forEach((F,$)=>{i.strokeStyle=F.fontColor,i.fillStyle=F.fontColor;const S=i.measureText(F.text).width,D=d.textAlign(F.textAlign||(F.textAlign=l.textAlign)),v=p+h+S;let x=m.x,C=m.y;d.setWidth(this.width),M?$>0&&x+v+u>this.right&&(C=m.y+=_,m.line++,x=m.x=ke(s,this.left+u,this.right-o[m.line])):$>0&&C+_>this.bottom&&(x=m.x=x+n[m.line].width+u,m.line++,C=m.y=ke(s,this.top+w+u,this.bottom-n[m.line].height));const N=d.x(x);if(y(N,C,F),x=sh(D,x+p+h,M?x+v:this.right,e.rtl),k(d.x(x),C,F),M)m.x+=v+u;else if(typeof F.text!="string"){const E=c.lineHeight;m.y+=Xa(F,E)+u}else m.y+=_}),Al(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=ge(n.font),i=Ce(n.padding);if(!n.display)return;const s=nn(e.rtl,this.left,this.width),l=this.ctx,a=n.position,d=o.size/2,c=i.top+d;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,f=ke(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);u=c+ke(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=ke(a,f,f+h);l.textAlign=s.textAlign(Hr(a)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=o.string,It(l,n.text,m,u,o)}_computeTitleHeight(){const e=this.options.title,n=ge(e.font),o=Ce(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,i,s;if(ot(e,this.left,this.right)&&ot(n,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(i=s[o],ot(e,i.left,i.left+i.width)&&ot(n,i.top,i.top+i.height))return this.legendItems[o]}return null}handleEvent(e){const n=this.options;if(!H0(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=I0(i,o);i&&!s&&oe(n.onLeave,[e,i,this],this),this._hoveredItem=o,o&&!s&&oe(n.onHover,[e,o,this],this)}else o&&oe(n.onClick,[e,o,this],this)}}function T0(t,e,n,o,i){const s=z0(o,t,e,n),l=L0(i,o,e.lineHeight);return{itemWidth:s,itemHeight:l}}function z0(t,e,n,o){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,l)=>s.length>l.length?s:l)),e+n.size/2+o.measureText(i).width}function L0(t,e,n){let o=t;return typeof e.text!="string"&&(o=Xa(e,n)),o}function Xa(t,e){const n=t.text?t.text.length:0;return e*n}function H0(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Y0={id:"legend",_element:qa,start(t,e,n){const o=t.legend=new qa({ctx:t.ctx,options:n,chart:t});xe.configure(t,o,n),xe.addBox(t,o)},stop(t){xe.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;xe.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:l,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(d=>{const c=d.controller.getStyle(n?0:void 0),u=Ce(c.borderWidth);return{text:e[d.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!d.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:o||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:l&&(a||c.borderRadius),datasetIndex:d.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 bi extends lt{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=re(o.text)?o.text.length:1;this._padding=Ce(o.padding);const s=i*ge(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:l}=this,a=l.align;let d=0,c,u,f;return this.isHorizontal()?(u=ke(a,o,s),f=n+e,c=s-o):(l.position==="left"?(u=o+e,f=ke(a,i,n),d=ie*-.5):(u=s-e,f=ke(a,n,i),d=ie*.5),c=i-n),{titleX:u,titleY:f,maxWidth:c,rotation:d}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const o=ge(n.font),s=o.lineHeight/2+this._padding.top,{titleX:l,titleY:a,maxWidth:d,rotation:c}=this._drawArgs(s);It(e,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:c,textAlign:Hr(n.align),textBaseline:"middle",translation:[l,a]})}}function j0(t,e){const n=new bi({ctx:t.ctx,options:e,chart:t});xe.configure(t,n,e),xe.addBox(t,n),t.titleBlock=n}var W0={id:"title",_element:bi,start(t,e,n){j0(t,n)},stop(t){const e=t.titleBlock;xe.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;xe.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 zo=new WeakMap;var U0={id:"subtitle",start(t,e,n){const o=new bi({ctx:t.ctx,options:n,chart:t});xe.configure(t,o,n),xe.addBox(t,o),zo.set(t,o)},stop(t){xe.removeBox(t,zo.get(t)),zo.delete(t)},beforeUpdate(t,e,n){const o=zo.get(t);xe.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 Ln={average(t){if(!t.length)return!1;let e,n,o=new Set,i=0,s=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const d=a.tooltipPosition();o.add(d.x),i+=d.y,++s}}return{x:[...o].reduce((a,d)=>a+d)/o.size,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,o=e.y,i=Number.POSITIVE_INFINITY,s,l,a;for(s=0,l=t.length;s<l;++s){const d=t[s].element;if(d&&d.hasValue()){const c=d.getCenterPoint(),u=zr(e,c);u<i&&(i=u,a=d)}}if(a){const d=a.tooltipPosition();n=d.x,o=d.y}return{x:n,y:o}}};function Xe(t,e){return e&&(re(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function at(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
24
+ */class sm{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],l=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:l,currentStep:Math.min(o-n.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=hl.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 l=s.length-1,a=!1,d;for(;l>=0;--l)d=s[l],d._active?(d._total>o.duration&&(o.duration=d._total),d.tick(e),a=!0):(s[l]=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 st=new sm;const Yl="transparent",lm={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=$l(t||Yl),i=o.valid&&$l(e||Yl);return i&&i.valid?i.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class am{constructor(e,n,o,i){const s=n[o];i=Bn([e.to,i,s,e.from]);const l=Bn([e.from,s,i]);this._active=!0,this._fn=e.fn||lm[e.type||typeof l],this._easing=vn[e.easing]||vn.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=l,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,l=this._duration-s;this._start=o,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Bn([e.to,n,i,e.from]),this._from=Bn([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,l=this._loop,a=this._to;let d;if(this._active=s!==a&&(l||n<o),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}d=n/o%2,d=l&&d>1?2-d:d,d=this._easing(Math.min(1,Math.max(0,d))),this._target[i]=this._fn(s,a,d)}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 jl{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Z(e))return;const n=Object.keys(ue.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Z(s))return;const l={};for(const a of n)l[a]=s[a];(re(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!o.has(a))&&o.set(a,l)})})}_animateOptions(e,n){const o=n.options,i=cm(e,o);if(!i)return[];const s=this._createAnimations(i,o);return o.$shared&&dm(e.options.$animations,o).then(()=>{e.options=o},()=>{}),s}_createAnimations(e,n){const o=this._properties,i=[],s=e.$animations||(e.$animations={}),l=Object.keys(n),a=Date.now();let d;for(d=l.length-1;d>=0;--d){const c=l[d];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(e,n));continue}const u=n[c];let f=s[c];const h=o.get(c);if(f)if(h&&f.active()){f.update(h,u,a);continue}else f.cancel();if(!h||!h.duration){e[c]=u;continue}s[c]=f=new am(h,e,c,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 st.add(this._chart,o),!0}}function dm(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 cm(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 Wl(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 um(t,e,n){if(n===!1)return!1;const o=Wl(t,n),i=Wl(e,n);return{top:i.end,right:o.end,bottom:i.start,left:o.start}}function fm(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 Ul(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 Gl(t,e,n,o={}){const i=t.keys,s=o.mode==="single";let l,a,d,c;if(e!==null){for(l=0,a=i.length;l<a;++l){if(d=+i[l],d===n){if(o.all)continue;break}c=t.values[d],ce(c)&&(s||e===0||Ge(e)===Ge(c))&&(e+=c)}return e}}function hm(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 ql(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function mm(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function pm(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 gm(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function Xl(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 Kl(t,e){const{chart:n,_cachedMeta:o}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:l,index:a}=o,d=s.axis,c=l.axis,u=mm(s,l,o),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[d]:g,[c]:b}=p,y=p._stacks||(p._stacks={});h=y[c]=gm(i,u,g),h[a]=b,h._top=Xl(h,l,!0,o.type),h._bottom=Xl(h,l,!1,o.type);const C=h._visualValues||(h._visualValues={});C[a]=b}}function ei(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function bm(t,e){return St(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ym(t,e,n){return St(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function En(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 ti=t=>t==="reset"||t==="none",Zl=(t,e)=>e?t:Object.assign({},t),$m=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Ul(n,!0),values:null};class He{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=ql(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&&En(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,o=this.getDataset(),i=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=n.xAxisID=G(o.xAxisID,ei(e,"x")),l=n.yAxisID=G(o.yAxisID,ei(e,"y")),a=n.rAxisID=G(o.rAxisID,ei(e,"r")),d=n.indexAxis,c=n.iAxisID=i(d,s,l,a),u=n.vAxisID=i(d,l,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(l),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(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&&ul(this._data,this),e._stacked&&En(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(Z(n))this._data=hm(n);else if(o!==n){if(o){ul(o,this);const i=this._cachedMeta;En(i),i._parsed=[]}n&&Object.isExtensible(n)&&rh(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=ql(n.vScale,n),n.stack!==o.stack&&(i=!0,En(n),n.stack=o.stack),this._resyncElements(e),(i||s!==n._stacked)&&Kl(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:l}=o,a=s.axis;let d=e===0&&n===i.length?!0:o._sorted,c=e>0&&o._parsed[e-1],u,f,h;if(this._parsing===!1)o._parsed=i,o._sorted=!0,h=i;else{re(i[e])?h=this.parseArrayData(o,i,e,n):Z(i[e])?h=this.parseObjectData(o,i,e,n):h=this.parsePrimitiveData(o,i,e,n);const m=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)o._parsed[u+e]=f=h[u],d&&(m()&&(d=!1),c=f);o._sorted=d}l&&Kl(this,h)}parsePrimitiveData(e,n,o,i){const{iScale:s,vScale:l}=e,a=s.axis,d=l.axis,c=s.getLabels(),u=s===l,f=new Array(i);let h,m,p;for(h=0,m=i;h<m;++h)p=h+o,f[h]={[a]:u||s.parse(c[p],p),[d]:l.parse(n[p],p)};return f}parseArrayData(e,n,o,i){const{xScale:s,yScale:l}=e,a=new Array(i);let d,c,u,f;for(d=0,c=i;d<c;++d)u=d+o,f=n[u],a[d]={x:s.parse(f[0],u),y:l.parse(f[1],u)};return a}parseObjectData(e,n,o,i){const{xScale:s,yScale:l}=e,{xAxisKey:a="x",yAxisKey:d="y"}=this._parsing,c=new Array(i);let u,f,h,m;for(u=0,f=i;u<f;++u)h=u+o,m=n[h],c[u]={x:s.parse(kt(m,a),h),y:l.parse(kt(m,d),h)};return c}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,l=n[e.axis],a={keys:Ul(i,!0),values:n._stacks[e.axis]._visualValues};return Gl(a,l,s.index,{mode:o})}updateRangeFromParsed(e,n,o,i){const s=o[n.axis];let l=s===null?NaN:s;const a=i&&o._stacks[n.axis];i&&a&&(i.values=a,l=Gl(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,l),e.max=Math.max(e.max,l)}getMinMax(e,n){const o=this._cachedMeta,i=o._parsed,s=o._sorted&&e===o.iScale,l=i.length,a=this._getOtherScale(e),d=$m(n,o,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=pm(a);let h,m;function p(){m=i[h];const g=m[a.axis];return!ce(m[e.axis])||u>g||f<g}for(h=0;h<l&&!(!p()&&(this.updateRangeFromParsed(c,e,m,d),s));++h);if(s){for(h=l-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,e,m,d);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,o=[];let i,s,l;for(i=0,s=n.length;i<s;++i)l=n[i][e.axis],ce(l)&&o.push(l);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=fm(G(this.options.clip,um(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,l=[],a=this._drawStart||0,d=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,s,a,d),u=a;u<a+d;++u){const f=i[u];f.hidden||(f.active&&c?l.push(f):f.draw(e,s))}for(u=0;u<l.length;++u)l[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 l=this._cachedMeta.data[e];s=l.$context||(l.$context=ym(this.getContext(),e,l)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=bm(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,l=e+"-"+n,a=s[l],d=this.enableOptionSharing&&Cn(o);if(a)return Zl(a,d);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),f=i?[`${e}Hover`,"hover",e,""]:[e,""],h=c.getOptionScopes(this.getDataset(),u),m=Object.keys(ue.elements[e]),p=()=>this.getContext(o,i,n),g=c.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=d,s[l]=Object.freeze(Zl(g,d))),g}_resolveAnimations(e,n,o){const i=this.chart,s=this._cachedDataOpts,l=`animation-${n}`,a=s[l];if(a)return a;let d;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);d=u.createResolver(h,this.getContext(e,o,n))}const c=new jl(i,d&&d.animations);return d&&d._cacheable&&(s[l]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||ti(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const o=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(o),l=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,o),{sharedOptions:s,includeOptions:l}}updateElement(e,n,o,i){ti(i)?Object.assign(e,o):this._resolveAnimations(n,i).update(e,o)}updateSharedOptions(e,n,o){e&&!ti(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,d,c]of this._syncList)this[a](d,c);this._syncList=[];const i=o.length,s=n.length,l=Math.min(s,i);l&&this.parse(0,l),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,l=e+n;let a;const d=c=>{for(c.length+=n,a=c.length-1;a>=l;a--)c[a]=c[a-n]};for(d(s),a=e;a<l;++a)s[a]=new this.dataElementType;this._parsing&&d(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&&En(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])}}T(He,"defaults",{}),T(He,"datasetElementType",null),T(He,"dataElementType",null);function wm(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=fl(o.sort((i,s)=>i-s))}return t._cache.$bar}function _m(t){const e=t.iScale,n=wm(e,t.type);let o=e._length,i,s,l,a;const d=()=>{l===32767||l===-32768||(Cn(a)&&(o=Math.min(o,Math.abs(l-a)||o)),a=l)};for(i=0,s=n.length;i<s;++i)l=e.getPixelForValue(n[i]),d();for(a=void 0,i=0,s=e.ticks.length;i<s;++i)l=e.getPixelForTick(i),d();return o}function km(t,e,n,o){const i=n.barThickness;let s,l;return Q(i)?(s=e.min*n.categoryPercentage,l=n.barPercentage):(s=i*o,l=1),{chunk:s/o,ratio:l,start:e.pixels[t]-s/2}}function Cm(t,e,n,o){const i=e.pixels,s=i[t];let l=t>0?i[t-1]:null,a=t<i.length-1?i[t+1]:null;const d=n.categoryPercentage;l===null&&(l=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-l);const c=s-(s-Math.min(l,a))/2*d;return{chunk:Math.abs(a-l)/2*d/o,ratio:n.barPercentage,start:c}}function xm(t,e,n,o){const i=n.parse(t[0],o),s=n.parse(t[1],o),l=Math.min(i,s),a=Math.max(i,s);let d=l,c=a;Math.abs(l)>Math.abs(a)&&(d=a,c=l),e[n.axis]=c,e._custom={barStart:d,barEnd:c,start:i,end:s,min:l,max:a}}function Jl(t,e,n,o){return re(t)?xm(t,e,n,o):e[n.axis]=n.parse(t,o),e}function Ql(t,e,n,o){const i=t.iScale,s=t.vScale,l=i.getLabels(),a=i===s,d=[];let c,u,f,h;for(c=n,u=n+o;c<u;++c)h=e[c],f={},f[i.axis]=a||i.parse(l[c],c),d.push(Jl(h,f,s,c));return d}function ni(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Sm(t,e,n){return t!==0?Ge(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function vm(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 Dm(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:l,end:a,reverse:d,top:c,bottom:u}=vm(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?i=c:(n._bottom||0)===o?i=u:(s[ea(u,l,a,d)]=!0,i=c)),s[ea(i,l,a,d)]=!0,t.borderSkipped=s}function ea(t,e,n,o){return o?(t=Mm(t,e,n),t=ta(t,n,e)):t=ta(t,e,n),t}function Mm(t,e,n){return t===e?n:t===n?e:t}function ta(t,e,n){return t==="start"?e:t==="end"?n:t}function Vm(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class xo extends He{parsePrimitiveData(e,n,o,i){return Ql(e,n,o,i)}parseArrayData(e,n,o,i){return Ql(e,n,o,i)}parseObjectData(e,n,o,i){const{iScale:s,vScale:l}=e,{xAxisKey:a="x",yAxisKey:d="y"}=this._parsing,c=s.axis==="x"?a:d,u=l.axis==="x"?a:d,f=[];let h,m,p,g;for(h=o,m=o+i;h<m;++h)g=n[h],p={},p[s.axis]=s.parse(kt(g,c),h),f.push(Jl(kt(g,u),p,l,h));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),l=s._custom,a=ni(l)?"["+l.start+", "+l.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:l,_cachedMeta:{vScale:a}}=this,d=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,i);for(let m=n;m<n+o;m++){const p=this.getParsed(m),g=s||Q(p[a.axis])?{base:d,head:d}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),y=(p._stacks||{})[a.axis],C={horizontal:c,base:g.base,enableBorderRadius:!y||ni(p._custom)||l===y._top||l===y._bottom,x:c?g.head:b.center,y:c?b.center:g.head,height:c?b.size:Math.abs(g.size),width:c?Math.abs(g.size):b.size};h&&(C.options=f||this.resolveDataElementOptions(m,e[m].active?"active":i));const v=C.options||e[m].options;Dm(C,v,y,l),Vm(C,v,u.ratio),this.updateElement(e[m],m,C,i)}}_getStacks(e,n){const{iScale:o}=this._cachedMeta,i=o.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),s=o.options.stacked,l=[],a=d=>{const c=d.controller.getParsed(n),u=c&&c[d.vScale.axis];if(Q(u)||isNaN(u))return!0};for(const d of i)if(!(n!==void 0&&a(d))&&((s===!1||l.indexOf(d.stack)===-1||s===void 0&&d.stack===void 0)&&l.push(d.stack),d.index===e))break;return l.length||l.push(void 0),l}_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,l;for(s=0,l=n.data.length;s<l;++s)i.push(o.getPixelForValue(this.getParsed(s)[o.axis],s));const a=e.barThickness;return{min:a||_m(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:l}}=this,a=s||0,d=this.getParsed(e),c=d._custom,u=ni(c);let f=d[n.axis],h=0,m=o?this.applyStack(n,d,o):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=c.barStart,m=c.barEnd-c.barStart,f!==0&&Ge(f)!==Ge(c.barEnd)&&(h=0),h+=f);const b=!Q(s)&&!u?s:h;let y=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(h+m):p=y,g=p-y,Math.abs(g)<l){g=Sm(g,n,a)*l,f===a&&(y-=g/2);const C=n.getPixelForDecimal(0),v=n.getPixelForDecimal(1),_=Math.min(C,v),x=Math.max(C,v);y=Math.max(Math.min(y,x),_),p=y+g,o&&!u&&(d._stacks[n.axis]._visualValues[i]=n.getValueForPixel(p)-n.getValueForPixel(y))}if(y===n.getPixelForValue(a)){const C=Ge(g)*n.getLineWidthForValue(a)/2;y+=C,g-=C}return{size:g,base:y,head:p,center:p+g/2}}_calculateBarIndexPixels(e,n){const o=n.scale,i=this.options,s=i.skipNull,l=G(i.maxBarThickness,1/0);let a,d;if(n.grouped){const c=s?this._getStackCount(e):n.stackCount,u=i.barThickness==="flex"?Cm(e,n,i,c):km(e,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0);a=u.start+u.chunk*f+u.chunk/2,d=Math.min(l,u.chunk*u.ratio)}else a=o.getPixelForValue(this.getParsed(e)[o.axis],e),d=Math.min(l,n.min*n.ratio);return{base:a-d/2,head:a+d/2,center:a,size:d}}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)}}T(xo,"id","bar"),T(xo,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),T(xo,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class So extends He{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,o,i){const s=super.parsePrimitiveData(e,n,o,i);for(let l=0;l<s.length;l++)s[l]._custom=this.resolveDataElementOptions(l+o).radius;return s}parseArrayData(e,n,o,i){const s=super.parseArrayData(e,n,o,i);for(let l=0;l<s.length;l++){const a=n[o+l];s[l]._custom=G(a[2],this.resolveDataElementOptions(l+o).radius)}return s}parseObjectData(e,n,o,i){const s=super.parseObjectData(e,n,o,i);for(let l=0;l<s.length;l++){const a=n[o+l];s[l]._custom=G(a&&a.r&&+a.r,this.resolveDataElementOptions(l+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,l=this.getParsed(e),a=i.getLabelForValue(l.x),d=s.getLabelForValue(l.y),c=l._custom;return{label:o[e]||"",value:"("+a+", "+d+(c?", "+c:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:l,vScale:a}=this._cachedMeta,{sharedOptions:d,includeOptions:c}=this._getSharedOptions(n,i),u=l.axis,f=a.axis;for(let h=n;h<n+o;h++){const m=e[h],p=!s&&this.getParsed(h),g={},b=g[u]=s?l.getPixelForDecimal(.5):l.getPixelForValue(p[u]),y=g[f]=s?a.getBasePixel():a.getPixelForValue(p[f]);g.skip=isNaN(b)||isNaN(y),c&&(g.options=d||this.resolveDataElementOptions(h,m.active?"active":i),s&&(g.options.radius=0)),this.updateElement(m,h,g,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+=G(o&&o._custom,s),i}}T(So,"id","bubble"),T(So,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),T(So,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Bm(t,e,n){let o=1,i=1,s=0,l=0;if(e<se){const a=t,d=a+e,c=Math.cos(a),u=Math.sin(a),f=Math.cos(d),h=Math.sin(d),m=(v,_,x)=>Sn(v,a,d,!0)?1:Math.max(_,_*n,x,x*n),p=(v,_,x)=>Sn(v,a,d,!0)?-1:Math.min(_,_*n,x,x*n),g=m(0,c,f),b=m(me,u,h),y=p(ie,c,f),C=p(ie+me,u,h);o=(g-y)/2,i=(b-C)/2,s=-(g+y)/2,l=-(b+C)/2}return{ratioX:o,ratioY:i,offsetX:s,offsetY:l}}class Yt extends He{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=d=>+o[d];if(Z(o[e])){const{key:d="value"}=this._parsing;s=c=>+kt(o[c],d)}let l,a;for(l=e,a=e+n;l<a;++l)i._parsed[l]=s(l)}}_getRotation(){return Le(this.options.rotation-90)}_getCircumference(){return Le(this.options.circumference)}_getRotationExtents(){let e=se,n=-se;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(),l=i._getCircumference();e=Math.min(e,s),n=Math.max(n,s+l)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:o}=n,i=this._cachedMeta,s=i.data,l=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(o.width,o.height)-l)/2,0),d=Math.min(jf(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=Bm(f,u,d),b=(o.width-l)/h,y=(o.height-l)/m,C=Math.max(Math.min(b,y)/2,0),v=tl(this.options.radius,C),_=Math.max(v*d,0),x=(v-_)/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=g*v,i.total=this.calculateTotal(),this.outerRadius=v-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,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/se)}updateElements(e,n,o,i){const s=i==="reset",l=this.chart,a=l.chartArea,c=l.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,h=s&&c.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(n,i);let y=this._getRotation(),C;for(C=0;C<n;++C)y+=this._circumference(C,s);for(C=n;C<n+o;++C){const v=this._circumference(C,s),_=e[C],x={x:u+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+v,circumference:v,outerRadius:p,innerRadius:m};b&&(x.options=g||this.resolveDataElementOptions(C,_.active?"active":i)),y+=v,this.updateElement(_,C,x,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)?se*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Dn(n._parsed[e],o.options.locale);return{label:i[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const o=this.chart;let i,s,l,a,d;if(!e){for(i=0,s=o.data.datasets.length;i<s;++i)if(o.isDatasetVisible(i)){l=o.getDatasetMeta(i),e=l.data,a=l.controller;break}}if(!e)return 0;for(i=0,s=e.length;i<s;++i)d=a.resolveDataElementOptions(i),d.borderAlign!=="inner"&&(n=Math.max(n,d.borderWidth||0,d.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(G(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}T(Yt,"id","doughnut"),T(Yt,"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"}),T(Yt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),T(Yt,"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,l)=>{const d=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:d.backgroundColor,strokeStyle:d.borderColor,fontColor:i,lineWidth:d.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(l),index:l}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}}});class vo extends He{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:o,data:i=[],_dataset:s}=n,l=this.chart._animationsDisabled;let{start:a,count:d}=pl(n,i,l);this._drawStart=a,this._drawCount=d,gl(n)&&(a=0,d=i.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!s._decimated,o.points=i;const c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!l,options:c},e),this.updateElements(i,a,d,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:l,vScale:a,_stacked:d,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),h=l.axis,m=a.axis,{spanGaps:p,segment:g}=this.options,b=Qt(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none",C=n+o,v=e.length;let _=n>0&&this.getParsed(n-1);for(let x=0;x<v;++x){const N=e[x],E=y?N:{};if(x<n||x>=C){E.skip=!0;continue}const R=this.getParsed(x),k=Q(R[m]),S=E[h]=l.getPixelForValue(R[h],x),w=E[m]=s||k?a.getBasePixel():a.getPixelForValue(d?this.applyStack(a,R,d):R[m],x);E.skip=isNaN(S)||isNaN(w)||k,E.stop=x>0&&Math.abs(R[h]-_[h])>b,g&&(E.parsed=R,E.raw=c.data[x]),f&&(E.options=u||this.resolveDataElementOptions(x,N.active?"active":i)),y||this.updateElement(N,x,E,i),_=R}}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)),l=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(o,s,l)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}T(vo,"id","line"),T(vo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),T(vo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Pn extends He{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=Dn(n._parsed[e].r,o.options.locale);return{label:i[e]||"",value:s}}parseObjectData(e,n,o,i){return El.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),l=Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0),a=(s-l)/e.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,o,i){const s=i==="reset",l=this.chart,d=l.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,h=c.getIndexAngle(0)-.5*ie;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,i,g);for(p=n;p<n+o;p++){const b=e[p];let y=m,C=m+this._computeAngle(p,i,g),v=l.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=C,s&&(d.animateScale&&(v=0),d.animateRotate&&(y=C=h));const _={x:u,y:f,innerRadius:0,outerRadius:v,startAngle:y,endAngle:C,options:this.resolveDataElementOptions(p,b.active?"active":i)};this.updateElement(b,p,_,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)?Le(this.resolveDataElementOptions(e,n).angle||o):0}}T(Pn,"id","polarArea"),T(Pn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),T(Pn,"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,l)=>{const d=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:d.backgroundColor,strokeStyle:d.borderColor,fontColor:i,lineWidth:d.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(l),index:l}})}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 oi extends Yt{}T(oi,"id","pie"),T(oi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Do extends He{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 El.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 l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:l};this.updateElement(o,void 0,a,e)}this.updateElements(i,0,i.length,e)}updateElements(e,n,o,i){const s=this._cachedMeta.rScale,l=i==="reset";for(let a=n;a<n+o;a++){const d=e[a],c=this.resolveDataElementOptions(a,d.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),f=l?s.xCenter:u.x,h=l?s.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:c};this.updateElement(d,a,m,i)}}}T(Do,"id","radar"),T(Do,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),T(Do,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Mo extends He{getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:i,yScale:s}=n,l=this.getParsed(e),a=i.getLabelForValue(l.x),d=s.getLabelForValue(l.y);return{label:o[e]||"",value:"("+a+", "+d+")"}}update(e){const n=this._cachedMeta,{data:o=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:l}=pl(n,o,i);if(this._drawStart=s,this._drawCount=l,gl(n)&&(s=0,l=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:d}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!d._decimated,a.points=o;const c=this.resolveDatasetElementOptions(e);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(o,s,l,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:l,vScale:a,_stacked:d,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),h=this.includeOptions(i,f),m=l.axis,p=a.axis,{spanGaps:g,segment:b}=this.options,y=Qt(g)?g:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||i==="none";let v=n>0&&this.getParsed(n-1);for(let _=n;_<n+o;++_){const x=e[_],N=this.getParsed(_),E=C?x:{},R=Q(N[p]),k=E[m]=l.getPixelForValue(N[m],_),S=E[p]=s||R?a.getBasePixel():a.getPixelForValue(d?this.applyStack(a,N,d):N[p],_);E.skip=isNaN(k)||isNaN(S)||R,E.stop=_>0&&Math.abs(N[m]-v[m])>y,b&&(E.parsed=N,E.raw=c.data[_]),h&&(E.options=f||this.resolveDataElementOptions(_,x.active?"active":i)),C||this.updateElement(x,_,E,i),v=N}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let d=n.length-1;d>=0;--d)a=Math.max(a,n[d].size(this.resolveDataElementOptions(d))/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)),l=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,l)/2}}T(Mo,"id","scatter"),T(Mo,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),T(Mo,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Em=Object.freeze({__proto__:null,BarController:xo,BubbleController:So,DoughnutController:Yt,LineController:vo,PieController:oi,PolarAreaController:Pn,RadarController:Do,ScatterController:Mo});function jt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ri{constructor(e){T(this,"options");this.options=e||{}}static override(e){Object.assign(ri.prototype,e)}init(){}formats(){return jt()}parse(){return jt()}format(){return jt()}add(){return jt()}diff(){return jt()}startOf(){return jt()}endOf(){return jt()}}var Pm={_date:ri};function Nm(t,e,n,o){const{controller:i,data:s,_sorted:l}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&l&&s.length){const d=a._reversePixels?nh:rt;if(o){if(i._sharedOptions){const c=s[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const f=d(s,e,n-u),h=d(s,e,n+u);return{lo:f.lo,hi:h.hi}}}}else return d(s,e,n)}return{lo:0,hi:s.length-1}}function Nn(t,e,n,o,i){const s=t.getSortedVisibleDatasetMetas(),l=n[e];for(let a=0,d=s.length;a<d;++a){const{index:c,data:u}=s[a],{lo:f,hi:h}=Nm(s[a],e,l,i);for(let m=f;m<=h;++m){const p=u[m];p.skip||o(p,c,m)}}}function Fm(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,l=n?Math.abs(o.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(l,2))}}function ii(t,e,n,o,i){const s=[];return!i&&!t.isPointInArea(e)||Nn(t,n,e,function(a,d,c){!i&&!it(a,t.chartArea,0)||a.inRange(e.x,e.y,o)&&s.push({element:a,datasetIndex:d,index:c})},!0),s}function Rm(t,e,n,o){let i=[];function s(l,a,d){const{startAngle:c,endAngle:u}=l.getProps(["startAngle","endAngle"],o),{angle:f}=dl(l,{x:e.x,y:e.y});Sn(f,c,u)&&i.push({element:l,datasetIndex:a,index:d})}return Nn(t,n,e,s),i}function Am(t,e,n,o,i,s){let l=[];const a=Fm(n);let d=Number.POSITIVE_INFINITY;function c(u,f,h){const m=u.inRange(e.x,e.y,i);if(o&&!m)return;const p=u.getCenterPoint(i);if(!(!!s||t.isPointInArea(p))&&!m)return;const b=a(e,p);b<d?(l=[{element:u,datasetIndex:f,index:h}],d=b):b===d&&l.push({element:u,datasetIndex:f,index:h})}return Nn(t,n,e,c),l}function si(t,e,n,o,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!o?Rm(t,e,n,i):Am(t,e,n,o,i,s)}function na(t,e,n,o,i){const s=[],l=n==="x"?"inXRange":"inYRange";let a=!1;return Nn(t,n,e,(d,c,u)=>{d[l](e[n],i)&&(s.push({element:d,datasetIndex:c,index:u}),a=a||d.inRange(e.x,e.y,i))}),o&&!a?[]:s}var Om={evaluateInteractionItems:Nn,modes:{index(t,e,n,o){const i=Lt(e,t),s=n.axis||"x",l=n.includeInvisible||!1,a=n.intersect?ii(t,i,s,o,l):si(t,i,s,!1,o,l),d=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&d.push({element:f,datasetIndex:c.index,index:u})}),d):[]},dataset(t,e,n,o){const i=Lt(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;let a=n.intersect?ii(t,i,s,o,l):si(t,i,s,!1,o,l);if(a.length>0){const d=a[0].datasetIndex,c=t.getDatasetMeta(d).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:d,index:u})}return a},point(t,e,n,o){const i=Lt(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return ii(t,i,s,o,l)},nearest(t,e,n,o){const i=Lt(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return si(t,i,s,n.intersect,o,l)},x(t,e,n,o){const i=Lt(e,t);return na(t,i,"x",n.intersect,o)},y(t,e,n,o){const i=Lt(e,t);return na(t,i,"y",n.intersect,o)}}};const oa=["left","top","right","bottom"];function Fn(t,e){return t.filter(n=>n.pos===e)}function ra(t,e){return t.filter(n=>oa.indexOf(n.pos)===-1&&n.box.axis===e)}function Rn(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 Im(t){const e=[];let n,o,i,s,l,a;for(n=0,o=(t||[]).length;n<o;++n)i=t[n],{position:s,options:{stack:l,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:l&&s+l,stackWeight:a});return e}function Tm(t){const e={};for(const n of t){const{stack:o,pos:i,stackWeight:s}=n;if(!o||!oa.includes(i))continue;const l=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}return e}function zm(t,e){const n=Tm(t),{vBoxMaxWidth:o,hBoxMaxHeight:i}=e;let s,l,a;for(s=0,l=t.length;s<l;++s){a=t[s];const{fullSize:d}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*o:d&&e.availableWidth,a.height=i):(a.width=o,a.height=u?u*i:d&&e.availableHeight)}return n}function Lm(t){const e=Im(t),n=Rn(e.filter(c=>c.box.fullSize),!0),o=Rn(Fn(e,"left"),!0),i=Rn(Fn(e,"right")),s=Rn(Fn(e,"top"),!0),l=Rn(Fn(e,"bottom")),a=ra(e,"x"),d=ra(e,"y");return{fullSize:n,leftAndTop:o.concat(s),rightAndBottom:i.concat(d).concat(l).concat(a),chartArea:Fn(e,"chartArea"),vertical:o.concat(i).concat(d),horizontal:s.concat(l).concat(a)}}function ia(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function sa(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 Hm(t,e,n,o){const{pos:i,box:s}=n,l=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&&sa(l,s.getPadding());const a=Math.max(0,e.outerWidth-ia(l,t,"left","right")),d=Math.max(0,e.outerHeight-ia(l,t,"top","bottom")),c=a!==t.w,u=d!==t.h;return t.w=a,t.h=d,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Ym(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 jm(t,e){const n=e.maxPadding;function o(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(l=>{s[l]=Math.max(e[l],n[l])}),s}return o(t?["left","right"]:["top","bottom"])}function An(t,e,n,o){const i=[];let s,l,a,d,c,u;for(s=0,l=t.length,c=0;s<l;++s){a=t[s],d=a.box,d.update(a.width||e.w,a.height||e.h,jm(a.horizontal,e));const{same:f,other:h}=Hm(e,n,a,o);c|=f&&i.length,u=u||h,d.fullSize||i.push(a)}return c&&An(i,e,n,o)||u}function Vo(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 la(t,e,n,o){const i=n.padding;let{x:s,y:l}=e;for(const a of t){const d=a.box,c=o[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=e.w*u,h=c.size||d.height;Cn(c.start)&&(l=c.start),d.fullSize?Vo(d,i.left,l,n.outerWidth-i.right-i.left,h):Vo(d,e.left+c.placed,l,f,h),c.start=l,c.placed+=f,l=d.bottom}else{const f=e.h*u,h=c.size||d.width;Cn(c.start)&&(s=c.start),d.fullSize?Vo(d,s,i.top,h,n.outerHeight-i.bottom-i.top):Vo(d,s,e.top+c.placed,h,f),c.start=s,c.placed+=f,s=d.right}}e.x=s,e.y=l}var xe={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=Ce(t.options.layout.padding),s=Math.max(e-i.width,0),l=Math.max(n-i.height,0),a=Lm(t.boxes),d=a.vertical,c=a.horizontal;ne(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=d.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:l,vBoxMaxWidth:s/2/u,hBoxMaxHeight:l/2}),h=Object.assign({},i);sa(h,Ce(o));const m=Object.assign({maxPadding:h,w:s,h:l,x:i.left,y:i.top},i),p=zm(d.concat(c),f);An(a.fullSize,m,f,p),An(d,m,f,p),An(c,m,f,p)&&An(d,m,f,p),Ym(m),la(a.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,la(a.rightAndBottom,m,f,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},ne(a.chartArea,g=>{const b=g.box;Object.assign(b,t.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class aa{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 Wm extends aa{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Bo="$chartjs",Um={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},da=t=>t===null||t==="";function Gm(t,e){const n=t.style,o=t.getAttribute("height"),i=t.getAttribute("width");if(t[Bo]={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",da(i)){const s=Fl(t,"width");s!==void 0&&(t.width=s)}if(da(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Fl(t,"height");s!==void 0&&(t.height=s)}return t}const ca=Xh?{passive:!0}:!1;function qm(t,e,n){t&&t.addEventListener(e,n,ca)}function Xm(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,ca)}function Km(t,e){const n=Um[t.type]||t.type,{x:o,y:i}=Lt(t,e);return{type:n,chart:e,native:t,x:o!==void 0?o:null,y:i!==void 0?i:null}}function Eo(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Zm(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let l=!1;for(const a of s)l=l||Eo(a.addedNodes,o),l=l&&!Eo(a.removedNodes,o);l&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Jm(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let l=!1;for(const a of s)l=l||Eo(a.removedNodes,o),l=l&&!Eo(a.addedNodes,o);l&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const On=new Map;let ua=0;function fa(){const t=window.devicePixelRatio;t!==ua&&(ua=t,On.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Qm(t,e){On.size||window.addEventListener("resize",fa),On.set(t,e)}function ep(t){On.delete(t),On.size||window.removeEventListener("resize",fa)}function tp(t,e,n){const o=t.canvas,i=o&&Qr(o);if(!i)return;const s=ml((a,d)=>{const c=i.clientWidth;n(a,d),c<i.clientWidth&&n()},window),l=new ResizeObserver(a=>{const d=a[0],c=d.contentRect.width,u=d.contentRect.height;c===0&&u===0||s(c,u)});return l.observe(i),Qm(t,s),l}function li(t,e,n){n&&n.disconnect(),e==="resize"&&ep(t)}function np(t,e,n){const o=t.canvas,i=ml(s=>{t.ctx!==null&&n(Km(s,t))},t);return qm(o,e,i),i}class op extends aa{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Gm(e,n),o):null}releaseContext(e){const n=e.canvas;if(!n[Bo])return!1;const o=n[Bo].initial;["height","width"].forEach(s=>{const l=o[s];Q(l)?n.removeAttribute(s):n.setAttribute(s,l)});const i=o.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Bo],!0}addEventListener(e,n,o){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),l={attach:Zm,detach:Jm,resize:tp}[n]||np;i[n]=l(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),i=o[n];if(!i)return;({attach:li,detach:li,resize:li}[n]||Xm)(e,n,i),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,i){return qh(e,n,o,i)}isAttached(e){const n=Qr(e);return!!(n&&n.isConnected)}}function rp(t){return!Jr()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Wm:op}let lt=(_r=class{constructor(){T(this,"x");T(this,"y");T(this,"active",!1);T(this,"options");T(this,"$animations")}tooltipPosition(e){const{x:n,y:o}=this.getProps(["x","y"],e);return{x:n,y:o}}hasValue(){return Qt(this.x)&&Qt(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}},T(_r,"defaults",{}),T(_r,"defaultRoutes"),_r);function ip(t,e){const n=t.options.ticks,o=sp(t),i=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?ap(e):[],l=s.length,a=s[0],d=s[l-1],c=[];if(l>i)return dp(e,c,s,l/i),c;const u=lp(s,e,i);if(l>0){let f,h;const m=l>1?Math.round((d-a)/(l-1)):null;for(Po(e,c,u,Q(m)?0:a-m,a),f=0,h=l-1;f<h;f++)Po(e,c,u,s[f],s[f+1]);return Po(e,c,u,d,Q(m)?e.length:d+m),c}return Po(e,c,u),c}function sp(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 lp(t,e,n){const o=cp(t),i=e.length/n;if(!o)return Math.max(i,1);const s=Jf(o);for(let l=0,a=s.length-1;l<a;l++){const d=s[l];if(d>i)return d}return Math.max(i,1)}function ap(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function dp(t,e,n,o){let i=0,s=n[0],l;for(o=Math.ceil(o),l=0;l<t.length;l++)l===s&&(e.push(t[l]),i++,s=n[i*o])}function Po(t,e,n,o,i){const s=G(o,0),l=Math.min(G(i,t.length),t.length);let a=0,d,c,u;for(n=Math.ceil(n),i&&(d=i-o,n=d/Math.floor(d/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<l;c++)c===u&&(e.push(t[c]),a++,u=Math.round(s+a*n))}function cp(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 up=t=>t==="left"?"right":t==="right"?"left":t,ha=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,ma=(t,e)=>Math.min(e||t,t);function pa(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 fp(t,e,n){const o=t.ticks.length,i=Math.min(e,o-1),s=t._startPixel,l=t._endPixel,a=1e-6;let d=t.getPixelForTick(i),c;if(!(n&&(o===1?c=Math.max(d-s,l-d):e===0?c=(t.getPixelForTick(1)-d)/2:c=(d-t.getPixelForTick(i-1))/2,d+=i<e?c:-c,d<s-a||d>l+a)))return d}function hp(t,e){ne(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 In(t){return t.drawTicks?t.tickLength:0}function ga(t,e){if(!t.display)return 0;const n=ge(t.font,e),o=Ce(t.padding);return(re(t.text)?t.text.length:1)*n.lineHeight+o.height}function mp(t,e){return St(t,{scale:e,type:"scale"})}function pp(t,e,n){return St(t,{tick:n,index:e,type:"tick"})}function gp(t,e,n){let o=Hr(t);return(n&&e!=="right"||!n&&e==="right")&&(o=up(o)),o}function bp(t,e,n,o){const{top:i,left:s,bottom:l,right:a,chart:d}=t,{chartArea:c,scales:u}=d;let f=0,h,m,p;const g=l-i,b=a-s;if(t.isHorizontal()){if(m=ke(o,s,a),Z(n)){const y=Object.keys(n)[0],C=n[y];p=u[y].getPixelForValue(C)+g-e}else n==="center"?p=(c.bottom+c.top)/2+g-e:p=ha(t,n,e);h=a-s}else{if(Z(n)){const y=Object.keys(n)[0],C=n[y];m=u[y].getPixelForValue(C)-b+e}else n==="center"?m=(c.left+c.right)/2-b+e:m=ha(t,n,e);p=ke(o,l,i),f=n==="left"?-me:me}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class Wt extends lt{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=Pe(e,Number.POSITIVE_INFINITY),n=Pe(n,Number.NEGATIVE_INFINITY),o=Pe(o,Number.POSITIVE_INFINITY),i=Pe(i,Number.NEGATIVE_INFINITY),{min:Pe(e,o),max:Pe(n,i),minDefined:ce(e),maxDefined:ce(n)}}getMinMax(e){let{min:n,max:o,minDefined:i,maxDefined:s}=this.getUserBounds(),l;if(i&&s)return{min:n,max:o};const a=this.getMatchingVisibleMetas();for(let d=0,c=a.length;d<c;++d)l=a[d].controller.getMinMax(this,e),i||(n=Math.min(n,l.min)),s||(o=Math.max(o,l.max));return n=s&&n>o?o:n,o=i&&n>o?n:o,{min:Pe(n,Pe(o,n)),max:Pe(o,Pe(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(){oe(this.options.beforeUpdate,[this])}update(e,n,o){const{beginAtZero:i,grace:s,ticks:l}=this.options,a=l.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=vh(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const d=a<this.ticks.length;this._convertTicksToLabels(d?pa(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=ip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),d&&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(){oe(this.options.afterUpdate,[this])}beforeSetDimensions(){oe(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(){oe(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),oe(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){oe(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=oe(n.callback,[s.value,o,e],this)}afterTickToLabelConversion(){oe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){oe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=ma(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let l=i,a,d,c;if(!this._isVisible()||!n.display||i>=s||o<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=$e(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/o:m/(o-1),f+6>a&&(a=m/(o-(e.offset?.5:1)),d=this.maxHeight-In(e.grid)-n.padding-ga(e.title,this.chart.options.font),c=Math.sqrt(f*f+h*h),l=Tr(Math.min(Math.asin($e((u.highest.height+6)/a,-1,1)),Math.asin($e(d/c,-1,1))-Math.asin($e(h/c,-1,1)))),l=Math.max(i,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){oe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){oe(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:o,title:i,grid:s}}=this,l=this._isVisible(),a=this.isHorizontal();if(l){const d=ga(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=In(s)+d):(e.height=this.maxHeight,e.width=In(s)+d),o.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:h}=this._getLabelSizes(),m=o.padding*2,p=Le(this.labelRotation),g=Math.cos(p),b=Math.sin(p);if(a){const y=o.mirror?0:b*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=o.mirror?0:g*f.width+b*h.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(c,u,b,g)}}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:l},position:a}=this.options,d=this.labelRotation!==0,c=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 h=0,m=0;d?c?(h=i*e.width,m=o*n.height):(h=o*e.height,m=i*n.width):s==="start"?m=n.width:s==="end"?h=e.width:s!=="inner"&&(h=e.width/2,m=n.width/2),this.paddingLeft=Math.max((h-u+l)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+l)*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+l,this.paddingBottom=f+l}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){oe(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++)Q(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=pa(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,l=[],a=[],d=Math.floor(n/ma(n,o));let c=0,u=0,f,h,m,p,g,b,y,C,v,_,x;for(f=0;f<n;f+=d){if(p=e[f].label,g=this._resolveTickFontOptions(f),i.font=b=g.string,y=s[b]=s[b]||{data:{},gc:[]},C=g.lineHeight,v=_=0,!Q(p)&&!re(p))v=bo(i,y.data,y.gc,v,p),_=C;else if(re(p))for(h=0,m=p.length;h<m;++h)x=p[h],!Q(x)&&!re(x)&&(v=bo(i,y.data,y.gc,v,x),_+=C);l.push(v),a.push(_),c=Math.max(v,c),u=Math.max(_,u)}hp(s,n);const N=l.indexOf(c),E=a.indexOf(u),R=k=>({width:l[k]||0,height:a[k]||0});return{first:R(0),last:R(n-1),widest:R(N),highest:R(E),widths:l,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 th(this._alignToPixels?Ot(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=pp(this.getContext(),e,o))}return this.$context||(this.$context=mp(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Le(this.labelRotation),o=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),l=e.autoSkipPadding||0,a=s?s.widest.width+l:0,d=s?s.highest.height+l:0;return this.isHorizontal()?d*o>a*i?a/o:d/i:d*i<a*o?d/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:l,border:a}=i,d=s.offset,c=this.isHorizontal(),f=this.ticks.length+(d?1:0),h=In(s),m=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,b=g/2,y=function(V){return Ot(o,V,g)};let C,v,_,x,N,E,R,k,S,w,$,B;if(l==="top")C=y(this.bottom),E=this.bottom-h,k=C-b,w=y(e.top)+b,B=e.bottom;else if(l==="bottom")C=y(this.top),w=e.top,B=y(e.bottom)-b,E=C+b,k=this.top+h;else if(l==="left")C=y(this.right),N=this.right-h,R=C-b,S=y(e.left)+b,$=e.right;else if(l==="right")C=y(this.left),S=e.left,$=y(e.right)-b,N=C+b,R=this.left+h;else if(n==="x"){if(l==="center")C=y((e.top+e.bottom)/2+.5);else if(Z(l)){const V=Object.keys(l)[0],F=l[V];C=y(this.chart.scales[V].getPixelForValue(F))}w=e.top,B=e.bottom,E=C+b,k=E+h}else if(n==="y"){if(l==="center")C=y((e.left+e.right)/2);else if(Z(l)){const V=Object.keys(l)[0],F=l[V];C=y(this.chart.scales[V].getPixelForValue(F))}N=C-b,R=N-h,S=e.left,$=e.right}const M=G(i.ticks.maxTicksLimit,f),P=Math.max(1,Math.ceil(f/M));for(v=0;v<f;v+=P){const V=this.getContext(v),F=s.setContext(V),A=a.setContext(V),L=F.lineWidth,z=F.color,W=A.dash||[],X=A.dashOffset,K=F.tickWidth,te=F.tickColor,ae=F.tickBorderDash||[],pe=F.tickBorderDashOffset;_=fp(this,v,d),_!==void 0&&(x=Ot(o,_,L),c?N=R=S=$=x:E=k=w=B=x,m.push({tx1:N,ty1:E,tx2:R,ty2:k,x1:S,y1:w,x2:$,y2:B,width:L,color:z,borderDash:W,borderDashOffset:X,tickWidth:K,tickColor:te,tickBorderDash:ae,tickBorderDashOffset:pe}))}return this._ticksLength=f,this._borderValue=C,m}_computeLabelItems(e){const n=this.axis,o=this.options,{position:i,ticks:s}=o,l=this.isHorizontal(),a=this.ticks,{align:d,crossAlign:c,padding:u,mirror:f}=s,h=In(o.grid),m=h+u,p=f?-u:m,g=-Le(this.labelRotation),b=[];let y,C,v,_,x,N,E,R,k,S,w,$,B="middle";if(i==="top")N=this.bottom-p,E=this._getXAxisLabelAlignment();else if(i==="bottom")N=this.top+p,E=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(h);E=P.textAlign,x=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(h);E=P.textAlign,x=P.x}else if(n==="x"){if(i==="center")N=(e.top+e.bottom)/2+m;else if(Z(i)){const P=Object.keys(i)[0],V=i[P];N=this.chart.scales[P].getPixelForValue(V)+m}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(e.left+e.right)/2-m;else if(Z(i)){const P=Object.keys(i)[0],V=i[P];x=this.chart.scales[P].getPixelForValue(V)}E=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(d==="start"?B="top":d==="end"&&(B="bottom"));const M=this._getLabelSizes();for(y=0,C=a.length;y<C;++y){v=a[y],_=v.label;const P=s.setContext(this.getContext(y));R=this.getPixelForTick(y)+s.labelOffset,k=this._resolveTickFontOptions(y),S=k.lineHeight,w=re(_)?_.length:1;const V=w/2,F=P.color,A=P.textStrokeColor,L=P.textStrokeWidth;let z=E;l?(x=R,E==="inner"&&(y===C-1?z=this.options.reverse?"left":"right":y===0?z=this.options.reverse?"right":"left":z="center"),i==="top"?c==="near"||g!==0?$=-w*S+S/2:c==="center"?$=-M.highest.height/2-V*S+S:$=-M.highest.height+S/2:c==="near"||g!==0?$=S/2:c==="center"?$=M.highest.height/2-V*S:$=M.highest.height-w*S,f&&($*=-1),g!==0&&!P.showLabelBackdrop&&(x+=S/2*Math.sin(g))):(N=R,$=(1-w)*S/2);let W;if(P.showLabelBackdrop){const X=Ce(P.backdropPadding),K=M.heights[y],te=M.widths[y];let ae=$-X.top,pe=0-X.left;switch(B){case"middle":ae-=K/2;break;case"bottom":ae-=K;break}switch(E){case"center":pe-=te/2;break;case"right":pe-=te;break;case"inner":y===C-1?pe-=te:y>0&&(pe-=te/2);break}W={left:pe,top:ae,width:te+X.width,height:K+X.height,color:P.backdropColor}}b.push({label:_,font:k,textOffset:$,options:{rotation:g,color:F,strokeColor:A,strokeWidth:L,textAlign:z,textBaseline:B,translation:[x,N],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Le(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,l=this._getLabelSizes(),a=e+s,d=l.widest.width;let c,u;return n==="left"?i?(u=this.right+s,o==="near"?c="left":o==="center"?(c="center",u+=d/2):(c="right",u+=d)):(u=this.right-a,o==="near"?c="right":o==="center"?(c="center",u-=d/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,o==="near"?c="right":o==="center"?(c="center",u-=d/2):(c="left",u-=d)):(u=this.left+a,o==="near"?c="left":o==="center"?(c="center",u+=d/2):(c="right",u=this.right)):c="right",{textAlign:c,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:l}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(o,i,s,l),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,l;const a=(d,c,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(d.x,d.y),o.lineTo(c.x,c.y),o.stroke(),o.restore())};if(n.display)for(s=0,l=i.length;s<l;++s){const d=i[s];n.drawOnChartArea&&a({x:d.x1,y:d.y1},{x:d.x2,y:d.y2},d),n.drawTicks&&a({x:d.tx1,y:d.ty1},{x:d.tx2,y:d.ty2},{color:d.tickColor,width:d.tickWidth,borderDash:d.tickBorderDash,borderDashOffset:d.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:o,grid:i}}=this,s=o.setContext(this.getContext()),l=o.display?s.width:0;if(!l)return;const a=i.setContext(this.getContext(0)).lineWidth,d=this._borderValue;let c,u,f,h;this.isHorizontal()?(c=Ot(e,this.left,l)-l/2,u=Ot(e,this.right,a)+a/2,f=h=d):(f=Ot(e,this.top,l)-l/2,h=Ot(e,this.bottom,a)+a/2,c=u=d),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,i=this._computeLabelArea();i&&yo(o,i);const s=this.getLabelItems(e);for(const l of s){const a=l.options,d=l.font,c=l.label,u=l.textOffset;It(o,c,0,u,d,a)}i&&$o(o)}drawTitle(){const{ctx:e,options:{position:n,title:o,reverse:i}}=this;if(!o.display)return;const s=ge(o.font),l=Ce(o.padding),a=o.align;let d=s.lineHeight/2;n==="bottom"||n==="center"||Z(n)?(d+=l.bottom,re(o.text)&&(d+=s.lineHeight*(o.text.length-1))):d+=l.top;const{titleX:c,titleY:u,maxWidth:f,rotation:h}=bp(this,d,n,a);It(e,o.text,0,0,s,{color:o.color,maxWidth:f,rotation:h,textAlign:gp(a,n,i),textBaseline:"middle",translation:[c,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=G(e.grid&&e.grid.z,-1),i=G(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Wt.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,l;for(s=0,l=n.length;s<l;++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 ge(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class No{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;wp(n)&&(o=this.register(n));const i=this.items,s=e.id,l=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,yp(e,l,o),this.override&&ue.override(e.id,e.overrides)),l}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 ue[i]&&(delete ue[i][o],this.override&&delete At[o])}}function yp(t,e,n){const o=_n(Object.create(null),[n?ue.get(n):{},ue.get(e),t.defaults]);ue.set(e,o),t.defaultRoutes&&$p(e,t.defaultRoutes),t.descriptors&&ue.describe(e,t.descriptors)}function $p(t,e){Object.keys(e).forEach(n=>{const o=n.split("."),i=o.pop(),s=[t].concat(o).join("."),l=e[n].split("."),a=l.pop(),d=l.join(".");ue.route(s,i,d,a)})}function wp(t){return"id"in t&&"defaults"in t}class _p{constructor(){this.controllers=new No(He,"datasets",!0),this.elements=new No(lt,"elements"),this.plugins=new No(Object,"plugins"),this.scales=new No(Wt,"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):ne(i,l=>{const a=o||this._getRegistryForType(l);this._exec(e,a,l)})})}_exec(e,n,o){const i=Ir(e);oe(o["before"+i],[],o),n[e](o),oe(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 qe=new _p;class kp{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),l=this._notify(s,e,n,o);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),l}_notify(e,n,o,i){i=i||{};for(const s of e){const l=s.plugin,a=l[o],d=[n,i,s.options];if(oe(a,d,l)===!1&&i.cancelable)return!1}return!0}invalidate(){Q(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=G(o.options&&o.options.plugins,{}),s=Cp(o);return i===!1&&!n?[]:Sp(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],o=this._cache,i=(s,l)=>s.filter(a=>!l.some(d=>a.plugin.id===d.plugin.id));this._notify(i(n,o),e,"stop"),this._notify(i(o,n),e,"start")}}function Cp(t){const e={},n=[],o=Object.keys(qe.plugins.items);for(let s=0;s<o.length;s++)n.push(qe.getPlugin(o[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const l=i[s];n.indexOf(l)===-1&&(n.push(l),e[l.id]=!0)}return{plugins:n,localIds:e}}function xp(t,e){return!e&&t===!1?null:t===!0?{}:t}function Sp(t,{plugins:e,localIds:n},o,i){const s=[],l=t.getContext();for(const a of e){const d=a.id,c=xp(o[d],i);c!==null&&s.push({plugin:a,options:vp(t.config,{plugin:a,local:n[d]},c,l)})}return s}function vp(t,{plugin:e,local:n},o,i){const s=t.pluginScopeKeys(e),l=t.getOptionScopes(o,s);return n&&e.defaults&&l.push(e.defaults),t.createResolver(l,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ai(t,e){const n=ue.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Dp(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Mp(t,e){return t===e?"_index_":"_value_"}function ba(t){if(t==="x"||t==="y"||t==="r")return t}function Vp(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function di(t,...e){if(ba(t))return t;for(const n of e){const o=n.axis||Vp(n.position)||t.length>1&&ba(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ya(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Bp(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 ya(t,"x",n[0])||ya(t,"y",n[0])}return{}}function Ep(t,e){const n=At[t.type]||{scales:{}},o=e.scales||{},i=ai(t.type,e),s=Object.create(null);return Object.keys(o).forEach(l=>{const a=o[l];if(!Z(a))return console.error(`Invalid scale configuration for scale: ${l}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const d=di(l,a,Bp(l,t),ue.scales[a.type]),c=Mp(d,i),u=n.scales||{};s[l]=kn(Object.create(null),[{axis:d},a,u[d],u[c]])}),t.data.datasets.forEach(l=>{const a=l.type||t.type,d=l.indexAxis||ai(a,e),u=(At[a]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Dp(f,d),m=l[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),kn(s[m],[{axis:h},o[m],u[f]])})}),Object.keys(s).forEach(l=>{const a=s[l];kn(a,[ue.scales[a.type],ue.scale])}),s}function $a(t){const e=t.options||(t.options={});e.plugins=G(e.plugins,{}),e.scales=Ep(t,e)}function wa(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Pp(t){return t=t||{},t.data=wa(t.data),$a(t),t}const _a=new Map,ka=new Set;function Fo(t,e){let n=_a.get(t);return n||(n=e(),_a.set(t,n),ka.add(n)),n}const Tn=(t,e,n)=>{const o=kt(e,n);o!==void 0&&t.add(o)};class Np{constructor(e){this._config=Pp(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=wa(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(),$a(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Fo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Fo(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Fo(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return Fo(`${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,l=this._cachedScopes(e,o),a=l.get(n);if(a)return a;const d=new Set;n.forEach(u=>{e&&(d.add(e),u.forEach(f=>Tn(d,e,f))),u.forEach(f=>Tn(d,i,f)),u.forEach(f=>Tn(d,At[s]||{},f)),u.forEach(f=>Tn(d,ue,f)),u.forEach(f=>Tn(d,Wr,f))});const c=Array.from(d);return c.length===0&&c.push(Object.create(null)),ka.has(n)&&l.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,At[n]||{},ue.datasets[n]||{},{type:n},ue,Wr]}resolveNamedOptions(e,n,o,i=[""]){const s={$shared:!0},{resolver:l,subPrefixes:a}=Ca(this._resolverCache,e,i);let d=l;if(Rp(l,n)){s.$shared=!1,o=Ct(o)?o():o;const c=this.createResolver(e,o,a);d=en(l,o,c)}for(const c of n)s[c]=d[c];return s}createResolver(e,n,o=[""],i){const{resolver:s}=Ca(this._resolverCache,e,o);return Z(n)?en(s,n,void 0,i):s}}function Ca(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:Xr(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},o.set(i,s)),s}const Fp=t=>Z(t)&&Object.getOwnPropertyNames(t).some(e=>Ct(t[e]));function Rp(t,e){const{isScriptable:n,isIndexable:o}=Sl(t);for(const i of e){const s=n(i),l=o(i),a=(l||s)&&t[i];if(s&&(Ct(a)||Fp(a))||l&&re(a))return!0}return!1}var Ap="4.4.2";const Op=["top","bottom","left","right","chartArea"];function xa(t,e){return t==="top"||t==="bottom"||Op.indexOf(t)===-1&&e==="x"}function Sa(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function va(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),oe(n&&n.onComplete,[t],e)}function Ip(t){const e=t.chart,n=e.options.animation;oe(n&&n.onProgress,[t],e)}function Da(t){return Jr()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ro={},Ma=t=>{const e=Da(t);return Object.values(Ro).filter(n=>n.canvas===e).pop()};function Tp(t,e,n){const o=Object.keys(t);for(const i of o){const s=+i;if(s>=e){const l=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=l)}}}function zp(t,e,n,o){return!n||t.type==="mouseout"?null:o?e:t}function Ao(t,e,n){return t.options.clip?t[n]:e[n]}function Lp(t,e){const{xScale:n,yScale:o}=t;return n&&o?{left:Ao(n,e,"left"),right:Ao(n,e,"right"),top:Ao(o,e,"top"),bottom:Ao(o,e,"bottom")}:e}class Ye{static register(...e){qe.add(...e),Va()}static unregister(...e){qe.remove(...e),Va()}constructor(e,n){const o=this.config=new Np(n),i=Da(e),s=Ma(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 l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||rp(i)),this.platform.updateConfig(o);const a=this.platform.acquireContext(i,l.aspectRatio),d=a&&a.canvas,c=d&&d.height,u=d&&d.width;if(this.id=Yf(),this.ctx=a,this.canvas=d,this.width=u,this.height=c,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new kp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ih(f=>this.update(f),l.resizeDelay||0),this._dataChanges=[],Ro[this.id]=this,!a||!d){console.error("Failed to create chart: can't acquire context from the given item");return}st.listen(this,"complete",va),st.listen(this,"progress",Ip),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:i,_aspectRatio:s}=this;return Q(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 qe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return kl(this.canvas,this.ctx),this}stop(){return st.stop(this),this}resize(e,n){st.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,l=this.platform.getMaximumSize(i,e,n,s),a=o.devicePixelRatio||this.platform.getDevicePixelRatio(),d=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Nl(this,a,!0)&&(this.notifyPlugins("resize",{size:l}),oe(o.onResize,[this,l],this),this.attached&&this._doResize(d)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ne(n,(o,i)=>{o.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,o=this.scales,i=Object.keys(o).reduce((l,a)=>(l[a]=!1,l),{});let s=[];n&&(s=s.concat(Object.keys(n).map(l=>{const a=n[l],d=di(l,a),c=d==="r",u=d==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),ne(s,l=>{const a=l.options,d=a.id,c=di(d,a),u=G(a.type,l.dtype);(a.position===void 0||xa(a.position,c)!==xa(l.dposition))&&(a.position=l.dposition),i[d]=!0;let f=null;if(d in o&&o[d].type===u)f=o[d];else{const h=qe.getScale(u);f=new h({id:d,type:u,ctx:this.ctx,chart:this}),o[f.id]=f}f.init(a,e)}),ne(i,(l,a)=>{l||delete o[a]}),ne(o,l=>{xe.configure(this,l,l.options),xe.addBox(this,l)})}_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(Sa("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 l=this.getDatasetMeta(o);const a=s.type||this.config.type;if(l.type&&l.type!==a&&(this._destroyDatasetMeta(o),l=this.getDatasetMeta(o)),l.type=a,l.indexAxis=s.indexAxis||ai(a,this.options),l.order=s.order||0,l.index=o,l.label=""+s.label,l.visible=this.isDatasetVisible(o),l.controller)l.controller.updateIndex(o),l.controller.linkScales();else{const d=qe.getController(a),{datasetElementType:c,dataElementType:u}=ue.datasets[a];Object.assign(d,{dataElementType:qe.getElement(u),datasetElementType:c&&qe.getElement(c)}),l.controller=new d(this,o),e.push(l.controller)}}return this._updateMetasets(),e}_resetElements(){ne(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 l=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),h=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),l=Math.max(+f.getMaxOverflow(),l)}l=this._minPadding=o.layout.autoPadding?l:0,this._updateLayout(l),i||ne(s,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Sa("z","_idx"));const{_active:a,_lastEvent:d}=this;d?this._eventHandler(d,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ne(this.scales,e=>{xe.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!rl(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 l=o==="_removeElements"?-s:s;Tp(e,i,l)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,o=s=>new Set(e.filter(l=>l[0]===s).map((l,a)=>a+","+l.splice(1).join(","))),i=o(0);for(let s=1;s<n;s++)if(!rl(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;xe.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],ne(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,Ct(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&&(st.has(this)?this.attached&&!st.running(this)&&st.start(this):(this.draw(),va({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 l=n[i];(!e||l.visible)&&o.push(l)}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=Lp(e,this.chartArea),l={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(i&&yo(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&&$o(n),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(e){return it(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,i){const s=Om.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=St(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),l=s.controller._resolveAnimations(void 0,i);Cn(n)?(s.data[n].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),l.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(),st.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(),kl(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ro[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,l)=>{n.addEventListener(this,s,l),e[s]=l},i=(s,l,a)=>{s.offsetX=l,s.offsetY=a,this._eventHandler(s)};ne(this.options.events,s=>o(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,o=(d,c)=>{n.addEventListener(this,d,c),e[d]=c},i=(d,c)=>{e[d]&&(n.removeEventListener(this,d,c),delete e[d])},s=(d,c)=>{this.canvas&&this.resize(d,c)};let l;const a=()=>{i("attach",a),this.attached=!0,this.resize(),o("resize",s),o("detach",l)};l=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),o("attach",a)},n.isAttached(this.canvas)?a():l()}unbindEvents(){ne(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},ne(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,l,a,d;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,d=e.length;a<d;++a){l=e[a];const c=l&&this.getDatasetMeta(l.datasetIndex).controller;c&&c[i+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],o=e.map(({datasetIndex:s,index:l})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[l],index:l}});!fo(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=(d,c)=>d.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),l=s(n,e),a=o?e:s(e,n);l.length&&this.updateHoverStyle(l,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=l=>(l.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,l=n,a=this._getActiveElements(e,i,o,l),d=Xf(e),c=zp(e,this._lastEvent,o,d);o&&(this._lastEvent=null,oe(s.onHover,[e,a,this],this),d&&oe(s.onClick,[e,a,this],this));const u=!fo(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,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)}}T(Ye,"defaults",ue),T(Ye,"instances",Ro),T(Ye,"overrides",At),T(Ye,"registry",qe),T(Ye,"version",Ap),T(Ye,"getChart",Ma);function Va(){return ne(Ye.instances,t=>t._plugins.invalidate())}function Hp(t,e,n){const{startAngle:o,pixelMargin:i,x:s,y:l,outerRadius:a,innerRadius:d}=e;let c=i/a;t.beginPath(),t.arc(s,l,a,o-c,n+c),d>i?(c=i/d,t.arc(s,l,d,n+c,o-c,!0)):t.arc(s,l,i,n+me,o-me),t.closePath(),t.clip()}function Yp(t){return qr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function jp(t,e,n,o){const i=Yp(t.options.borderRadius),s=(n-e)/2,l=Math.min(s,o*e/2),a=d=>{const c=(n-Math.min(s,d))*o/2;return $e(d,0,Math.min(s,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:$e(i.innerStart,0,l),innerEnd:$e(i.innerEnd,0,l)}}function on(t,e,n,o){return{x:n+t*Math.cos(e),y:o+t*Math.sin(e)}}function Oo(t,e,n,o,i,s){const{x:l,y:a,startAngle:d,pixelMargin:c,innerRadius:u}=e,f=Math.max(e.outerRadius+o+n-c,0),h=u>0?u+o+n+c:0;let m=0;const p=i-d;if(o){const P=u>0?u-o:0,V=f>0?f-o:0,F=(P+V)/2,A=F!==0?p*F/(F+o):p;m=(p-A)/2}const g=Math.max(.001,p*f-n/ie)/f,b=(p-g)/2,y=d+b+m,C=i-b-m,{outerStart:v,outerEnd:_,innerStart:x,innerEnd:N}=jp(e,h,f,C-y),E=f-v,R=f-_,k=y+v/E,S=C-_/R,w=h+x,$=h+N,B=y+x/w,M=C-N/$;if(t.beginPath(),s){const P=(k+S)/2;if(t.arc(l,a,f,k,P),t.arc(l,a,f,P,S),_>0){const L=on(R,S,l,a);t.arc(L.x,L.y,_,S,C+me)}const V=on($,C,l,a);if(t.lineTo(V.x,V.y),N>0){const L=on($,M,l,a);t.arc(L.x,L.y,N,C+me,M+Math.PI)}const F=(C-N/h+(y+x/h))/2;if(t.arc(l,a,h,C-N/h,F,!0),t.arc(l,a,h,F,y+x/h,!0),x>0){const L=on(w,B,l,a);t.arc(L.x,L.y,x,B+Math.PI,y-me)}const A=on(E,y,l,a);if(t.lineTo(A.x,A.y),v>0){const L=on(E,k,l,a);t.arc(L.x,L.y,v,y-me,k)}}else{t.moveTo(l,a);const P=Math.cos(k)*f+l,V=Math.sin(k)*f+a;t.lineTo(P,V);const F=Math.cos(S)*f+l,A=Math.sin(S)*f+a;t.lineTo(F,A)}t.closePath()}function Wp(t,e,n,o,i){const{fullCircles:s,startAngle:l,circumference:a}=e;let d=e.endAngle;if(s){Oo(t,e,n,o,d,i);for(let c=0;c<s;++c)t.fill();isNaN(a)||(d=l+(a%se||se))}return Oo(t,e,n,o,d,i),t.fill(),d}function Up(t,e,n,o,i){const{fullCircles:s,startAngle:l,circumference:a,options:d}=e,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=d,m=d.borderAlign==="inner";if(!c)return;t.setLineDash(f||[]),t.lineDashOffset=h,m?(t.lineWidth=c*2,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let p=e.endAngle;if(s){Oo(t,e,n,o,p,i);for(let g=0;g<s;++g)t.stroke();isNaN(a)||(p=l+(a%se||se))}m&&Hp(t,e,p),s||(Oo(t,e,n,o,p,i),t.stroke())}class zn extends lt{constructor(n){super();T(this,"circumference");T(this,"endAngle");T(this,"fullCircles");T(this,"innerRadius");T(this,"outerRadius");T(this,"pixelMargin");T(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:l,distance:a}=dl(s,{x:n,y:o}),{startAngle:d,endAngle:c,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),m=(this.options.spacing+this.options.borderWidth)/2,g=G(h,c-d)>=se||Sn(l,d,c),b=ot(a,u+m,f+m);return g&&b}getCenterPoint(n){const{x:o,y:i,startAngle:s,endAngle:l,innerRadius:a,outerRadius:d}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(s+l)/2,h=(a+d+u+c)/2;return{x:o+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:o,circumference:i}=this,s=(o.offset||0)/4,l=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=i>se?Math.floor(i/se):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const d=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(d)*s,Math.sin(d)*s);const c=1-Math.sin(Math.min(ie,i||0)),u=s*c;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,Wp(n,this,u,l,a),Up(n,this,u,l,a),n.restore()}}T(zn,"id","arc"),T(zn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),T(zn,"defaultRoutes",{backgroundColor:"backgroundColor"}),T(zn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Ba(t,e,n=e){t.lineCap=G(n.borderCapStyle,e.borderCapStyle),t.setLineDash(G(n.borderDash,e.borderDash)),t.lineDashOffset=G(n.borderDashOffset,e.borderDashOffset),t.lineJoin=G(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=G(n.borderWidth,e.borderWidth),t.strokeStyle=G(n.borderColor,e.borderColor)}function Gp(t,e,n){t.lineTo(n.x,n.y)}function qp(t){return t.stepped?bh:t.tension||t.cubicInterpolationMode==="monotone"?yh:Gp}function Ea(t,e,n={}){const o=t.length,{start:i=0,end:s=o-1}=n,{start:l,end:a}=e,d=Math.max(i,l),c=Math.min(s,a),u=i<l&&s<l||i>a&&s>a;return{count:o,start:d,loop:e.loop,ilen:c<d&&!u?o+c-d:c-d}}function Xp(t,e,n,o){const{points:i,options:s}=e,{count:l,start:a,loop:d,ilen:c}=Ea(i,n,o),u=qp(s);let{move:f=!0,reverse:h}=o||{},m,p,g;for(m=0;m<=c;++m)p=i[(a+(h?c-m:m))%l],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,g,p,h,s.stepped),g=p);return d&&(p=i[(a+(h?c:0))%l],u(t,g,p,h,s.stepped)),!!d}function Kp(t,e,n,o){const i=e.points,{count:s,start:l,ilen:a}=Ea(i,n,o),{move:d=!0,reverse:c}=o||{};let u=0,f=0,h,m,p,g,b,y;const C=_=>(l+(c?a-_:_))%s,v=()=>{g!==b&&(t.lineTo(u,b),t.lineTo(u,g),t.lineTo(u,y))};for(d&&(m=i[C(0)],t.moveTo(m.x,m.y)),h=0;h<=a;++h){if(m=i[C(h)],m.skip)continue;const _=m.x,x=m.y,N=_|0;N===p?(x<g?g=x:x>b&&(b=x),u=(f*u+_)/++f):(v(),t.lineTo(_,x),p=N,f=0,g=b=x),y=x}v()}function ci(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Kp:Xp}function Zp(t){return t.stepped?Kh:t.tension||t.cubicInterpolationMode==="monotone"?Zh:Ht}function Jp(t,e,n,o){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,o)&&i.closePath()),Ba(t,e.options),t.stroke(i)}function Qp(t,e,n,o){const{segments:i,options:s}=e,l=ci(e);for(const a of i)Ba(t,s,a.style),t.beginPath(),l(t,e,a,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const e0=typeof Path2D=="function";function t0(t,e,n,o){e0&&!e.options.segment?Jp(t,e,n,o):Qp(t,e,n,o)}class vt extends lt{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;Hh(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=om(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,l=zl(this,{property:n,start:i,end:i});if(!l.length)return;const a=[],d=Zp(o);let c,u;for(c=0,u=l.length;c<u;++c){const{start:f,end:h}=l[c],m=s[f],p=s[h];if(m===p){a.push(m);continue}const g=Math.abs((i-m[n])/(p[n]-m[n])),b=d(m,p,g,o.stepped);b[n]=e[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(e,n,o){return ci(this)(e,this,n,o)}path(e,n,o){const i=this.segments,s=ci(this);let l=this._loop;n=n||0,o=o||this.points.length-n;for(const a of i)l&=s(e,this,a,{start:n,end:n+o-1});return!!l}draw(e,n,o,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),t0(e,this,o,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}T(vt,"id","line"),T(vt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),T(vt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),T(vt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Pa(t,e,n,o){const i=t.options,{[n]:s}=t.getProps([n],o);return Math.abs(e-s)<i.radius+i.hitRadius}class Io extends lt{constructor(n){super();T(this,"parsed");T(this,"skip");T(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:l,y:a}=this.getProps(["x","y"],i);return Math.pow(n-l,2)+Math.pow(o-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,o){return Pa(this,n,"x",o)}inYRange(n,o){return Pa(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||!it(this,o,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Gr(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}T(Io,"id","point"),T(Io,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),T(Io,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Na(t,e){const{x:n,y:o,base:i,width:s,height:l}=t.getProps(["x","y","base","width","height"],e);let a,d,c,u,f;return t.horizontal?(f=l/2,a=Math.min(n,i),d=Math.max(n,i),c=o-f,u=o+f):(f=s/2,a=n-f,d=n+f,c=Math.min(o,i),u=Math.max(o,i)),{left:a,top:c,right:d,bottom:u}}function Dt(t,e,n,o){return t?0:$e(e,n,o)}function n0(t,e,n){const o=t.options.borderWidth,i=t.borderSkipped,s=xl(o);return{t:Dt(i.top,s.top,0,n),r:Dt(i.right,s.right,0,e),b:Dt(i.bottom,s.bottom,0,n),l:Dt(i.left,s.left,0,e)}}function o0(t,e,n){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,s=Tt(i),l=Math.min(e,n),a=t.borderSkipped,d=o||Z(i);return{topLeft:Dt(!d||a.top||a.left,s.topLeft,0,l),topRight:Dt(!d||a.top||a.right,s.topRight,0,l),bottomLeft:Dt(!d||a.bottom||a.left,s.bottomLeft,0,l),bottomRight:Dt(!d||a.bottom||a.right,s.bottomRight,0,l)}}function r0(t){const e=Na(t),n=e.right-e.left,o=e.bottom-e.top,i=n0(t,n/2,o/2),s=o0(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 ui(t,e,n,o){const i=e===null,s=n===null,a=t&&!(i&&s)&&Na(t,o);return a&&(i||ot(e,a.left,a.right))&&(s||ot(n,a.top,a.bottom))}function i0(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function s0(t,e){t.rect(e.x,e.y,e.w,e.h)}function fi(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,l=(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+l,radius:t.radius}}class To extends lt{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:l}=r0(this),a=i0(l.radius)?Vn:s0;e.save(),(l.w!==s.w||l.h!==s.h)&&(e.beginPath(),a(e,fi(l,n,s)),e.clip(),a(e,fi(s,-n,l)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),a(e,fi(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,o){return ui(this,e,n,o)}inXRange(e,n){return ui(this,e,null,n)}inYRange(e,n){return ui(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}}T(To,"id","bar"),T(To,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),T(To,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var l0=Object.freeze({__proto__:null,ArcElement:zn,BarElement:To,LineElement:vt,PointElement:Io});const hi=["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)"],Fa=hi.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ra(t){return hi[t%hi.length]}function Aa(t){return Fa[t%Fa.length]}function a0(t,e){return t.borderColor=Ra(e),t.backgroundColor=Aa(e),++e}function d0(t,e){return t.backgroundColor=t.data.map(()=>Ra(e++)),e}function c0(t,e){return t.backgroundColor=t.data.map(()=>Aa(e++)),e}function u0(t){let e=0;return(n,o)=>{const i=t.getDatasetMeta(o).controller;i instanceof Yt?e=d0(n,e):i instanceof Pn?e=c0(n,e):i&&(e=a0(n,e))}}function Oa(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function f0(t){return t&&(t.borderColor||t.backgroundColor)}var h0={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&&(Oa(o)||f0(i)||s&&Oa(s)))return;const l=u0(t);o.forEach(l)}};function m0(t,e,n,o,i){const s=i.samples||o;if(s>=n)return t.slice(e,e+n);const l=[],a=(n-2)/(s-2);let d=0;const c=e+n-1;let u=e,f,h,m,p,g;for(l[d++]=t[u],f=0;f<s-2;f++){let b=0,y=0,C;const v=Math.floor((f+1)*a)+1+e,_=Math.min(Math.floor((f+2)*a)+1,n)+e,x=_-v;for(C=v;C<_;C++)b+=t[C].x,y+=t[C].y;b/=x,y/=x;const N=Math.floor(f*a)+1+e,E=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:R,y:k}=t[u];for(m=p=-1,C=N;C<E;C++)p=.5*Math.abs((R-b)*(t[C].y-k)-(R-t[C].x)*(y-k)),p>m&&(m=p,h=t[C],g=C);l[d++]=h,u=g}return l[d++]=t[c],l}function p0(t,e,n,o){let i=0,s=0,l,a,d,c,u,f,h,m,p,g;const b=[],y=e+n-1,C=t[e].x,_=t[y].x-C;for(l=e;l<e+n;++l){a=t[l],d=(a.x-C)/_*o,c=a.y;const x=d|0;if(x===u)c<p?(p=c,f=l):c>g&&(g=c,h=l),i=(s*i+a.x)/++s;else{const N=l-1;if(!Q(f)&&!Q(h)){const E=Math.min(f,h),R=Math.max(f,h);E!==m&&E!==N&&b.push({...t[E],x:i}),R!==m&&R!==N&&b.push({...t[R],x:i})}l>0&&N!==m&&b.push(t[N]),b.push(a),u=x,s=0,p=g=c,f=h=m=l}}return b}function Ia(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 Ta(t){t.data.datasets.forEach(e=>{Ia(e)})}function g0(t,e){const n=e.length;let o=0,i;const{iScale:s}=t,{min:l,max:a,minDefined:d,maxDefined:c}=s.getUserBounds();return d&&(o=$e(rt(e,s.axis,l).lo,0,n-1)),c?i=$e(rt(e,s.axis,a).hi+1,o,n)-o:i=n-o,{start:o,count:i}}var b0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Ta(t);return}const o=t.width;t.data.datasets.forEach((i,s)=>{const{_data:l,indexAxis:a}=i,d=t.getDatasetMeta(s),c=l||i.data;if(Bn([a,t.options.indexAxis])==="y"||!d.controller.supportsDecimation)return;const u=t.scales[d.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:h}=g0(d,c);const m=n.threshold||4*o;if(h<=m){Ia(i);return}Q(l)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=m0(c,f,h,o,n);break;case"min-max":p=p0(c,f,h,o);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=p})},destroy(t){Ta(t)}};function y0(t,e,n){const o=t.segments,i=t.points,s=e.points,l=[];for(const a of o){let{start:d,end:c}=a;c=pi(d,c,i);const u=mi(n,i[d],i[c],a.loop);if(!e.segments){l.push({source:a,target:u,start:i[d],end:i[c]});continue}const f=zl(e,u);for(const h of f){const m=mi(n,s[h.start],s[h.end],h.loop),p=Tl(a,i,m);for(const g of p)l.push({source:g,target:h,start:{[n]:za(u,m,"start",Math.max)},end:{[n]:za(u,m,"end",Math.min)}})}}return l}function mi(t,e,n,o){if(o)return;let i=e[t],s=n[t];return t==="angle"&&(i=Ne(i),s=Ne(s)),{property:t,start:i,end:s}}function $0(t,e){const{x:n=null,y:o=null}=t||{},i=e.points,s=[];return e.segments.forEach(({start:l,end:a})=>{a=pi(l,a,i);const d=i[l],c=i[a];o!==null?(s.push({x:d.x,y:o}),s.push({x:c.x,y:o})):n!==null&&(s.push({x:n,y:d.y}),s.push({x:n,y:c.y}))}),s}function pi(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function za(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function La(t,e){let n=[],o=!1;return re(t)?(o=!0,n=t):n=$0(t,e),n.length?new vt({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function Ha(t){return t&&t.fill!==!1}function w0(t,e,n){let i=t[e].fill;const s=[e];let l;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!ce(i))return i;if(l=t[i],!l)return!1;if(l.visible)return i;s.push(i),i=l.fill}return!1}function _0(t,e,n){const o=S0(t);if(Z(o))return isNaN(o.value)?!1:o;let i=parseFloat(o);return ce(i)&&Math.floor(i)===i?k0(o[0],e,i,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function k0(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function C0(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 x0(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 S0(t){const e=t.options,n=e.fill;let o=G(n&&n.target,n);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function v0(t){const{scale:e,index:n,line:o}=t,i=[],s=o.segments,l=o.points,a=D0(e,n);a.push(La({x:null,y:e.bottom},o));for(let d=0;d<s.length;d++){const c=s[d];for(let u=c.start;u<=c.end;u++)M0(i,l[u],a)}return new vt({points:i,options:{}})}function D0(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 M0(t,e,n){const o=[];for(let i=0;i<n.length;i++){const s=n[i],{first:l,last:a,point:d}=V0(s,e,"x");if(!(!d||l&&a)){if(l)o.unshift(d);else if(t.push(d),!a)break}}t.push(...o)}function V0(t,e,n){const o=t.interpolate(e,n);if(!o)return{};const i=o[n],s=t.segments,l=t.points;let a=!1,d=!1;for(let c=0;c<s.length;c++){const u=s[c],f=l[u.start][n],h=l[u.end][n];if(ot(i,f,h)){a=i===f,d=i===h;break}}return{first:a,last:d,point:o}}class Ya{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,o){const{x:i,y:s,radius:l}=this;return n=n||{start:0,end:se},e.arc(i,s,l,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 B0(t){const{chart:e,fill:n,line:o}=t;if(ce(n))return E0(e,n);if(n==="stack")return v0(t);if(n==="shape")return!0;const i=P0(t);return i instanceof Ya?i:La(i,o)}function E0(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function P0(t){return(t.scale||{}).getPointPositionForValue?F0(t):N0(t)}function N0(t){const{scale:e={},fill:n}=t,o=C0(n,e);if(ce(o)){const i=e.isHorizontal();return{x:i?o:null,y:i?null:o}}return null}function F0(t){const{scale:e,fill:n}=t,o=e.options,i=e.getLabels().length,s=o.reverse?e.max:e.min,l=x0(n,e,s),a=[];if(o.grid.circular){const d=e.getPointPositionForValue(0,s);return new Ya({x:d.x,y:d.y,radius:e.getDistanceFromCenterForValue(l)})}for(let d=0;d<i;++d)a.push(e.getPointPositionForValue(d,l));return a}function gi(t,e,n){const o=B0(e),{line:i,scale:s,axis:l}=e,a=i.options,d=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=d||{};o&&i.points.length&&(yo(t,n),R0(t,{line:i,target:o,above:u,below:f,area:n,scale:s,axis:l}),$o(t))}function R0(t,e){const{line:n,target:o,above:i,below:s,area:l,scale:a}=e,d=n._loop?"angle":e.axis;t.save(),d==="x"&&s!==i&&(ja(t,o,l.top),Wa(t,{line:n,target:o,color:i,scale:a,property:d}),t.restore(),t.save(),ja(t,o,l.bottom)),Wa(t,{line:n,target:o,color:s,scale:a,property:d}),t.restore()}function ja(t,e,n){const{segments:o,points:i}=e;let s=!0,l=!1;t.beginPath();for(const a of o){const{start:d,end:c}=a,u=i[d],f=i[pi(d,c,i)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),l=!!e.pathSegment(t,a,{move:l}),l?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Wa(t,e){const{line:n,target:o,property:i,color:s,scale:l}=e,a=y0(n,o,i);for(const{source:d,target:c,start:u,end:f}of a){const{style:{backgroundColor:h=s}={}}=d,m=o!==!0;t.save(),t.fillStyle=h,A0(t,l,m&&mi(i,u,f)),t.beginPath();const p=!!n.pathSegment(t,d);let g;if(m){p?t.closePath():Ua(t,o,f,i);const b=!!o.pathSegment(t,c,{move:p,reverse:!0});g=p&&b,g||Ua(t,o,u,i)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function A0(t,e,n){const{top:o,bottom:i}=e.chart.chartArea,{property:s,start:l,end:a}=n||{};s==="x"&&(t.beginPath(),t.rect(l,o,a-l,i-o),t.clip())}function Ua(t,e,n,o){const i=e.interpolate(n,o);i&&t.lineTo(i.x,i.y)}var O0={id:"filler",afterDatasetsUpdate(t,e,n){const o=(t.data.datasets||[]).length,i=[];let s,l,a,d;for(l=0;l<o;++l)s=t.getDatasetMeta(l),a=s.dataset,d=null,a&&a.options&&a instanceof vt&&(d={visible:t.isDatasetVisible(l),index:l,fill:_0(a,l,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=d,i.push(d);for(l=0;l<o;++l)d=i[l],!(!d||d.fill===!1)&&(d.fill=w0(i,l,n.propagate))},beforeDraw(t,e,n){const o=n.drawTime==="beforeDraw",i=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let l=i.length-1;l>=0;--l){const a=i[l].$filler;a&&(a.line.updateControlPoints(s,a.axis),o&&a.fill&&gi(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;Ha(s)&&gi(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!Ha(o)||n.drawTime!=="beforeDatasetDraw"||gi(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ga=(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)}},I0=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class qa extends lt{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=oe(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=ge(o.font),s=i.size,l=this._computeTitleHeight(),{boxWidth:a,itemHeight:d}=Ga(o,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(l,s,a,d)+10):(u=this.maxHeight,c=this._fitCols(l,i,a,d)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,o,i){const{ctx:s,maxWidth:l,options:{labels:{padding:a}}}=this,d=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let f=e;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const b=o+n/2+s.measureText(p.text).width;(g===0||c[c.length-1]+b+2*a>l)&&(f+=u,c[c.length-(g>0?0:1)]=0,m+=u,h++),d[g]={left:0,top:m,row:h,width:b,height:i},c[c.length-1]+=b+a}),f}_fitCols(e,n,o,i){const{ctx:s,maxHeight:l,options:{labels:{padding:a}}}=this,d=this.legendHitBoxes=[],c=this.columnSizes=[],u=l-e;let f=a,h=0,m=0,p=0,g=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:C,itemHeight:v}=T0(o,n,s,b,i);y>0&&m+v+2*a>u&&(f+=h+a,c.push({width:h,height:m}),p+=h+a,g++,h=m=0),d[y]={left:p,top:m,col:g,width:C,height:v},h=Math.max(h,C),m+=v+a}),f+=h,c.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:i},rtl:s}}=this,l=nn(s,this.left,this.width);if(this.isHorizontal()){let a=0,d=ke(o,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,d=ke(o,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+e+i,c.left=l.leftForLtr(l.x(d),c.width),d+=c.width+i}else{let a=0,d=ke(o,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,d=ke(o,this.top+e+i,this.bottom-this.columnSizes[a].height)),c.top=d,c.left+=this.left+i,c.left=l.leftForLtr(l.x(c.left),c.width),d+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;yo(e,this),this._draw(),$o(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:o,ctx:i}=this,{align:s,labels:l}=e,a=ue.color,d=nn(e.rtl,this.left,this.width),c=ge(l.font),{padding:u}=l,f=c.size,h=f/2;let m;this.drawTitle(),i.textAlign=d.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:b}=Ga(l,f),y=function(N,E,R){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;i.save();const k=G(R.lineWidth,1);if(i.fillStyle=G(R.fillStyle,a),i.lineCap=G(R.lineCap,"butt"),i.lineDashOffset=G(R.lineDashOffset,0),i.lineJoin=G(R.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=G(R.strokeStyle,a),i.setLineDash(G(R.lineDash,[])),l.usePointStyle){const S={radius:g*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:k},w=d.xPlus(N,p/2),$=E+h;Cl(i,S,w,$,l.pointStyleWidth&&p)}else{const S=E+Math.max((f-g)/2,0),w=d.leftForLtr(N,p),$=Tt(R.borderRadius);i.beginPath(),Object.values($).some(B=>B!==0)?Vn(i,{x:w,y:S,w:p,h:g,radius:$}):i.rect(w,S,p,g),i.fill(),k!==0&&i.stroke()}i.restore()},C=function(N,E,R){It(i,R.text,N,E+b/2,c,{strikethrough:R.hidden,textAlign:d.textAlign(R.textAlign)})},v=this.isHorizontal(),_=this._computeTitleHeight();v?m={x:ke(s,this.left+u,this.right-o[0]),y:this.top+u+_,line:0}:m={x:this.left+u,y:ke(s,this.top+_+u,this.bottom-n[0].height),line:0},Rl(this.ctx,e.textDirection);const x=b+u;this.legendItems.forEach((N,E)=>{i.strokeStyle=N.fontColor,i.fillStyle=N.fontColor;const R=i.measureText(N.text).width,k=d.textAlign(N.textAlign||(N.textAlign=l.textAlign)),S=p+h+R;let w=m.x,$=m.y;d.setWidth(this.width),v?E>0&&w+S+u>this.right&&($=m.y+=x,m.line++,w=m.x=ke(s,this.left+u,this.right-o[m.line])):E>0&&$+x>this.bottom&&(w=m.x=w+n[m.line].width+u,m.line++,$=m.y=ke(s,this.top+_+u,this.bottom-n[m.line].height));const B=d.x(w);if(y(B,$,N),w=sh(k,w+p+h,v?w+S:this.right,e.rtl),C(d.x(w),$,N),v)m.x+=S+u;else if(typeof N.text!="string"){const M=c.lineHeight;m.y+=Xa(N,M)+u}else m.y+=x}),Al(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=ge(n.font),i=Ce(n.padding);if(!n.display)return;const s=nn(e.rtl,this.left,this.width),l=this.ctx,a=n.position,d=o.size/2,c=i.top+d;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,f=ke(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);u=c+ke(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=ke(a,f,f+h);l.textAlign=s.textAlign(Hr(a)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=o.string,It(l,n.text,m,u,o)}_computeTitleHeight(){const e=this.options.title,n=ge(e.font),o=Ce(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,i,s;if(ot(e,this.left,this.right)&&ot(n,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(i=s[o],ot(e,i.left,i.left+i.width)&&ot(n,i.top,i.top+i.height))return this.legendItems[o]}return null}handleEvent(e){const n=this.options;if(!H0(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=I0(i,o);i&&!s&&oe(n.onLeave,[e,i,this],this),this._hoveredItem=o,o&&!s&&oe(n.onHover,[e,o,this],this)}else o&&oe(n.onClick,[e,o,this],this)}}function T0(t,e,n,o,i){const s=z0(o,t,e,n),l=L0(i,o,e.lineHeight);return{itemWidth:s,itemHeight:l}}function z0(t,e,n,o){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,l)=>s.length>l.length?s:l)),e+n.size/2+o.measureText(i).width}function L0(t,e,n){let o=t;return typeof e.text!="string"&&(o=Xa(e,n)),o}function Xa(t,e){const n=t.text?t.text.length:0;return e*n}function H0(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Y0={id:"legend",_element:qa,start(t,e,n){const o=t.legend=new qa({ctx:t.ctx,options:n,chart:t});xe.configure(t,o,n),xe.addBox(t,o)},stop(t){xe.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;xe.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:l,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(d=>{const c=d.controller.getStyle(n?0:void 0),u=Ce(c.borderWidth);return{text:e[d.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!d.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:o||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:l&&(a||c.borderRadius),datasetIndex:d.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 bi extends lt{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=re(o.text)?o.text.length:1;this._padding=Ce(o.padding);const s=i*ge(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:l}=this,a=l.align;let d=0,c,u,f;return this.isHorizontal()?(u=ke(a,o,s),f=n+e,c=s-o):(l.position==="left"?(u=o+e,f=ke(a,i,n),d=ie*-.5):(u=s-e,f=ke(a,n,i),d=ie*.5),c=i-n),{titleX:u,titleY:f,maxWidth:c,rotation:d}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const o=ge(n.font),s=o.lineHeight/2+this._padding.top,{titleX:l,titleY:a,maxWidth:d,rotation:c}=this._drawArgs(s);It(e,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:c,textAlign:Hr(n.align),textBaseline:"middle",translation:[l,a]})}}function j0(t,e){const n=new bi({ctx:t.ctx,options:e,chart:t});xe.configure(t,n,e),xe.addBox(t,n),t.titleBlock=n}var W0={id:"title",_element:bi,start(t,e,n){j0(t,n)},stop(t){const e=t.titleBlock;xe.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;xe.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 zo=new WeakMap;var U0={id:"subtitle",start(t,e,n){const o=new bi({ctx:t.ctx,options:n,chart:t});xe.configure(t,o,n),xe.addBox(t,o),zo.set(t,o)},stop(t){xe.removeBox(t,zo.get(t)),zo.delete(t)},beforeUpdate(t,e,n){const o=zo.get(t);xe.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 Ln={average(t){if(!t.length)return!1;let e,n,o=new Set,i=0,s=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const d=a.tooltipPosition();o.add(d.x),i+=d.y,++s}}return{x:[...o].reduce((a,d)=>a+d)/o.size,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,o=e.y,i=Number.POSITIVE_INFINITY,s,l,a;for(s=0,l=t.length;s<l;++s){const d=t[s].element;if(d&&d.hasValue()){const c=d.getCenterPoint(),u=zr(e,c);u<i&&(i=u,a=d)}}if(a){const d=a.tooltipPosition();n=d.x,o=d.y}return{x:n,y:o}}};function Xe(t,e){return e&&(re(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function at(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
25
25
  `)>-1?t.split(`
26
- `):t}function G0(t,e){const{element:n,datasetIndex:o,index:i}=e,s=t.getDatasetMeta(o).controller,{label:l,value:a}=s.getLabelAndValue(i);return{chart:t,label:l,parsed:s.getParsed(i),raw:t.data.datasets[o].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:o,element:n}}function Ka(t,e){const n=t.chart.ctx,{body:o,footer:i,title:s}=t,{boxWidth:l,boxHeight:a}=e,d=ge(e.bodyFont),c=ge(e.titleFont),u=ge(e.footerFont),f=s.length,h=i.length,m=o.length,p=Ce(e.padding);let g=p.height,b=0,y=o.reduce((w,_)=>w+_.before.length+_.lines.length+_.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const w=e.displayColors?Math.max(a,d.lineHeight):d.lineHeight;g+=m*w+(y-m)*d.lineHeight+(y-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let k=0;const M=function(w){b=Math.max(b,n.measureText(w).width+k)};return n.save(),n.font=c.string,te(t.title,M),n.font=d.string,te(t.beforeBody.concat(t.afterBody),M),k=e.displayColors?l+2+e.boxPadding:0,te(o,w=>{te(w.before,M),te(w.lines,M),te(w.after,M)}),k=0,n.font=u.string,te(t.footer,M),n.restore(),b+=p.width,{width:b,height:g}}function q0(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function X0(t,e,n,o){const{x:i,width:s}=o,l=n.caretSize+n.caretPadding;if(t==="left"&&i+s+l>e.width||t==="right"&&i-s-l<0)return!0}function K0(t,e,n,o){const{x:i,width:s}=n,{width:l,chartArea:{left:a,right:d}}=t;let c="center";return o==="center"?c=i<=(a+d)/2?"left":"right":i<=s/2?c="left":i>=l-s/2&&(c="right"),X0(c,t,e,n)&&(c="center"),c}function Za(t,e,n){const o=n.yAlign||e.yAlign||q0(t,n);return{xAlign:n.xAlign||e.xAlign||K0(t,e,n,o),yAlign:o}}function Z0(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function J0(t,e,n){let{y:o,height:i}=t;return e==="top"?o+=n:e==="bottom"?o-=i+n:o-=i/2,o}function Ja(t,e,n,o){const{caretSize:i,caretPadding:s,cornerRadius:l}=t,{xAlign:a,yAlign:d}=n,c=i+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Tt(l);let p=Z0(e,a);const g=J0(e,d,c);return d==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+i:a==="right"&&(p+=Math.max(f,m)+i),{x:$e(p,0,o.width-e.width),y:$e(g,0,o.height-e.height)}}function Lo(t,e,n){const o=Ce(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function Qa(t){return Xe([],at(t))}function Q0(t,e,n){return St(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function ed(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const td={beforeTitle:nt,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:nt,beforeBody:nt,beforeLabel:nt,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 Q(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:nt,afterBody:nt,beforeFooter:nt,footer:nt,afterFooter:nt};function Me(t,e,n,o){const i=t[e].call(n,o);return typeof i>"u"?td[e].call(n,o):i}class yi extends lt{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 jl(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Q0(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,i=Me(o,"beforeTitle",this,e),s=Me(o,"title",this,e),l=Me(o,"afterTitle",this,e);let a=[];return a=Xe(a,at(i)),a=Xe(a,at(s)),a=Xe(a,at(l)),a}getBeforeBody(e,n){return Qa(Me(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,i=[];return te(e,s=>{const l={before:[],lines:[],after:[]},a=ed(o,s);Xe(l.before,at(Me(a,"beforeLabel",this,s))),Xe(l.lines,Me(a,"label",this,s)),Xe(l.after,at(Me(a,"afterLabel",this,s))),i.push(l)}),i}getAfterBody(e,n){return Qa(Me(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,i=Me(o,"beforeFooter",this,e),s=Me(o,"footer",this,e),l=Me(o,"afterFooter",this,e);let a=[];return a=Xe(a,at(i)),a=Xe(a,at(s)),a=Xe(a,at(l)),a}_createItems(e){const n=this._active,o=this.chart.data,i=[],s=[],l=[];let a=[],d,c;for(d=0,c=n.length;d<c;++d)a.push(G0(this.chart,n[d]));return e.filter&&(a=a.filter((u,f,h)=>e.filter(u,f,h,o))),e.itemSort&&(a=a.sort((u,f)=>e.itemSort(u,f,o))),te(a,u=>{const f=ed(e.callbacks,u);i.push(Me(f,"labelColor",this,u)),s.push(Me(f,"labelPointStyle",this,u)),l.push(Me(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=a,a}update(e,n){const o=this.options.setContext(this.getContext()),i=this._active;let s,l=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Ln[o.position].call(this,i,this._eventPosition);l=this._createItems(o),this.title=this.getTitle(l,o),this.beforeBody=this.getBeforeBody(l,o),this.body=this.getBody(l,o),this.afterBody=this.getAfterBody(l,o),this.footer=this.getFooter(l,o);const d=this._size=Ka(this,o),c=Object.assign({},a,d),u=Za(this.chart,o,c),f=Ja(o,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:d.width,height:d.height,caretX:a.x,caretY:a.y}}this._tooltipItems=l,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:l,cornerRadius:a}=o,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Tt(a),{x:h,y:m}=e,{width:p,height:g}=n;let b,y,k,M,w,_;return s==="center"?(w=m+g/2,i==="left"?(b=h,y=b-l,M=w+l,_=w-l):(b=h+p,y=b+l,M=w-l,_=w+l),k=b):(i==="left"?y=h+Math.max(d,u)+l:i==="right"?y=h+p-Math.max(c,f)-l:y=this.caretX,s==="top"?(M=m,w=M-l,b=y-l,k=y+l):(M=m+g,w=M+l,b=y+l,k=y-l),_=M),{x1:b,x2:y,x3:k,y1:M,y2:w,y3:_}}drawTitle(e,n,o){const i=this.title,s=i.length;let l,a,d;if(s){const c=nn(o.rtl,this.x,this.width);for(e.x=Lo(this,o.titleAlign,o),n.textAlign=c.textAlign(o.titleAlign),n.textBaseline="middle",l=ge(o.titleFont),a=o.titleSpacing,n.fillStyle=o.titleColor,n.font=l.string,d=0;d<s;++d)n.fillText(i[d],c.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+a,d+1===s&&(e.y+=o.titleMarginBottom-a)}}_drawColorBox(e,n,o,i,s){const l=this.labelColors[o],a=this.labelPointStyles[o],{boxHeight:d,boxWidth:c}=s,u=ge(s.bodyFont),f=Lo(this,"left",s),h=i.x(f),m=d<u.lineHeight?(u.lineHeight-d)/2:0,p=n.y+m;if(s.usePointStyle){const g={radius:Math.min(c,d)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=i.leftForLtr(h,c)+c/2,y=p+d/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Gr(e,g,b,y),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,Gr(e,g,b,y)}else{e.lineWidth=Z(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const g=i.leftForLtr(h,c),b=i.leftForLtr(i.xPlus(h,1),c-2),y=Tt(l.borderRadius);Object.values(y).some(k=>k!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Vn(e,{x:g,y:p,w:c,h:d,radius:y}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),Vn(e,{x:b,y:p+1,w:c-2,h:d-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,p,c,d),e.strokeRect(g,p,c,d),e.fillStyle=l.backgroundColor,e.fillRect(b,p+1,c-2,d-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:i}=this,{bodySpacing:s,bodyAlign:l,displayColors:a,boxHeight:d,boxWidth:c,boxPadding:u}=o,f=ge(o.bodyFont);let h=f.lineHeight,m=0;const p=nn(o.rtl,this.x,this.width),g=function(S){n.fillText(S,p.x(e.x+m),e.y+h/2),e.y+=h+s},b=p.textAlign(l);let y,k,M,w,_,F,$;for(n.textAlign=l,n.textBaseline="middle",n.font=f.string,e.x=Lo(this,b,o),n.fillStyle=o.bodyColor,te(this.beforeBody,g),m=a&&b!=="right"?l==="center"?c/2+u:c+2+u:0,w=0,F=i.length;w<F;++w){for(y=i[w],k=this.labelTextColors[w],n.fillStyle=k,te(y.before,g),M=y.lines,a&&M.length&&(this._drawColorBox(n,e,w,p,o),h=Math.max(f.lineHeight,d)),_=0,$=M.length;_<$;++_)g(M[_]),h=f.lineHeight;te(y.after,g)}m=0,h=f.lineHeight,te(this.afterBody,g),e.y-=s}drawFooter(e,n,o){const i=this.footer,s=i.length;let l,a;if(s){const d=nn(o.rtl,this.x,this.width);for(e.x=Lo(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=d.textAlign(o.footerAlign),n.textBaseline="middle",l=ge(o.footerFont),n.fillStyle=o.footerColor,n.font=l.string,a=0;a<s;++a)n.fillText(i[a],d.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+o.footerSpacing}}drawBackground(e,n,o,i){const{xAlign:s,yAlign:l}=this,{x:a,y:d}=e,{width:c,height:u}=o,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=Tt(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,d),l==="top"&&this.drawCaret(e,n,o,i),n.lineTo(a+c-h,d),n.quadraticCurveTo(a+c,d,a+c,d+h),l==="center"&&s==="right"&&this.drawCaret(e,n,o,i),n.lineTo(a+c,d+u-p),n.quadraticCurveTo(a+c,d+u,a+c-p,d+u),l==="bottom"&&this.drawCaret(e,n,o,i),n.lineTo(a+m,d+u),n.quadraticCurveTo(a,d+u,a,d+u-m),l==="center"&&s==="left"&&this.drawCaret(e,n,o,i),n.lineTo(a,d+f),n.quadraticCurveTo(a,d,a+f,d),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 l=Ln[e.position].call(this,this._active,this._eventPosition);if(!l)return;const a=this._size=Ka(this,e),d=Object.assign({},l,this._size),c=Za(n,e,d),u=Ja(e,d,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=l.x,this.caretY=l.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 l=Ce(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),Rl(e,n.textDirection),s.y+=l.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Al(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,i=e.map(({datasetIndex:a,index:d})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[d],index:d}}),s=!fo(o,i),l=this._positionChanged(i,n);(s||l)&&(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||[],l=this._getActiveElements(e,s,n,o),a=this._positionChanged(l,e),d=n||!fo(l,s)||a;return d&&(this._active=l,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),d}_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 l=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&l.reverse(),l}_positionChanged(e,n){const{caretX:o,caretY:i,options:s}=this,l=Ln[s.position].call(this,e,n);return l!==!1&&(o!==l.x||i!==l.y)}}T(yi,"positioners",Ln);var eg={id:"tooltip",_element:yi,positioners:Ln,afterInit(t,e,n){n&&(t.tooltip=new yi({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:td},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"]},tg=Object.freeze({__proto__:null,Colors:h0,Decimation:b0,Filler:O0,Legend:Y0,SubTitle:U0,Title:W0,Tooltip:eg});const ng=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function og(t,e,n,o){const i=t.indexOf(e);if(i===-1)return ng(t,e,n,o);const s=t.lastIndexOf(e);return i!==s?n:i}const rg=(t,e)=>t===null?null:$e(Math.round(t),0,e);function nd(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class $i extends Wt{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(Q(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:og(o,e,G(n,e),this._addedLabels),rg(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 l=e;l<=n;l++)i.push({value:l});return i}getLabelForValue(e){return nd.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}}T($i,"id","category"),T($i,"defaults",{ticks:{callback:nd}});function ig(t,e){const n=[],{bounds:i,step:s,min:l,max:a,precision:d,count:c,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,p=u-1,{min:g,max:b}=e,y=!Q(l),k=!Q(a),M=!Q(c),w=(b-g)/(f+1);let _=sl((b-g)/p/m)*m,F,$,S,D;if(_<1e-14&&!y&&!k)return[{value:g},{value:b}];D=Math.ceil(b/_)-Math.floor(g/_),D>p&&(_=sl(D*_/p/m)*m),Q(d)||(F=Math.pow(10,d),_=Math.ceil(_*F)/F),i==="ticks"?($=Math.floor(g/_)*_,S=Math.ceil(b/_)*_):($=g,S=b),y&&k&&s&&Qf((a-l)/s,_/1e3)?(D=Math.round(Math.min((a-l)/_,u)),_=(a-l)/D,$=l,S=a):M?($=y?l:$,S=k?a:S,D=c-1,_=(S-$)/D):(D=(S-$)/_,xn(D,Math.round(D),_/1e3)?D=Math.round(D):D=Math.ceil(D));const v=Math.max(al(_),al($));F=Math.pow(10,Q(d)?v:d),$=Math.round($*F)/F,S=Math.round(S*F)/F;let x=0;for(y&&(h&&$!==l?(n.push({value:l}),$<l&&x++,xn(Math.round(($+x*_)*F)/F,l,od(l,w,t))&&x++):$<l&&x++);x<D;++x){const C=Math.round(($+x*_)*F)/F;if(k&&C>a)break;n.push({value:C})}return k&&h&&S!==a?n.length&&xn(n[n.length-1].value,a,od(a,w,t))?n[n.length-1].value=a:n.push({value:a}):(!k||S===a)&&n.push({value:S}),n}function od(t,e,{horizontal:n,minRotation:o}){const i=Le(o),s=(n?Math.sin(i):Math.cos(i))||.001,l=.75*e*(""+t).length;return Math.min(e/s,l)}class Ho extends Wt{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 Q(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 l=d=>i=n?i:d,a=d=>s=o?s:d;if(e){const d=Ge(i),c=Ge(s);d<0&&c<0?a(0):d>0&&c>0&&l(0)}if(i===s){let d=s===0?1:Math.abs(s*.05);a(s+d),e||l(i-d)}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,l=ig(i,s);return e.bounds==="ticks"&&ll(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}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 Dn(e,this.chart.options.locale,this.options.ticks.format)}}class wi extends Ho{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ce(e)?e:0,this.max=ce(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=Le(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}}T(wi,"id","linear"),T(wi,"defaults",{ticks:{callback:go.formatters.numeric}});const Hn=t=>Math.floor(xt(t)),Ut=(t,e)=>Math.pow(10,Hn(t)+e);function rd(t){return t/Math.pow(10,Hn(t))===1}function id(t,e,n){const o=Math.pow(10,n),i=Math.floor(t/o);return Math.ceil(e/o)-i}function sg(t,e){const n=e-t;let o=Hn(n);for(;id(t,e,o)>10;)o++;for(;id(t,e,o)<10;)o--;return Math.min(o,Hn(t))}function lg(t,{min:e,max:n}){e=Pe(t.min,e);const o=[],i=Hn(e);let s=sg(e,n),l=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),d=i>s?Math.pow(10,i):0,c=Math.round((e-d)*l)/l,u=Math.floor((e-d)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,s)),h=Pe(t.min,Math.round((d+u+f*Math.pow(10,s))*l)/l);for(;h<n;)o.push({value:h,major:rd(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,l=s>=0?1:l),h=Math.round((d+u+f*Math.pow(10,s))*l)/l;const m=Pe(t.max,h);return o.push({value:m,major:rd(m),significand:f}),o}class _i extends Wt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=Ho.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return ce(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ce(e)?Math.max(0,e):null,this.max=ce(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ce(this._userMin)&&(this.min=e===Ut(this.min,0)?Ut(this.min,-1):Ut(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,l=a=>i=n?i:a;o===i&&(o<=0?(s(1),l(10)):(s(Ut(o,-1)),l(Ut(i,1)))),o<=0&&s(Ut(i,-1)),i<=0&&l(Ut(o,1)),this.min=o,this.max=i}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=lg(n,this);return e.bounds==="ticks"&&ll(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":Dn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=xt(e),this._valueRange=xt(this.max)-xt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(xt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}T(_i,"id","logarithmic"),T(_i,"defaults",{ticks:{callback:go.formatters.logarithmic,major:{enabled:!0}}});function ki(t){const e=t.ticks;if(e.display&&t.display){const n=Ce(e.backdropPadding);return G(e.font&&e.font.size,ue.font.size)+n.height}return 0}function ag(t,e,n){return n=re(n)?n:[n],{w:gh(t,e.string,n),h:n.length*e.lineHeight}}function sd(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 dg(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,l=t.options.pointLabels,a=l.centerPointLabels?ie/s:0;for(let d=0;d<s;d++){const c=l.setContext(t.getPointLabelContext(d));i[d]=c.padding;const u=t.getPointPosition(d,t.drawingArea+i[d],a),f=ge(c.font),h=ag(t.ctx,f,t._pointLabels[d]);o[d]=h;const m=Ne(t.getIndexAngle(d)+a),p=Math.round(Tr(m)),g=sd(p,u.x,h.w,0,180),b=sd(p,u.y,h.h,90,270);cg(n,e,m,g,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=hg(t,o,i)}function cg(t,e,n,o,i){const s=Math.abs(Math.sin(n)),l=Math.abs(Math.cos(n));let a=0,d=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?(d=(e.t-i.start)/l,t.t=Math.min(t.t,e.t-d)):i.end>e.b&&(d=(i.end-e.b)/l,t.b=Math.max(t.b,e.b+d))}function ug(t,e,n){const o=t.drawingArea,{extra:i,additionalAngle:s,padding:l,size:a}=n,d=t.getPointPosition(e,o+i+l,s),c=Math.round(Tr(Ne(d.angle+me))),u=gg(d.y,a.h,c),f=mg(c),h=pg(d.x,a.w,f);return{visible:!0,x:d.x,y:u,textAlign:f,left:h,top:u,right:h+a.w,bottom:u+a.h}}function fg(t,e){if(!e)return!0;const{left:n,top:o,right:i,bottom:s}=t;return!(it({x:n,y:o},e)||it({x:n,y:s},e)||it({x:i,y:o},e)||it({x:i,y:s},e))}function hg(t,e,n){const o=[],i=t._pointLabels.length,s=t.options,{centerPointLabels:l,display:a}=s.pointLabels,d={extra:ki(s)/2,additionalAngle:l?ie/i:0};let c;for(let u=0;u<i;u++){d.padding=n[u],d.size=e[u];const f=ug(t,u,d);o.push(f),a==="auto"&&(f.visible=fg(f,c),f.visible&&(c=f))}return o}function mg(t){return t===0||t===180?"center":t<180?"left":"right"}function pg(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function gg(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function bg(t,e,n){const{left:o,top:i,right:s,bottom:l}=n,{backdropColor:a}=e;if(!Q(a)){const d=Tt(e.borderRadius),c=Ce(e.backdropPadding);t.fillStyle=a;const u=o-c.left,f=i-c.top,h=s-o+c.width,m=l-i+c.height;Object.values(d).some(p=>p!==0)?(t.beginPath(),Vn(t,{x:u,y:f,w:h,h:m,radius:d}),t.fill()):t.fillRect(u,f,h,m)}}function yg(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 l=o.setContext(t.getPointLabelContext(i));bg(n,l,s);const a=ge(l.font),{x:d,y:c,textAlign:u}=s;It(n,t._pointLabels[i],d,c+a.lineHeight/2,a,{color:l.color,textAlign:u,textBaseline:"middle"})}}function ld(t,e,n,o){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,se);else{let s=t.getPointPosition(0,e);i.moveTo(s.x,s.y);for(let l=1;l<o;l++)s=t.getPointPosition(l,e),i.lineTo(s.x,s.y)}}function $g(t,e,n,o,i){const s=t.ctx,l=e.circular,{color:a,lineWidth:d}=e;!l&&!o||!a||!d||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=d,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),ld(t,n,l,o),s.closePath(),s.stroke(),s.restore())}function wg(t,e,n){return St(t,{label:n,index:e,type:"pointLabel"})}class Yn extends Ho{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=Ce(ki(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=ce(e)&&!isNaN(e)?e:0,this.max=ce(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ki(this.options))}generateTickLabels(e){Ho.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const i=oe(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?dg(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=se/(this._pointLabels.length||1),o=this.options.startAngle||0;return Ne(e*n+Le(o))}getDistanceFromCenterForValue(e){if(Q(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(Q(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 wg(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const i=this.getIndexAngle(e)-me+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(),ld(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,l=this._pointLabels.length;let a,d,c;if(n.pointLabels.display&&yg(this,l),i.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){d=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=i.setContext(h),p=s.setContext(h);$g(this,m,d,l,p)}}),o.display){for(e.save(),a=l-1;a>=0;a--){const u=o.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,d=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,d),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.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,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,d)=>{if(d===0&&this.min>=0&&!n.reverse)return;const c=o.setContext(this.getContext(d)),u=ge(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[d].value),c.showLabelBackdrop){e.font=u.string,l=e.measureText(a.label).width,e.fillStyle=c.backdropColor;const f=Ce(c.backdropPadding);e.fillRect(-l/2-f.left,-s-u.size/2-f.top,l+f.width,u.size+f.height)}It(e,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}T(Yn,"id","radialLinear"),T(Yn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:go.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),T(Yn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),T(Yn,"descriptors",{angleLines:{_fallback:"grid"}});const Yo={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}},Ve=Object.keys(Yo);function ad(t,e){return t-e}function dd(t,e){if(Q(e))return null;const n=t._adapter,{parser:o,round:i,isoWeekday:s}=t._parseOpts;let l=e;return typeof o=="function"&&(l=o(l)),ce(l)||(l=typeof o=="string"?n.parse(l,o):n.parse(l)),l===null?null:(i&&(l=i==="week"&&(Qt(s)||s===!0)?n.startOf(l,"isoWeek",s):n.startOf(l,i)),+l)}function cd(t,e,n,o){const i=Ve.length;for(let s=Ve.indexOf(t);s<i-1;++s){const l=Yo[Ve[s]],a=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((n-e)/(a*l.size))<=o)return Ve[s]}return Ve[i-1]}function _g(t,e,n,o,i){for(let s=Ve.length-1;s>=Ve.indexOf(n);s--){const l=Ve[s];if(Yo[l].common&&t._adapter.diff(i,o,l)>=e-1)return l}return Ve[n?Ve.indexOf(n):0]}function kg(t){for(let e=Ve.indexOf(t)+1,n=Ve.length;e<n;++e)if(Yo[Ve[e]].common)return Ve[e]}function ud(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:i}=Lr(n,e),s=n[o]>=e?n[o]:n[i];t[s]=!0}}function Cg(t,e,n,o){const i=t._adapter,s=+i.startOf(e[0].value,o),l=e[e.length-1].value;let a,d;for(a=s;a<=l;a=+i.add(a,1,o))d=n[a],d>=0&&(e[d].major=!0);return e}function fd(t,e,n){const o=[],i={},s=e.length;let l,a;for(l=0;l<s;++l)a=e[l],i[a]=l,o.push({value:a,major:!1});return s===0||!n?o:Cg(t,o,i,n)}class jn extends Wt{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 Pm._date(e.adapters.date);i.init(n),kn(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:dd(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:l,maxDefined:a}=this.getUserBounds();function d(c){!l&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!l||!a)&&(d(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&d(this.getMinMax(!1))),i=ce(i)&&!isNaN(i)?i:+n.startOf(Date.now(),o),s=ce(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,l=this.max,a=oh(i,s,l);return this._unit=n.unit||(o.autoSkip?cd(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):_g(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:kg(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),fd(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 l=e.length<3?.5:.25;n=$e(n,0,l),o=$e(o,0,l),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,l=s.unit||cd(s.minUnit,n,o,this._getLabelCapacity(n)),a=G(i.ticks.stepSize,1),d=l==="week"?s.isoWeekday:!1,c=Qt(d)||d===!0,u={};let f=n,h,m;if(c&&(f=+e.startOf(f,"isoWeek",d)),f=+e.startOf(f,c?"day":l),e.diff(o,n,l)>1e5*a)throw new Error(n+" and "+o+" are too far apart with stepSize of "+a+" "+l);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<o;h=+e.add(h,a,l),m++)ud(u,h,p);return(h===o||i.bounds==="ticks"||m===1)&&ud(u,h,p),Object.keys(u).sort(ad).map(g=>+g)}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,l=n||i[s];return this._adapter.format(e,l)}_tickFormatFunction(e,n,o,i){const s=this.options,l=s.ticks.callback;if(l)return oe(l,[e,n,o],this);const a=s.time.displayFormats,d=this._unit,c=this._majorUnit,u=d&&a[d],f=c&&a[c],h=o[n],m=c&&f&&h&&h.major;return this._adapter.format(e,i||(m?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=Le(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),l=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:o*s+a*l,h:o*l+a*s}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,i=o[n.unit]||o.millisecond,s=this._tickFormatFunction(e,0,fd(this,[e],this._majorUnit),i),l=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.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(dd(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return fl(e.sort(ad))}}T(jn,"id","time"),T(jn,"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 jo(t,e,n){let o=0,i=t.length-1,s,l,a,d;n?(e>=t[o].pos&&e<=t[i].pos&&({lo:o,hi:i}=rt(t,"pos",e)),{pos:s,time:a}=t[o],{pos:l,time:d}=t[i]):(e>=t[o].time&&e<=t[i].time&&({lo:o,hi:i}=rt(t,"time",e)),{time:s,pos:a}=t[o],{time:l,pos:d}=t[i]);const c=l-s;return c?a+(d-a)*(e-s)/c:a}class Ci extends jn{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=jo(n,this.min),this._tableRange=jo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,i=[],s=[];let l,a,d,c,u;for(l=0,a=e.length;l<a;++l)c=e[l],c>=n&&c<=o&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(l=0,a=i.length;l<a;++l)u=i[l+1],d=i[l-1],c=i[l],Math.round((u+d)/2)!==c&&s.push({time:c,pos:l/(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(jo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return jo(this._table,o*this._tableRange+this._minPos,!0)}}T(Ci,"id","timeseries"),T(Ci,"defaults",jn.defaults);var xg=Object.freeze({__proto__:null,CategoryScale:$i,LinearScale:wi,LogarithmicScale:_i,RadialLinearScale:Yn,TimeScale:jn,TimeSeriesScale:Ci});const Sg=[Em,l0,tg,xg];Ye.register(...Sg);const vg={class:"flex flex-col h-full m-24 overflow-hidden p-24"},Dg={class:"flex flex-col gap-8"},Mg={class:"fm-color-typo-primary fm-typo-body-lg-400"},Vg={class:"fm-color-typo-secondary fm-typo-body-md-400"},Bg={class:"grow"},Eg=r.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{},transpose:{type:Boolean,default:!1},stacked:{type:Boolean},maintainAspectRatio:{type:Boolean},hideXAxis:{type:Boolean,default:void 0},hideYAxis:{type:Boolean,default:void 0},hideLegend:{type:Boolean,default:void 0}},setup(t){const e=t,n=r.ref(null);let o=null;r.watch([()=>e.transpose,()=>e.maintainAspectRatio,()=>e.hideXAxis,()=>e.hideYAxis,()=>e.hideLegend],()=>{o&&o.config.options&&(o.destroy(),a())});const i=r.computed(()=>e.transpose?"y":"x");function s({context:d,color:c}){const{ctx:u,chartArea:f}=d.chart;if(!f)return;const h=u==null?void 0:u.createLinearGradient(0,0,0,f.height);return h.addColorStop(0,vr(c,.5)),h.addColorStop(1,vr(c,0)),h}const l=r.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(d=>{const c=pn(d.color)??"";return{...d,backgroundColor:c?u=>s({context:u,color:c}):"",borderColor:c,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));r.watch(l,()=>{o&&(o.data=l.value,o.update())},{deep:!0});function a(){n.value&&(o=new Ye(n.value,{type:"line",data:l.value,options:{plugins:{legend:{display:!e.hideLegend,position:"bottom",labels:{usePointStyle:!0,pointStyle:"line"}}},maintainAspectRatio:e.maintainAspectRatio,responsive:!0,indexAxis:i.value,scales:{x:{display:!e.hideXAxis,stacked:e.stacked,grid:{display:!1},beginAtZero:!0},y:{display:!e.hideYAxis,stacked:e.stacked,grid:{display:!0},position:"right",beginAtZero:!0}},elements:{line:{borderWidth:1.5},point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return r.onMounted(()=>{a()}),(d,c)=>(r.openBlock(),r.createElementBlock("div",vg,[r.createElementVNode("div",Dg,[r.renderSlot(d.$slots,"title"),r.createElementVNode("div",Mg,r.toDisplayString(d.name),1),r.createElementVNode("div",Vg,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("div",Bg,[r.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)])]))}}),Pg={class:"flex flex-col h-full overflow-hidden px-24 py-16"},Ng={class:"flex flex-col gap-8"},Fg={class:"fm-color-typo-primary fm-typo-body-lg-400"},Rg={class:"fm-color-typo-secondary fm-typo-body-md-400"},Ag={class:"grow"},Og=r.defineComponent({__name:"FmPie",props:{name:{default:void 0},variant:{},paragraph:{default:void 0},datasets:{},metrics:{},legend:{type:Boolean,default:!0},text:{default:void 0},textColor:{default:"#0E1715"},textStyle:{default:"bold 30px sans-serif"},maintainAspectRatio:{type:Boolean,default:!0}},setup(t){const e=t,n=r.ref(null);let o=null;const i=r.computed(()=>e.variant==="doughnut"?"90%":"0"),s=r.computed(()=>e.text);r.watch([()=>e.metrics,()=>e.datasets,()=>e.variant,()=>e.legend,()=>e.textColor,()=>e.textStyle,()=>e.text,()=>e.maintainAspectRatio],()=>{o&&(o.destroy(),a())});const l=r.computed(()=>({labels:e.metrics,datasets:e.datasets.map(d=>{var u;const c=(u=d.backgroundColor)==null?void 0:u.map(f=>pn(f)??"");return{...d,backgroundColor:c??void 0,hoverOffset:d.hoverOffset??0}})}));function a(){n.value&&(o=new Ye(n.value,{type:"doughnut",data:l.value,options:{maintainAspectRatio:e.maintainAspectRatio,responsive:!0,cutout:i.value,plugins:{legend:{display:e.legend,position:"bottom",labels:{usePointStyle:!0}}}},plugins:[{id:"doughnutlabel",beforeDatasetsDraw:d=>{if(e.variant==="doughnut"){const{ctx:c}=d;c.save();const u=d.getDatasetMeta(0).data[0].x,f=d.getDatasetMeta(0).data[0].y;if(c.font=e.textStyle,c.textAlign="center",c.textBaseline="middle",s.value&&s.value!==""){const h=s.value.split(`
27
- `);for(let m=0;m<h.length;m++){const p=m===0?1:.7;c.fillStyle=vr(pn(e.textColor)??"",p),c.fillText(h[m],u,f+m*40)}}}}}]}))}return r.onMounted(()=>{a()}),(d,c)=>(r.openBlock(),r.createElementBlock("div",Pg,[r.createElementVNode("div",Ng,[r.renderSlot(d.$slots,"title"),r.createElementVNode("div",Fg,r.toDisplayString(d.name),1),r.createElementVNode("div",Rg,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("div",Ag,[r.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)])]))}}),Ig={class:"flex flex-col h-full overflow-hidden px-24 py-16"},Tg={class:"flex flex-col gap-8"},zg={class:"fm-color-typo-primary fm-typo-body-lg-400"},Lg={class:"fm-color-typo-secondary fm-typo-body-md-400"},Hg={class:"grow"},Yg=r.defineComponent({__name:"FmBar",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{},transpose:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},maintainAspectRatio:{type:Boolean,default:!0},hideXAxis:{type:Boolean,default:void 0},hideYAxis:{type:Boolean,default:void 0},hideLegend:{type:Boolean,default:void 0}},setup(t){const e=t,n=r.ref(null);let o=null;r.watch([()=>e.transpose,()=>e.maintainAspectRatio,()=>e.hideLegend,()=>e.hideXAxis,()=>e.hideYAxis],()=>{o&&(o.destroy(),l())});const i=r.computed(()=>e.transpose?"y":"x"),s=r.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(a=>{var u;let d,c;return typeof a.backgroundColor=="string"?d=a.backgroundColor:typeof a.backgroundColor=="object"&&(d=a.backgroundColor.map(f=>pn(f)??"")),typeof a.borderColor=="string"?c=a.borderColor:typeof a.borderColor=="object"&&(c=(u=a.borderColor)==null?void 0:u.map(f=>pn(f)??"")),{...a,backgroundColor:d,borderColor:c,borderRadius:10,borderWidth:c?1:0}})}));r.watch(s,()=>{o&&(o.data=s.value,o.update())},{deep:!0});function l(){n.value&&(o=new Ye(n.value,{type:"bar",data:s.value,options:{plugins:{legend:{display:!e.hideLegend,position:"bottom"}},maintainAspectRatio:e.maintainAspectRatio,responsive:!0,indexAxis:i.value,scales:{x:{display:!e.hideXAxis,stacked:e.stacked,grid:{display:!1},beginAtZero:!0},y:{display:!e.hideYAxis,stacked:e.stacked,grid:{display:!1},position:"right",beginAtZero:!0}},elements:{point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return r.onMounted(()=>{l()}),(a,d)=>(r.openBlock(),r.createElementBlock("div",Ig,[r.createElementVNode("div",Tg,[r.renderSlot(a.$slots,"title"),r.createElementVNode("div",zg,r.toDisplayString(a.name),1),r.createElementVNode("div",Lg,r.toDisplayString(a.paragraph),1)]),r.createElementVNode("div",Hg,[r.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)])]))}});var jg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hd={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(jg,function(){var n=1e3,o=6e4,i=36e5,s="millisecond",l="second",a="minute",d="hour",c="day",u="week",f="month",h="quarter",m="year",p="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+)?$/,y=/\[([^\]]+)]|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,k={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(E){var P=["th","st","nd","rd"],B=E%100;return"["+E+(P[(B-20)%10]||P[B]||P[0])+"]"}},M=function(E,P,B){var R=String(E);return!R||R.length>=P?E:""+Array(P+1-R.length).join(B)+E},w={s:M,z:function(E){var P=-E.utcOffset(),B=Math.abs(P),R=Math.floor(B/60),O=B%60;return(P<=0?"+":"-")+M(R,2,"0")+":"+M(O,2,"0")},m:function E(P,B){if(P.date()<B.date())return-E(B,P);var R=12*(B.year()-P.year())+(B.month()-P.month()),O=P.clone().add(R,f),L=B-O<0,z=P.clone().add(R+(L?-1:1),f);return+(-(R+(B-O)/(L?O-z:z-O))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:f,y:m,w:u,d:c,D:p,h:d,m:a,s:l,ms:s,Q:h}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},_="en",F={};F[_]=k;var $="$isDayjsObject",S=function(E){return E instanceof C||!(!E||!E[$])},D=function E(P,B,R){var O;if(!P)return _;if(typeof P=="string"){var L=P.toLowerCase();F[L]&&(O=L),B&&(F[L]=B,O=L);var z=P.split("-");if(!O&&z.length>1)return E(z[0])}else{var W=P.name;F[W]=P,O=W}return!R&&O&&(_=O),O||!R&&_},v=function(E,P){if(S(E))return E.clone();var B=typeof P=="object"?P:{};return B.date=E,B.args=arguments,new C(B)},x=w;x.l=D,x.i=S,x.w=function(E,P){return v(E,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var C=function(){function E(B){this.$L=D(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[$]=!0}var P=E.prototype;return P.parse=function(B){this.$d=function(R){var O=R.date,L=R.utc;if(O===null)return new Date(NaN);if(x.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var z=O.match(b);if(z){var W=z[2]-1||0,X=(z[7]||"0").substring(0,3);return L?new Date(Date.UTC(z[1],W,z[3]||1,z[4]||0,z[5]||0,z[6]||0,X)):new Date(z[1],W,z[3]||1,z[4]||0,z[5]||0,z[6]||0,X)}}return new Date(O)}(B),this.init()},P.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},P.$utils=function(){return x},P.isValid=function(){return this.$d.toString()!==g},P.isSame=function(B,R){var O=v(B);return this.startOf(R)<=O&&O<=this.endOf(R)},P.isAfter=function(B,R){return v(B)<this.startOf(R)},P.isBefore=function(B,R){return this.endOf(R)<v(B)},P.$g=function(B,R,O){return x.u(B)?this[R]:this.set(O,B)},P.unix=function(){return Math.floor(this.valueOf()/1e3)},P.valueOf=function(){return this.$d.getTime()},P.startOf=function(B,R){var O=this,L=!!x.u(R)||R,z=x.p(B),W=function(Oe,he){var Ee=x.w(O.$u?Date.UTC(O.$y,he,Oe):new Date(O.$y,he,Oe),O);return L?Ee:Ee.endOf(c)},X=function(Oe,he){return x.w(O.toDate()[Oe].apply(O.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(he)),O)},K=this.$W,ee=this.$M,ae=this.$D,pe="set"+(this.$u?"UTC":"");switch(z){case m:return L?W(1,0):W(31,11);case f:return L?W(1,ee):W(0,ee+1);case u:var Ae=this.$locale().weekStart||0,Ue=(K<Ae?K+7:K)-Ae;return W(L?ae-Ue:ae+(6-Ue),ee);case c:case p:return X(pe+"Hours",0);case d:return X(pe+"Minutes",1);case a:return X(pe+"Seconds",2);case l:return X(pe+"Milliseconds",3);default:return this.clone()}},P.endOf=function(B){return this.startOf(B,!1)},P.$set=function(B,R){var O,L=x.p(B),z="set"+(this.$u?"UTC":""),W=(O={},O[c]=z+"Date",O[p]=z+"Date",O[f]=z+"Month",O[m]=z+"FullYear",O[d]=z+"Hours",O[a]=z+"Minutes",O[l]=z+"Seconds",O[s]=z+"Milliseconds",O)[L],X=L===c?this.$D+(R-this.$W):R;if(L===f||L===m){var K=this.clone().set(p,1);K.$d[W](X),K.init(),this.$d=K.set(p,Math.min(this.$D,K.daysInMonth())).$d}else W&&this.$d[W](X);return this.init(),this},P.set=function(B,R){return this.clone().$set(B,R)},P.get=function(B){return this[x.p(B)]()},P.add=function(B,R){var O,L=this;B=Number(B);var z=x.p(R),W=function(ee){var ae=v(L);return x.w(ae.date(ae.date()+Math.round(ee*B)),L)};if(z===f)return this.set(f,this.$M+B);if(z===m)return this.set(m,this.$y+B);if(z===c)return W(1);if(z===u)return W(7);var X=(O={},O[a]=o,O[d]=i,O[l]=n,O)[z]||1,K=this.$d.getTime()+B*X;return x.w(K,this)},P.subtract=function(B,R){return this.add(-1*B,R)},P.format=function(B){var R=this,O=this.$locale();if(!this.isValid())return O.invalidDate||g;var L=B||"YYYY-MM-DDTHH:mm:ssZ",z=x.z(this),W=this.$H,X=this.$m,K=this.$M,ee=O.weekdays,ae=O.months,pe=O.meridiem,Ae=function(he,Ee,pt,et){return he&&(he[Ee]||he(R,L))||pt[Ee].slice(0,et)},Ue=function(he){return x.s(W%12||12,he,"0")},Oe=pe||function(he,Ee,pt){var et=he<12?"AM":"PM";return pt?et.toLowerCase():et};return L.replace(y,function(he,Ee){return Ee||function(pt){switch(pt){case"YY":return String(R.$y).slice(-2);case"YYYY":return x.s(R.$y,4,"0");case"M":return K+1;case"MM":return x.s(K+1,2,"0");case"MMM":return Ae(O.monthsShort,K,ae,3);case"MMMM":return Ae(ae,K);case"D":return R.$D;case"DD":return x.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return Ae(O.weekdaysMin,R.$W,ee,2);case"ddd":return Ae(O.weekdaysShort,R.$W,ee,3);case"dddd":return ee[R.$W];case"H":return String(W);case"HH":return x.s(W,2,"0");case"h":return Ue(1);case"hh":return Ue(2);case"a":return Oe(W,X,!0);case"A":return Oe(W,X,!1);case"m":return String(X);case"mm":return x.s(X,2,"0");case"s":return String(R.$s);case"ss":return x.s(R.$s,2,"0");case"SSS":return x.s(R.$ms,3,"0");case"Z":return z}return null}(he)||z.replace(":","")})},P.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},P.diff=function(B,R,O){var L,z=this,W=x.p(R),X=v(B),K=(X.utcOffset()-this.utcOffset())*o,ee=this-X,ae=function(){return x.m(z,X)};switch(W){case m:L=ae()/12;break;case f:L=ae();break;case h:L=ae()/3;break;case u:L=(ee-K)/6048e5;break;case c:L=(ee-K)/864e5;break;case d:L=ee/i;break;case a:L=ee/o;break;case l:L=ee/n;break;default:L=ee}return O?L:x.a(L)},P.daysInMonth=function(){return this.endOf(f).$D},P.$locale=function(){return F[this.$L]},P.locale=function(B,R){if(!B)return this.$L;var O=this.clone(),L=D(B,R,!0);return L&&(O.$L=L),O},P.clone=function(){return x.w(this.$d,this)},P.toDate=function(){return new Date(this.valueOf())},P.toJSON=function(){return this.isValid()?this.toISOString():null},P.toISOString=function(){return this.$d.toISOString()},P.toString=function(){return this.$d.toUTCString()},E}(),N=C.prototype;return v.prototype=N,[["$ms",s],["$s",l],["$m",a],["$H",d],["$W",c],["$M",f],["$y",m],["$D",p]].forEach(function(E){N[E[1]]=function(P){return this.$g(P,E[0],E[1])}}),v.extend=function(E,P){return E.$i||(E(P,C,v),E.$i=!0),v},v.locale=D,v.isDayjs=S,v.unix=function(E){return v(1e3*E)},v.en=F[_],v.Ls=F,v.p={},v})})(hd);var Wg=hd.exports;const V=xi(Wg);function Se(t,e){return t===null||e===null||typeof t!="object"&&typeof e!="object"?t===e:Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Se(t[n],e[n]))}const fe=(t,e,n)=>t&&e&&n?t.isAfter(e,"day")&&t.isBefore(n,"day"):!1,Ug={class:"fm-checkbox"},Gg={class:"fm-checkbox--wrapper"},qg={class:"fm-checkbox__input--container"},Xg=["checked","disabled","indeterminate"],Kg={key:0,class:"fm-checkbox__label-container"},Zg={class:"fm-typo-body-lg-400"},Jg={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},md=r.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:void 0},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=q(e,"indeterminate"),l=Array.isArray(i.value),a=r.ref(l?i.value.some(u=>Se(u,e.value)):i.value),d=r.computed(()=>{const u=l?i.value.some(f=>Se(f,e.value)):i.value;return s.value&&!u?"remove":i.value?"check_small":""});function c(){if(o.value)return;s.value=!1,a.value=!a.value;let u=i.value;l?u=a.value?u.concat(e.value):u.filter(f=>!Se(f,e.value)):u=a.value,i.value=u}return r.watch(()=>i.value,()=>{a.value=l?i.value.some(u=>Se(u,e.value)):i.value}),(u,f)=>(r.openBlock(),r.createElementBlock("div",Ug,[r.createElementVNode("label",Gg,[r.createElementVNode("div",qg,[r.createElementVNode("input",{checked:a.value,class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":a.value}),disabled:o.value,indeterminate:r.unref(s),type:"checkbox",onInput:c},null,42,Xg),r.unref(s)||a.value?(r.openBlock(),r.createBlock(H,{key:0,name:d.value,class:"fm-checkbox__input--checkmark",color:"#FFFFFF",size:"md"},null,8,["name"])):r.createCommentVNode("",!0)]),e.label?(r.openBlock(),r.createElementBlock("div",Kg,[r.renderSlot(u.$slots,"label"),r.createElementVNode("div",Zg,r.toDisplayString(e.label),1),e.sublabel?(r.openBlock(),r.createElementBlock("div",Jg,r.toDisplayString(e.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]))}}),Qg={class:"w-full"},le=J(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:void 0},focused:{type:Boolean,default:!1},iconOutlined:{type:Boolean,default:!1},size:{default:"sm"}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1);return(i,s)=>(r.openBlock(),r.createBlock(e.tag,{class:r.normalizeClass({"fm-field":!0,"fm-field--focused":i.focused,"fm-field--invalid":i.invalid,"fm-field--valid":i.showValidBorder&&!i.invalid,"fm-field--disabled":o.value,"fm-field--md":i.size==="md","fm-field--sm":i.size==="sm"})},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"prepend",{},()=>[i.prependIcon?(r.openBlock(),r.createBlock(H,{key:0,color:o.value?"disabled":"neutral-black",name:i.prependIcon,outline:i.iconOutlined,size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",Qg,[r.renderSlot(i.$slots,"default",{},void 0,!0)]),r.renderSlot(i.$slots,"append",{},()=>[i.appendIcon?(r.openBlock(),r.createBlock(H,{key:0,color:o.value?"disabled":"neutral-black",name:i.appendIcon,outline:i.iconOutlined,size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-89e62420"]]),e1={class:"flex gap-4"},pd=r.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:void 0},state:{default:"none"},errorMessages:{default:()=>[]}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=r.computed(()=>e.state==="success"?"check_circle":e.state==="warning"?"warning":e.state==="error"?"error":""),s=r.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(l,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":o.value,"text-fm-color-typo-secondary":l.state==="none"&&!o.value,"text-fm-color-typo-success":l.state==="success"&&!o.value,"text-fm-color-typo-warning":l.state==="warning"&&!o.value,"text-fm-color-typo-error":l.state==="error"&&!o.value}])},[l.errorMessages.length===0?r.renderSlot(l.$slots,"default",{key:0},()=>[r.createElementVNode("div",e1,[i.value?(r.openBlock(),r.createBlock(H,{key:0,class:r.normalizeClass([s.value,"mt-[2px]"]),name:i.value,size:"sm"},null,8,["class","name"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(l.text),1)])]):r.renderSlot(l.$slots,"default",{key:1},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.errorMessages,d=>(r.openBlock(),r.createElementBlock("div",{key:d,class:"flex gap-4 text-fm-color-typo-error"},[r.createVNode(H,{class:"mt-[2px] text-fm-color-system-error-300",name:"error",size:"sm"}),r.createElementVNode("span",null,r.toDisplayString(d),1)]))),128))])],2))}}),rn=Math.min,Gt=Math.max,Wo=Math.round,Uo=Math.floor,Mt=t=>({x:t,y:t}),t1={left:"right",right:"left",bottom:"top",top:"bottom"},n1={start:"end",end:"start"};function Si(t,e,n){return Gt(t,rn(e,n))}function Wn(t,e){return typeof t=="function"?t(e):t}function qt(t){return t.split("-")[0]}function Un(t){return t.split("-")[1]}function gd(t){return t==="x"?"y":"x"}function vi(t){return t==="y"?"height":"width"}function Go(t){return["top","bottom"].includes(qt(t))?"y":"x"}function Di(t){return gd(Go(t))}function o1(t,e,n){n===void 0&&(n=!1);const o=Un(t),i=Di(t),s=vi(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=qo(l)),[l,qo(l)]}function r1(t){const e=qo(t);return[Mi(t),e,Mi(e)]}function Mi(t){return t.replace(/start|end/g,e=>n1[e])}function i1(t,e,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:l;default:return[]}}function s1(t,e,n,o){const i=Un(t);let s=i1(qt(t),n==="start",o);return i&&(s=s.map(l=>l+"-"+i),e&&(s=s.concat(s.map(Mi)))),s}function qo(t){return t.replace(/left|right|bottom|top/g,e=>t1[e])}function l1(t){return{top:0,right:0,bottom:0,left:0,...t}}function bd(t){return typeof t!="number"?l1(t):{top:t,right:t,bottom:t,left:t}}function Xo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function yd(t,e,n){let{reference:o,floating:i}=t;const s=Go(e),l=Di(e),a=vi(l),d=qt(e),c=s==="y",u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let m;switch(d){case"top":m={x:u,y:o.y-i.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-i.width,y:f};break;default:m={x:o.x,y:o.y}}switch(Un(e)){case"start":m[l]-=h*(n&&c?-1:1);break;case"end":m[l]+=h*(n&&c?-1:1);break}return m}const a1=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,a=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=yd(c,o,d),h=o,m={},p=0;for(let g=0;g<a.length;g++){const{name:b,fn:y}=a[g],{x:k,y:M,data:w,reset:_}=await y({x:u,y:f,initialPlacement:o,placement:h,strategy:i,middlewareData:m,rects:c,platform:l,elements:{reference:t,floating:e}});u=k??u,f=M??f,m={...m,[b]:{...m[b],...w}},_&&p<=50&&(p++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(c=_.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:f}=yd(c,h,d)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:m}};async function $d(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:l,elements:a,strategy:d}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Wn(e,t),p=bd(m),b=a[h?f==="floating"?"reference":"floating":f],y=Xo(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:c,rootBoundary:u,strategy:d})),k=f==="floating"?{...l.floating,x:o,y:i}:l.reference,M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(M))?await(s.getScale==null?void 0:s.getScale(M))||{x:1,y:1}:{x:1,y:1},_=Xo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:M,strategy:d}):k);return{top:(y.top-_.top+p.top)/w.y,bottom:(_.bottom-y.bottom+p.bottom)/w.y,left:(y.left-_.left+p.left)/w.x,right:(_.right-y.right+p.right)/w.x}}const d1=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:s,platform:l,elements:a,middlewareData:d}=e,{element:c,padding:u=0}=Wn(t,e)||{};if(c==null)return{};const f=bd(u),h={x:n,y:o},m=Di(i),p=vi(m),g=await l.getDimensions(c),b=m==="y",y=b?"top":"left",k=b?"bottom":"right",M=b?"clientHeight":"clientWidth",w=s.reference[p]+s.reference[m]-h[m]-s.floating[p],_=h[m]-s.reference[m],F=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let $=F?F[M]:0;(!$||!await(l.isElement==null?void 0:l.isElement(F)))&&($=a.floating[M]||s.floating[p]);const S=w/2-_/2,D=$/2-g[p]/2-1,v=rn(f[y],D),x=rn(f[k],D),C=v,N=$-g[p]-x,E=$/2-g[p]/2+S,P=Si(C,E,N),B=!d.arrow&&Un(i)!=null&&E!==P&&s.reference[p]/2-(E<C?v:x)-g[p]/2<0,R=B?E<C?E-C:E-N:0;return{[m]:h[m]+R,data:{[m]:P,centerOffset:E-P-R,...B&&{alignmentOffset:R}},reset:B}}}),c1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:l,initialPlacement:a,platform:d,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...b}=Wn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=qt(i),k=qt(a)===a,M=await(d.isRTL==null?void 0:d.isRTL(c.floating)),w=h||(k||!g?[qo(a)]:r1(a));!h&&p!=="none"&&w.push(...s1(a,g,p,M));const _=[a,...w],F=await $d(e,b),$=[];let S=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&$.push(F[y]),f){const C=o1(i,l,M);$.push(F[C[0]],F[C[1]])}if(S=[...S,{placement:i,overflows:$}],!$.every(C=>C<=0)){var D,v;const C=(((D=s.flip)==null?void 0:D.index)||0)+1,N=_[C];if(N)return{data:{index:C,overflows:S},reset:{placement:N}};let E=(v=S.filter(P=>P.overflows[0]<=0).sort((P,B)=>P.overflows[1]-B.overflows[1])[0])==null?void 0:v.placement;if(!E)switch(m){case"bestFit":{var x;const P=(x=S.map(B=>[B.placement,B.overflows.filter(R=>R>0).reduce((R,O)=>R+O,0)]).sort((B,R)=>B[1]-R[1])[0])==null?void 0:x[0];P&&(E=P);break}case"initialPlacement":E=a;break}if(i!==E)return{reset:{placement:E}}}return{}}}};async function u1(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=qt(n),a=Un(n),d=Go(n)==="y",c=["left","top"].includes(l)?-1:1,u=s&&d?-1:1,f=Wn(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),d?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const Gn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:l,middlewareData:a}=e,d=await u1(e,t);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:s+d.y,data:{...d,placement:l}}}}},f1=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:l=!1,limiter:a={fn:b=>{let{x:y,y:k}=b;return{x:y,y:k}}},...d}=Wn(t,e),c={x:n,y:o},u=await $d(e,d),f=Go(qt(i)),h=gd(f);let m=c[h],p=c[f];if(s){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",k=m+u[b],M=m-u[y];m=Si(k,m,M)}if(l){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",k=p+u[b],M=p-u[y];p=Si(k,p,M)}const g=a.fn({...e,[h]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-o}}}}};function dt(t){return Vi(t)?(t.nodeName||"").toLowerCase():"#document"}function Fe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ct(t){var e;return(e=(Vi(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vi(t){return t instanceof Node||t instanceof Fe(t).Node}function ut(t){return t instanceof Element||t instanceof Fe(t).Element}function Ke(t){return t instanceof HTMLElement||t instanceof Fe(t).HTMLElement}function wd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Fe(t).ShadowRoot}function qn(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Te(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function h1(t){return["table","td","th"].includes(dt(t))}function Bi(t){const e=Ei(),n=Te(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 m1(t){let e=sn(t);for(;Ke(e)&&!Ko(e);){if(Bi(e))return e;e=sn(e)}return null}function Ei(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ko(t){return["html","body","#document"].includes(dt(t))}function Te(t){return Fe(t).getComputedStyle(t)}function Zo(t){return ut(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function sn(t){if(dt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||wd(t)&&t.host||ct(t);return wd(e)?e.host:e}function _d(t){const e=sn(t);return Ko(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ke(e)&&qn(e)?e:_d(e)}function Xn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=_d(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),l=Fe(i);return s?e.concat(l,l.visualViewport||[],qn(i)?i:[],l.frameElement&&n?Xn(l.frameElement):[]):e.concat(i,Xn(i,[],n))}function kd(t){const e=Te(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Ke(t),s=i?t.offsetWidth:n,l=i?t.offsetHeight:o,a=Wo(n)!==s||Wo(o)!==l;return a&&(n=s,o=l),{width:n,height:o,$:a}}function Pi(t){return ut(t)?t:t.contextElement}function ln(t){const e=Pi(t);if(!Ke(e))return Mt(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=kd(e);let l=(s?Wo(n.width):n.width)/o,a=(s?Wo(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const p1=Mt(0);function Cd(t){const e=Fe(t);return!Ei()||!e.visualViewport?p1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function g1(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Fe(t)?!1:e}function Xt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Pi(t);let l=Mt(1);e&&(o?ut(o)&&(l=ln(o)):l=ln(t));const a=g1(s,n,o)?Cd(s):Mt(0);let d=(i.left+a.x)/l.x,c=(i.top+a.y)/l.y,u=i.width/l.x,f=i.height/l.y;if(s){const h=Fe(s),m=o&&ut(o)?Fe(o):o;let p=h,g=p.frameElement;for(;g&&o&&m!==p;){const b=ln(g),y=g.getBoundingClientRect(),k=Te(g),M=y.left+(g.clientLeft+parseFloat(k.paddingLeft))*b.x,w=y.top+(g.clientTop+parseFloat(k.paddingTop))*b.y;d*=b.x,c*=b.y,u*=b.x,f*=b.y,d+=M,c+=w,p=Fe(g),g=p.frameElement}}return Xo({width:u,height:f,x:d,y:c})}const b1=[":popover-open",":modal"];function xd(t){return b1.some(e=>{try{return t.matches(e)}catch{return!1}})}function y1(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",l=ct(o),a=e?xd(e.floating):!1;if(o===l||a&&s)return n;let d={scrollLeft:0,scrollTop:0},c=Mt(1);const u=Mt(0),f=Ke(o);if((f||!f&&!s)&&((dt(o)!=="body"||qn(l))&&(d=Zo(o)),Ke(o))){const h=Xt(o);c=ln(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+u.x,y:n.y*c.y-d.scrollTop*c.y+u.y}}function $1(t){return Array.from(t.getClientRects())}function Sd(t){return Xt(ct(t)).left+Zo(t).scrollLeft}function w1(t){const e=ct(t),n=Zo(t),o=t.ownerDocument.body,i=Gt(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=Gt(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Sd(t);const a=-n.scrollTop;return Te(o).direction==="rtl"&&(l+=Gt(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:l,y:a}}function _1(t,e){const n=Fe(t),o=ct(t),i=n.visualViewport;let s=o.clientWidth,l=o.clientHeight,a=0,d=0;if(i){s=i.width,l=i.height;const c=Ei();(!c||c&&e==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}return{width:s,height:l,x:a,y:d}}function k1(t,e){const n=Xt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ke(t)?ln(t):Mt(1),l=t.clientWidth*s.x,a=t.clientHeight*s.y,d=i*s.x,c=o*s.y;return{width:l,height:a,x:d,y:c}}function vd(t,e,n){let o;if(e==="viewport")o=_1(t,n);else if(e==="document")o=w1(ct(t));else if(ut(e))o=k1(e,n);else{const i=Cd(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return Xo(o)}function Dd(t,e){const n=sn(t);return n===e||!ut(n)||Ko(n)?!1:Te(n).position==="fixed"||Dd(n,e)}function C1(t,e){const n=e.get(t);if(n)return n;let o=Xn(t,[],!1).filter(a=>ut(a)&&dt(a)!=="body"),i=null;const s=Te(t).position==="fixed";let l=s?sn(t):t;for(;ut(l)&&!Ko(l);){const a=Te(l),d=Bi(l);!d&&a.position==="fixed"&&(i=null),(s?!d&&!i:!d&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||qn(l)&&!d&&Dd(t,l))?o=o.filter(u=>u!==l):i=a,l=sn(l)}return e.set(t,o),o}function x1(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?C1(e,this._c):[].concat(n),o],a=l[0],d=l.reduce((c,u)=>{const f=vd(e,u,i);return c.top=Gt(f.top,c.top),c.right=rn(f.right,c.right),c.bottom=rn(f.bottom,c.bottom),c.left=Gt(f.left,c.left),c},vd(e,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function S1(t){const{width:e,height:n}=kd(t);return{width:e,height:n}}function v1(t,e,n){const o=Ke(e),i=ct(e),s=n==="fixed",l=Xt(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const d=Mt(0);if(o||!o&&!s)if((dt(e)!=="body"||qn(i))&&(a=Zo(e)),o){const f=Xt(e,!0,s,e);d.x=f.x+e.clientLeft,d.y=f.y+e.clientTop}else i&&(d.x=Sd(i));const c=l.left+a.scrollLeft-d.x,u=l.top+a.scrollTop-d.y;return{x:c,y:u,width:l.width,height:l.height}}function Md(t,e){return!Ke(t)||Te(t).position==="fixed"?null:e?e(t):t.offsetParent}function Vd(t,e){const n=Fe(t);if(!Ke(t)||xd(t))return n;let o=Md(t,e);for(;o&&h1(o)&&Te(o).position==="static";)o=Md(o,e);return o&&(dt(o)==="html"||dt(o)==="body"&&Te(o).position==="static"&&!Bi(o))?n:o||m1(t)||n}const D1=async function(t){const e=this.getOffsetParent||Vd,n=this.getDimensions;return{reference:v1(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}};function M1(t){return Te(t).direction==="rtl"}const V1={convertOffsetParentRelativeRectToViewportRelativeRect:y1,getDocumentElement:ct,getClippingRect:x1,getOffsetParent:Vd,getElementRects:D1,getClientRects:$1,getDimensions:S1,getScale:ln,isElement:ut,isRTL:M1};function B1(t,e){let n=null,o;const i=ct(t);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),s();const{left:c,top:u,width:f,height:h}=t.getBoundingClientRect();if(a||e(),!f||!h)return;const m=Uo(u),p=Uo(i.clientWidth-(c+f)),g=Uo(i.clientHeight-(u+h)),b=Uo(c),k={rootMargin:-m+"px "+-p+"px "+-g+"px "+-b+"px",threshold:Gt(0,rn(1,d))||1};let M=!0;function w(_){const F=_[0].intersectionRatio;if(F!==d){if(!M)return l();F?l(!1,F):o=setTimeout(()=>{l(!1,1e-7)},100)}M=!1}try{n=new IntersectionObserver(w,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,k)}n.observe(t)}return l(!0),s}function Kn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=Pi(t),u=i||s?[...c?Xn(c):[],...Xn(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=c&&a?B1(c,n):null;let h=-1,m=null;l&&(m=new ResizeObserver(y=>{let[k]=y;k&&k.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var M;(M=m)==null||M.observe(e)})),n()}),c&&!d&&m.observe(c),m.observe(e));let p,g=d?Xt(t):null;d&&b();function b(){const y=Xt(t);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,p=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(k=>{i&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,d&&cancelAnimationFrame(p)}}const Bd=f1,Zn=c1,E1=d1,P1=(t,e,n)=>{const o=new Map,i={platform:V1,...n},s={...i.platform,_c:o};return a1(t,e,{...i,platform:s})};function N1(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ni(t){if(N1(t)){const e=t.$el;return Vi(e)&&dt(e)==="#comment"?null:e}return t}function Ed(t){return{name:"arrow",options:t,fn(e){const n=Ni(r.unref(t.element));return n==null?{}:E1({element:n,padding:t.padding}).fn(e)}}}function Pd(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Nd(t,e){const n=Pd(t);return Math.round(e*n)/n}function Jn(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=r.computed(()=>{var $;return($=r.unref(n.open))!=null?$:!0}),s=r.computed(()=>r.unref(n.middleware)),l=r.computed(()=>{var $;return($=r.unref(n.placement))!=null?$:"bottom"}),a=r.computed(()=>{var $;return($=r.unref(n.strategy))!=null?$:"absolute"}),d=r.computed(()=>{var $;return($=r.unref(n.transform))!=null?$:!0}),c=r.computed(()=>Ni(t.value)),u=r.computed(()=>Ni(e.value)),f=r.ref(0),h=r.ref(0),m=r.ref(a.value),p=r.ref(l.value),g=r.shallowRef({}),b=r.ref(!1),y=r.computed(()=>{const $={position:m.value,left:"0",top:"0"};if(!u.value)return $;const S=Nd(u.value,f.value),D=Nd(u.value,h.value);return d.value?{...$,transform:"translate("+S+"px, "+D+"px)",...Pd(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:S+"px",top:D+"px"}});let k;function M(){c.value==null||u.value==null||P1(c.value,u.value,{middleware:s.value,placement:l.value,strategy:a.value}).then($=>{f.value=$.x,h.value=$.y,m.value=$.strategy,p.value=$.placement,g.value=$.middlewareData,b.value=!0})}function w(){typeof k=="function"&&(k(),k=void 0)}function _(){if(w(),o===void 0){M();return}if(c.value!=null&&u.value!=null){k=o(c.value,u.value,M);return}}function F(){i.value||(b.value=!1)}return r.watch([s,l,a],M,{flush:"sync"}),r.watch([c,u],_,{flush:"sync"}),r.watch(i,F,{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(w),{x:r.shallowReadonly(f),y:r.shallowReadonly(h),strategy:r.shallowReadonly(m),placement:r.shallowReadonly(p),middlewareData:r.shallowReadonly(g),isPositioned:r.shallowReadonly(b),floatingStyles:y,update:M}}const Fd=r.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},placement:{default:"top"},hideArrow:{type:Boolean,default:!1},content:{default:""},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=r.ref(null),o=r.ref(null),i=r.ref(null),{floatingStyles:s,middlewareData:l,placement:a}=Jn(n,o,{whileElementsMounted:Kn,placement:e.placement,middleware:[Zn(),Gn({mainAxis:6}),Ed({element:i})]}),d=r.ref(!1),c=r.ref(0),u=r.ref(0),f=()=>{e.disabled||(clearTimeout(u.value),c.value=window.setTimeout(()=>{d.value=!0},250))},h=()=>{e.disabled||(clearTimeout(c.value),u.value=window.setTimeout(()=>d.value=!1,250))},m=()=>{clearTimeout(u.value),d.value=!0},p=r.computed(()=>{var b,y,k,M;const g={top:"bottom",right:"left",bottom:"top",left:"right"}[a.value];return{left:((b=l.value.arrow)==null?void 0:b.x)!=null?`${(y=l.value.arrow)==null?void 0:y.x}px`:"",top:((k=l.value.arrow)==null?void 0:k.y)!=null?`${(M=l.value.arrow)==null?void 0:M.y}px`:"",[g]:"-3px"}});return(g,b)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"referenceEl",ref:n,class:r.normalizeClass([{"cursor-not-allowed pointer-events-none":g.disabled},"cursor-pointer flex items-center justify-center relative w-max"]),onPointerdown:h,onPointerleave:h,onPointermove:b[0]||(b[0]=y=>{y.pointerType!=="touch"&&f()}),onPointerup:h},[r.renderSlot(g.$slots,"default")],34),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[d.value&&!g.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"tooltipContent",ref:o,class:r.normalizeClass([{"bg-fm-color-neutral-black text-fm-color-typo-white fm-typo-body-sm-400":g.variant==="plain","bg-fm-color-neutral-white text-fm-color-typo-secondary fm-typo-body-md-400":g.variant==="rich"},"fm-shadow-light-300 max-w-[240px] px-8 py-4 rounded-md"]),style:r.normalizeStyle(r.unref(s)),onMouseenter:m,onMouseleave:h},[r.renderSlot(g.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(g.content),1)]),r.withDirectives(r.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:r.normalizeClass([{"bg-fm-color-neutral-black":g.variant==="plain","bg-fm-color-neutral-white":g.variant==="rich"},"absolute h-8 rotate-45 rounded-[2px] w-8"]),style:r.normalizeStyle(p.value)},null,6),[[r.vShow,!g.hideArrow]])],38)):r.createCommentVNode("",!0)]))]))}}),Kt=r.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:void 0},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1);return(i,s)=>i.label||i.$slots.default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 flex gap-4",o.value?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":i.info}])},[r.renderSlot(i.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(i.label),1),i.required?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["fm-typo-body-lg-700",o.value?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):r.createCommentVNode("",!0),i.optional?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-md-400",o.value?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):r.createCommentVNode("",!0),i.info?(r.openBlock(),r.createBlock(Fd,{key:2,content:i.info,disabled:o.value,placement:"top"},{default:r.withCtx(()=>[r.createVNode(H,{class:r.normalizeClass(["fm-typo-body-md-400",o.value?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"]),name:"info",size:"sm"},null,8,["class"])]),_:1},8,["content","disabled"])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)}}),F1={key:1,class:"flex items-center justify-between"},_e=r.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:void 0},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,n=r.inject(ye),{errorMessages:o,isPristine:i}=Us(e),{focus:s,blur:l}=bn(),a=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),d=r.computed(()=>({label:e.label,disabled:a.value,required:e.required,optional:e.optional,info:e.info})),c=r.computed(()=>({text:e.helperText,disabled:a.value,state:e.helperState,errorMessages:o.value})),u=r.computed(()=>({isPristine:i,invalid:o.value.length>0}));return(f,h)=>(r.openBlock(),r.createBlock(e.tag,{class:"flex flex-col gap-4",onBlur:r.unref(l),onClick:r.unref(s)},{default:r.withCtx(()=>[f.label||f.$slots.label?(r.openBlock(),r.createBlock(Kt,r.normalizeProps(r.mergeProps({key:0},d.value)),{default:r.withCtx(()=>[r.renderSlot(f.$slots,"label")]),_:3},16)):r.createCommentVNode("",!0),r.renderSlot(f.$slots,"default",r.normalizeProps(r.guardReactiveProps(u.value))),c.value.text||c.value.errorMessages.length>0||f.$slots["helper-text"]||f.$slots["helper-append"]?(r.openBlock(),r.createElementBlock("div",F1,[r.createVNode(pd,r.normalizeProps(r.guardReactiveProps(c.value)),{default:r.withCtx(()=>[r.renderSlot(f.$slots,"helper-text")]),_:3},16),r.renderSlot(f.$slots,"helper-append")])):r.createCommentVNode("",!0)]),_:3},8,["onBlur","onClick"]))}}),Ze=J(r.defineComponent({__name:"FmMenu",props:{placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1},trigger:{default:"click"},closeOnClick:{type:Boolean,default:!0},width:{default:void 0},maxHeight:{default:408},inPopover:{type:Boolean,default:!1},stopClickPropagation:{type:Boolean},zIndex:{default:99}},emits:["menu-changed"],setup(t,{emit:e}){const n=t,o=e,i=r.ref([]);let s;const l=r.ref(),a=r.ref(!1),d=r.ref(!1),c=r.inject(Ts,null),u=r.ref(null),f=r.ref(null),{floatingStyles:h}=Jn(u,f,{middleware:[Gn({mainAxis:c?8:4,crossAxis:c?-12:0}),Zn({crossAxis:!1,fallbackStrategy:"initialPlacement"}),Bd()],placement:n.placement,whileElementsMounted:Kn,strategy:"fixed"}),m=()=>{_.value==="hover"&&g()},p=$=>{if(n.stopClickPropagation&&$.stopPropagation(),!n.disabled){if(a.value){a.value=!1;return}_.value==="click"&&g()}},g=()=>{d.value=!0,a.value=!0,c==null||c.setChildId(s)},b=()=>{_.value==="hover"&&(d.value=!1)},y=()=>{d.value=!0},k=()=>{d.value=!1},M=()=>{n.closeOnClick&&setTimeout(()=>{a.value=!1,c==null||c.closeParent()},10)},w=r.computed(()=>({mouseInMenu:d}));r.provide(Ts,{register({injectProps:$}){return i.value=[...i.value,{injectProps:$}],i.value.length},closeParent(){c?(a.value=!1,c==null||c.closeParent()):a.value=_.value!=="click"},setChildId($){l.value=$},mouseInChildId:l,trigger:n.trigger}),r.provide(zs,{handleContentClick:M}),r.onMounted(()=>{window.addEventListener("click",F),c&&(s=c.register({injectProps:w}))}),r.onUnmounted(()=>{window.removeEventListener("click",F)}),r.watch(()=>c==null?void 0:c.mouseInChildId.value,$=>{$!==s&&(a.value=!1)});const _=r.computed(()=>c===null?n.trigger:"hover");r.watch(()=>a.value,()=>o("menu-changed",a.value));const F=$=>{if(!a.value)return;const S=$.path||$.composedPath();for(const D of S)if(D==u.value||D==f.value)return;a.value=!1};return($,S)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:u,class:"fm-menu",onClick:p,onMouseenter:m,onMouseleave:b},[r.renderSlot($.$slots,"menu-button",{},void 0,!0)],544),(r.openBlock(),r.createBlock(r.Teleport,{disabled:!!r.unref(c)||$.inPopover,to:"body"},[a.value?(r.openBlock(),r.createElementBlock("div",{key:0,id:"fm-menu",ref_key:"menuEl",ref:f,style:r.normalizeStyle({...r.unref(h),zIndex:n.zIndex}),class:"block",onMouseenter:y,onMouseleave:k},[r.renderSlot($.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",{style:r.normalizeStyle({"max-height":`${$.maxHeight}px`,width:`${$.width}px`}),class:"fm-menu__wrapper"},[r.renderSlot($.$slots,"default",{},void 0,!0)],4)],!0)],36)):r.createCommentVNode("",!0)],8,["disabled"]))]))}}),[["__scopeId","data-v-f3e9026f"]]),R1={class:"fm-menu-item--left"},A1={key:0,class:"fm-menu-item--right"},we=J(r.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=r.ref(!1),i=r.inject(zs,null),s=e,l=c=>{c.preventDefault(),i==null||i.handleContentClick(),!(n.disabled||!n.selectable)&&s("update:modelValue",!n.modelValue)},a=()=>{s("update:modelValue",n.modelValue)};function d(c){o.value=c}return(c,u)=>(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,"hover:bg-fm-color-opacity-sm":!c.disabled&&!c.modelValue&&c.selectable}),onClick:l,onMousedown:u[1]||(u[1]=()=>d(!0)),onMouseleave:u[2]||(u[2]=()=>d(!1)),onMouseup:u[3]||(u[3]=()=>d(!1))},[r.createElementVNode("div",R1,[r.renderSlot(c.$slots,"prepend",{},()=>[!c.hasCheckbox&&c.icon?(r.openBlock(),r.createBlock(H,{key:0,color:c.disabled?"#C7C7CC":c.modelValue?"#FF7823":"#1C1C1E",name:c.icon,outline:!o.value&&!c.modelValue,size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0),c.hasCheckbox?(r.openBlock(),r.createBlock(md,{key:1,disabled:c.disabled,indeterminate:c.indeterminate,"model-value":c.modelValue,label:"",name:"something",sublabel:"",value:"",onClick:u[0]||(u[0]=f=>f.preventDefault()),"onUpdate:modelValue":a},null,8,["disabled","indeterminate","model-value"])):r.createCommentVNode("",!0)],!0),r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-md-400 max-w-[240px]",c.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"])},r.toDisplayString(c.label),3),c.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-sm-400 ${c.disabled?"text-fm-color-typo-disabled":"text-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",A1,[r.createVNode(H,{color:c.disabled?"#C7C7CC":"#AEAEB2",name:"chevron_right",size:"md"},null,8,["color"])])):r.createCommentVNode("",!0)],34)]))}}),[["__scopeId","data-v-9a24e799"]]),O1={class:"fm-typo-body-lg-700"},I1={class:"h-[264px] overflow-y-auto w-[160px]"},T1=["onVnodeMounted"],z1=["onVnodeMounted"],an=r.defineComponent({__name:"FmDateRangeYearMonthPicker",props:{modelValue:{},picker:{},min:{},max:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>{const c=V(n.min).startOf("year"),u=V(n.max).startOf("year"),f=u.diff(c,"year"),h=[];for(let m=0;m<=f;m++)h.push(u.subtract(m,"year"));return h}),l=c=>{const u=V(n.min).startOf("month"),f=V(n.max).startOf("month");return c.get("year")===u.get("year")?c.startOf("month").isAfter(u)||c.get("month")===u.get("month"):c.get("year")===f.get("year")?c.startOf("month").isBefore(f)||c.get("month")===f.get("month"):!0},a=c=>{const u=V(n.min).startOf("month"),f=V(n.max).startOf("month");if(u.get("year")===c.get("year")){o("update:modelValue",u);return}if(f.get("year")===c.get("year")){o("update:modelValue",f);return}o("update:modelValue",c)};function d(c,u){if(!u)return!1;const f=c.el,h=f==null?void 0:f.parentElement;!f||!h||h.scrollTo({top:f.offsetTop-50})}return(c,u)=>(r.openBlock(),r.createBlock(Ze,{trigger:"click","in-popover":"",onMenuChanged:u[0]||(u[0]=f=>i.value=f)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-4 h-24 items-center px-8 rounded-sm",i.value?"text-fm-color-primary":"hover:bg-fm-color-neutral-gray-100"])},[r.createElementVNode("div",O1,[c.picker==="month"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(c.modelValue.format("MMMM")),1)],64)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(c.modelValue.format("YYYY")),1)],64)):r.createCommentVNode("",!0)]),r.createVNode(H,{name:i.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),default:r.withCtx(()=>[r.createElementVNode("ul",I1,[c.picker==="month"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(Array.from(Array(12),(f,h)=>c.modelValue.month(h)),f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("MMMM"),onVnodeMounted:h=>d(h,c.modelValue.format("MMMM")===f.format("MMMM"))},[r.createVNode(we,{disabled:!l(f),"model-value":c.modelValue.format("MMMM")===f.format("MMMM"),label:f.format("MMMM"),"onUpdate:modelValue":h=>o("update:modelValue",f)},null,8,["disabled","model-value","label","onUpdate:modelValue"])],8,T1))),128)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("YYYY"),onVnodeMounted:h=>d(h,c.modelValue.format("YYYY")===f.format("YYYY"))},[r.createVNode(we,{"model-value":c.modelValue.format("YYYY")===f.format("YYYY"),label:f.format("YYYY"),"onUpdate:modelValue":h=>a(f)},null,8,["model-value","label","onUpdate:modelValue"])],8,z1))),128)):r.createCommentVNode("",!0)])]),_:1}))}}),L1={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)}},Vt=J(r.defineComponent({__name:"FmPopover",props:{showPopover:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1},zIndex:{default:99},excludeElFromClickOutside:{default:void 0}},emits:["popover-changed"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref(o.showPopover),s=r.ref(null),l=r.ref(null),{floatingStyles:a}=Jn(s,l,{middleware:[Gn(4),Zn(),Bd({crossAxis:!0})],placement:o.placement,whileElementsMounted:Kn,strategy:"fixed"}),d=n,c=()=>{i.value||(i.value=!0,d("popover-changed",i.value))},u=()=>{i.value&&(i.value=!1,d("popover-changed",i.value))};e({show:c,hide:u});const f=()=>{o.disabled||(i.value=!i.value,d("popover-changed",i.value))};r.watch(()=>o.showPopover,m=>i.value=m);const h=()=>{i.value&&(i.value=!1,d("popover-changed",i.value))};return(m,p)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:s,class:"fm-popover",onClick:f},[r.renderSlot(m.$slots,"popover-button",{},void 0,!0)],512),i.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"popoverEl",ref:l,style:r.normalizeStyle({...r.unref(a),zIndex:o.zIndex}),class:"fm-popover__content"},[r.renderSlot(m.$slots,"default",{hide:u,show:c},void 0,!0)],4)):r.createCommentVNode("",!0)])),[[r.unref(L1),h,m.excludeElFromClickOutside]])}}),[["__scopeId","data-v-9454a3a4"]]),A="YYYY-MM-DD",Fi=t=>{const e=[],n=t.endOf("month"),o=t.month();let i=t.startOf("week"),s=[];for(;i.isBefore(n.endOf("week"));)i.day()===0&&s.length>0&&(e.push(s),s=[]),s.push({date:i,isCurrentMonth:i.month()===o}),i=i.add(1,"day");return s.length>0&&e.push(s),e},Rd=(t,e)=>{const n=V().startOf("month"),o=V(t).diff(n,"month"),i=V(e).diff(n,"month"),s=[];for(let l=o-1;l<=i;l++){const a=[],d=n.add(l,"month").startOf("month"),c=d.endOf("month"),u=d.month();let f=d.startOf("week"),h=[];for(;f.isBefore(c.endOf("week"));)f.day()===0&&h.length>0&&(a.push(h),h=[]),h.push({id:d.format("MM-YYYY"),date:f,isCurrentMonth:f.month()===u}),f=f.add(1,"day");h.length>0&&a.push(h),s.push({id:d.format("YYYY-MM-DD"),matrix:a,height:64+48*(c.endOf("week").diff(d.startOf("week"),"week")+1)})}return s},Qn=Array.from(Array(7),(t,e)=>V().day(e).format("ddd")),H1={class:"p-12 w-[360px]"},Y1={class:"w-max"},j1={class:"flex h-40 justify-between px-4 py-8"},W1={class:"flex gap-4 items-center"},U1={class:"flex gap-4 items-center justify-center"},G1={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},q1=["onClick"],X1={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},K1=J(r.defineComponent({__name:"FmDatePickerDesktop",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>V().subtract(50,"year").format(A)},max:{default:()=>V().add(25,"year").format(A)},zIndex:{default:void 0},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=q(e,"modelValue"),o=r.ref(V(n.value,A)),i=r.ref(!1),s=r.ref(V().startOf("month")),l=r.ref(!1),a=r.ref(!1),d=h=>{o.value=h},c=()=>{n.value=o.value.format(A),setTimeout(()=>{i.value=!1},0)},u=()=>{o.value=n.value?V(n.value):null,i.value=!1},f=h=>{l.value=!1,a.value=!1,s.value=h};return(h,m)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":m[5]||(m[5]=p=>r.isRef(n)?n.value=p:null),disabled:h.disabled,focused:i.value,"helper-state":h.helperState,"helper-text":h.helperText,info:h.labelInfo,label:h.label,optional:h.labelMark==="optional",required:h.labelMark==="required",rules:h.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(h.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:p})=>[r.createVNode(Vt,{disabled:h.disabled,"show-popover":i.value,"z-index":h.zIndex,onPopoverChanged:m[4]||(m[4]=g=>i.value=g)},{"popover-button":r.withCtx(()=>[h.$slots["trigger-button"]?r.renderSlot(h.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:p,opened:i.value,showValidBorder:h.showValidBorder})),void 0,!0):(r.openBlock(),r.createBlock(le,{key:1,focused:i.value,"icon-outlined":!i.value,invalid:p,"show-valid-border":h.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(h.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(h.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(n)?r.unref(V)(r.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","icon-outlined","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",H1,[r.createElementVNode("div",Y1,[r.createElementVNode("div",j1,[r.createElementVNode("div",W1,[r.createVNode(an,{max:h.max,min:h.min,"model-value":s.value,picker:"month","onUpdate:modelValue":m[0]||(m[0]=g=>f(g))},null,8,["max","min","model-value"]),r.createVNode(an,{max:h.max,min:h.min,"model-value":s.value,picker:"year","onUpdate:modelValue":m[1]||(m[1]=g=>f(g))},null,8,["max","min","model-value"])]),r.createElementVNode("div",U1,[r.createVNode(H,{outline:!1,class:"cursor-pointer",color:"#1C1C1E",name:"chevron_left",onClick:m[2]||(m[2]=()=>f(s.value.subtract(1,"month")))}),r.createVNode(H,{outline:!1,class:"cursor-pointer",color:"#1C1C1E",name:"chevron_right",onClick:m[3]||(m[3]=()=>f(s.value.add(1,"month")))})])]),r.createElementVNode("div",null,[r.createElementVNode("div",G1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),g=>(r.openBlock(),r.createElementBlock("div",{key:g,class:"fm-calendar__cell"},r.toDisplayString(g),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Fi)(s.value),(g,b)=>(r.openBlock(),r.createElementBlock("div",{key:b,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g,y=>(r.openBlock(),r.createElementBlock("div",{key:y.date.date(),class:"fm-calendar__cell"},[y.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass([{"fm-calendar__cell__button--selected":y.date.isSame(o.value)},"fm-calendar__cell__button"]),type:"button",onClick:()=>d(y.date)},r.toDisplayString(y.date.date()),11,q1)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",X1,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:!o.value,label:"Apply",size:"md",variant:"primary",onClick:c},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(h.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),[["__scopeId","data-v-72b81a03"]]),Ad=t=>(r.pushScopeId("data-v-be5ccc8e"),t=t(),r.popScopeId(),t),Z1={class:"flex flex-col gap-8 pb-8 pt-24 px-16"},J1={class:"flex items-center justify-center"},Q1={class:"flex fm-typo-body-lg-400 h-48 justify-center text-fm-color-typo-tertiary w-[336px]"},e2={class:"flex h-[calc(100%-208px)] justify-center relative w-full"},t2=Ad(()=>r.createElementVNode("div",{class:"absolute bg-gradient-to-b from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),n2={id:"wrapper",class:"h-full relative w-[336px]"},o2=["id"],r2={class:"flex gap-4 items-center"},i2={class:"fm-typo-body-lg-700"},s2={class:"fm-typo-body-lg-700"},l2=["onClick"],a2={class:"absolute bg-fm-color-neutral-white bottom-0 left-0 p-16 w-full"},d2=Ad(()=>r.createElementVNode("div",{class:"-top-32 absolute bg-gradient-to-t from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),c2={class:"flex gap-8 items-center justify-end w-full"},Od=J(r.defineComponent({__name:"FmDatePickerMobile",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>V().subtract(50,"year").format(A)},max:{default:()=>V().add(25,"year").format(A)},zIndex:{default:99},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=Rd(e.min,e.max),o=q(e,"modelValue"),i=V(),s=r.ref(V(o.value,A)),l=r.ref(!1),a=r.ref(),d=m=>{s.value=m},c=()=>{o.value=s.value.format(A),setTimeout(()=>{l.value=!1},0)},u=()=>{s.value=o.value?V(o.value):null,l.value=!1},f=()=>{l.value=!0,setTimeout(()=>{a.value.scrollToItem(h(i.startOf("month")))},0)},h=m=>n.findIndex(p=>p.id===m.startOf("month").format(A));return(m,p)=>{const g=r.resolveComponent("RecycleScroller");return r.openBlock(),r.createBlock(_e,{modelValue:r.unref(o),"onUpdate:modelValue":p[0]||(p[0]=b=>r.isRef(o)?o.value=b:null),disabled:m.disabled,focused:l.value,"helper-state":m.helperState,"helper-text":m.helperText,info:m.labelInfo,label:m.label,optional:m.labelMark==="optional",required:m.labelMark==="required",rules:m.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:b})=>[m.$slots["trigger-button"]?(r.openBlock(),r.createElementBlock("div",{key:0,onClick:f},[r.renderSlot(m.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps({invalid:b,opened:l.value,showValidBorder:m.showValidBorder})),void 0,!0)])):(r.openBlock(),r.createBlock(le,{key:1,focused:l.value,invalid:b,"show-valid-border":m.showValidBorder,class:"cursor-pointer","icon-outlined":"","prepend-icon":"calendar_month",onClick:f},{prepend:r.withCtx(()=>[r.renderSlot(m.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(m.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(o)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(o)?r.unref(V)(r.unref(o)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])),l.value?(r.openBlock(),r.createBlock(r.Teleport,{key:2,to:"body"},[r.createElementVNode("div",{class:"bg-fm-color-neutral-white fixed flex flex-col h-screen left-0 top-0 w-screen",style:r.normalizeStyle({zIndex:e.zIndex})},[r.createElementVNode("div",Z1,[r.createVNode(le,{focused:l.value,invalid:b,"show-valid-border":m.showValidBorder,"icon-outlined":"","prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(m.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(m.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var y,k;return[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":(y=s.value)!=null&&y.isValid()?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString((k=s.value)!=null&&k.isValid()?r.unref(V)(s.value).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["focused","invalid","show-valid-border"]),r.createElementVNode("div",J1,[r.createElementVNode("div",Q1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),y=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"fm-calendar__cell"},r.toDisplayString(y),1))),128))])])]),r.createElementVNode("div",e2,[t2,r.createElementVNode("div",n2,[r.createVNode(g,{ref_key:"scroller",ref:a,buffer:200,"item-size":null,items:r.unref(n),class:"h-full no-scrollbar overflow-y-auto w-full","key-field":"id","size-field":"height"},{default:r.withCtx(({item:y})=>[r.createElementVNode("div",{id:y.id,class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},[r.createElementVNode("div",r2,[r.createElementVNode("div",i2,r.toDisplayString(r.unref(V)(y.id).format("MMMM")),1),r.createElementVNode("div",s2,r.toDisplayString(r.unref(V)(y.id).format("YYYY")),1)])],8,o2),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.matrix,(k,M)=>(r.openBlock(),r.createElementBlock("div",{key:M,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k,w=>(r.openBlock(),r.createElementBlock("div",{key:w.date.date(),class:"fm-calendar__cell"},[w.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass([{"fm-calendar__cell__button--selected":w.date.isSame(s.value),"fm-typo-body-lg-700":w.date.isSame(r.unref(i),"day")},"fm-calendar__cell__button"]),type:"button",onClick:()=>d(w.date)},r.toDisplayString(w.date.date()),11,l2)):r.createCommentVNode("",!0)]))),128))]))),128))])]),_:1},8,["items"])])]),r.createElementVNode("div",a2,[d2,r.createElementVNode("div",c2,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:!s.value,label:"Apply",size:"md",variant:"primary",onClick:c},null,8,["disabled"])])])],4)])):r.createCommentVNode("",!0)]),"helper-text":r.withCtx(()=>[r.renderSlot(m.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"])}}}),[["__scopeId","data-v-be5ccc8e"]]),Jo=t=>{const e=r.inject(ye);return r.computed(()=>{const n=t.disabled??(e==null?void 0:e.getDisabled())??!1;return{...t,disabled:n}})},u2=r.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>V().subtract(50,"year").format(A)},max:{default:()=>V().add(25,"year").format(A)},zIndex:{default:void 0},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const{breakpoints:e}=yt(),n=t,o=q(n,"modelValue"),i=Jo(n);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(e).md||r.unref(e).lg?(r.openBlock(),r.createBlock(K1,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(e).xs||r.unref(e).sm?(r.openBlock(),r.createBlock(Od,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}}),Id=r.defineComponent({__name:"FmMenuDivider",props:{vertical:{type:Boolean,default:!1},inset:{type:Boolean,default:!1}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["border-fm-color-neutral-gray-100 rounded-sm",[e.vertical?"border-l -my-4 mx-4":"border-t -mx-4 my-4",{"my-0":e.inset&&e.vertical,"mx-0":e.inset&&!e.vertical}]])},null,2))}}),f2={class:"cursor-pointer fm-switch__container"},h2={key:0},m2={class:"fm-typo-body-lg-400"},p2={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},g2={class:"fm-switch__input--container"},b2=["checked","disabled","value"],y2={key:1},$2={class:"fm-typo-body-lg-400"},w2={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Ri=J(r.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{default:null},disabled:{type:Boolean,default:void 0},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=()=>{o.value||(i.value=!i.value)};return(l,a)=>(r.openBlock(),r.createElementBlock("label",f2,[l.labelPlacement==="left"?(r.openBlock(),r.createElementBlock("div",h2,[r.renderSlot(l.$slots,"label",{},void 0,!0),r.createElementVNode("div",m2,r.toDisplayString(l.label),1),l.sublabel?(r.openBlock(),r.createElementBlock("div",p2,r.toDisplayString(l.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",g2,[r.createElementVNode("input",{checked:r.unref(i),disabled:o.value,value:l.value,class:"fm-switch__input--btn",type:"checkbox",onClick:s},null,8,b2),r.createElementVNode("div",{class:r.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":l.showIcon})},[l.showIcon?(r.openBlock(),r.createBlock(H,{key:0,color:o.value?"#C7C7CC":r.unref(i)?"#1C1C1E":"#FFFFFF",name:r.unref(i)?"check":"close",size:"sm"},null,8,["color","name"])):r.createCommentVNode("",!0)],2)]),l.labelPlacement==="right"?(r.openBlock(),r.createElementBlock("div",y2,[r.createElementVNode("div",$2,r.toDisplayString(l.label),1),l.sublabel?(r.openBlock(),r.createElementBlock("div",w2,r.toDisplayString(l.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-fcd3e9f2"]]);var be=(t=>(t.PrecedingPeriod="preceding_period",t.PrecedingWeek="preceding_week",t.PrecedingMonth="preceding_month",t.Custom="custom",t))(be||{});const Td=t=>(r.pushScopeId("data-v-99b24dd6"),t=t(),r.popScopeId(),t),_2={key:0,class:"flex gap-4 items-center relative w-full"},k2={class:"flex flex-col gap-4 w-full"},C2=Td(()=>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)),x2={class:"flex flex-col gap-4 w-full"},S2={key:1,class:"flex flex-col gap-4 w-full"},v2={class:"flex gap-4 p-12"},D2={key:0,class:"max-h-[549px] overflow-y-auto w-[171px]"},M2={key:0,class:"px-8"},V2={key:1,class:"-my-12 border-fm-color-neutral-gray-100 border-l shrink-0"},B2={class:"flex flex-col gap-24"},E2={key:0,class:"flex gap-4 items-center px-12 w-full"},P2={class:"flex flex-col gap-4 w-full"},N2=Td(()=>r.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," - ",-1)),F2={class:"flex flex-col gap-4 w-full"},R2={class:"flex gap-24"},A2={class:"w-max"},O2={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},I2={class:"flex gap-4 items-center"},T2={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},z2={class:"h-[288px]"},L2={key:0,class:"fm-calendar__cell__button--today"},H2=["onClick","onMouseover"],Y2={class:"w-max"},j2={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},W2={class:"flex gap-4 items-center"},U2={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},G2={key:0,class:"fm-calendar__cell__button--today"},q2=["onClick","onMouseover"],X2={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},K2=J(r.defineComponent({__name:"FmDateRangePickerDesktop",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:V().format(A),endDate:V().format(A)}},{label:"Yesterday",value:{startDate:V().subtract(1,"day").format(A),endDate:V().subtract(1,"day").format(A)}},{label:"This week",value:{startDate:V().startOf("week").format(A),endDate:V().endOf("week").format(A)}},{label:"Last week",value:{startDate:V().subtract(1,"week").startOf("week").format(A),endDate:V().subtract(1,"week").endOf("week").format(A)}},{label:"Last 7 days",value:{startDate:V().subtract(7,"day").format(A),endDate:V().subtract(1,"day").format(A)}},{label:"This month",value:{startDate:V().startOf("month").format(A),endDate:V().endOf("month").format(A)}},{label:"Last month",value:{startDate:V().subtract(1,"month").startOf("month").format(A),endDate:V().subtract(1,"month").endOf("month").format(A)}},{label:"This year",value:{startDate:V().startOf("year").format(A),endDate:V().endOf("year").format(A)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},min:{default:()=>V().subtract(50,"year").format(A)},max:{default:()=>V().add(25,"year").format(A)},zIndex:{default:void 0},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var D,v;const e=[{id:be.PrecedingPeriod,label:"Preceding period",sublabel:"",action:()=>{d.value=be.PrecedingPeriod;const x=s.value;if(x[0].startDate&&x[0].endDate){const C=x[0].startDate.diff(x[0].endDate,"day");x[1]={startDate:x[0].startDate.subtract(+(1-C),"day"),endDate:x[0].startDate.subtract(1,"day")}}}},{id:be.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:()=>{d.value=be.PrecedingWeek;const x=s.value;if(x[0].startDate&&x[0].endDate){let C=x[0].endDate.diff(x[0].startDate,"week");C===0&&(C+=1),x[1]={startDate:x[0].startDate.subtract(C,"week"),endDate:x[0].endDate.subtract(C,"week")}}}},{id:be.PrecedingMonth,label:"Preceding period",sublabel:"Match day of month",action:()=>{d.value=be.PrecedingMonth;const x=s.value;if(x[0].startDate&&x[0].endDate){let C=x[0].endDate.diff(x[0].startDate,"month");C===0&&(C+=1),x[1]={startDate:x[0].startDate.subtract(C,"month"),endDate:x[0].endDate.subtract(C,"month")}}}},{id:be.Custom,label:"Custom",sublabel:"",action:()=>{d.value=be.Custom}}],n=t,o=V(),i=q(n,"modelValue"),s=r.ref([{startDate:(D=i.value)!=null&&D.startDate?V(i.value.startDate,A):null,endDate:(v=i.value)!=null&&v.endDate?V(i.value.endDate,A):null},{startDate:null,endDate:null}]),l=r.ref(!1),a=r.ref(!1),d=r.ref(""),c=r.ref(V().startOf("month")),u=r.ref(V().startOf("month").add(1,"month")),f=r.ref(""),h=r.ref(null);let m=0;const p=x=>{var C;if(f.value="",s.value[m].startDate&&s.value[m].endDate){m===1&&(s.value=s.value.map(()=>({startDate:null,endDate:null})),m=0),s.value[0]={startDate:x,endDate:null};return}else if(!s.value[m].startDate&&!s.value[m].endDate)s.value[m].startDate=x;else{if(x.isBefore(s.value[m].startDate)){const N=s.value[m].startDate;s.value[m]={startDate:x,endDate:N}}else s.value[m].endDate=x;a.value&&(m=1),e.find(N=>N.id===d.value)||(d.value=be.Custom)}(C=e.find(N=>N.id===d.value))==null||C.action()},g=()=>{a.value?i.value=s.value.map(x=>({startDate:x.startDate.format(A),endDate:x.endDate.format(A)})):i.value={startDate:s.value[0].startDate.format(A),endDate:s.value[0].endDate.format(A)},setTimeout(()=>{l.value=!1})},b=()=>{var x,C;Array.isArray(i.value)?s.value=i.value:s.value[0]={startDate:(x=i.value)!=null&&x.startDate?V(i.value.startDate,A):null,endDate:(C=i.value)!=null&&C.endDate?V(i.value.endDate,A):null},l.value=!1},y=(x,C)=>{x==="left"?(c.value=C,u.value=C.add(1,"month")):x==="right"&&(u.value=C,c.value=C.subtract(1,"month"))},k=x=>{const C=s.value[0].startDate,N=s.value[0].endDate,E=s.value[1].startDate,P=s.value[1].endDate,B=h.value,R=C==null?void 0:C.isSame(x),O=N==null?void 0:N.isSame(x),L=E==null?void 0:E.isSame(x),z=P==null?void 0:P.isSame(x),W=B==null?void 0:B.isSame(x),X=R&&N&&!(R&&O)||C&&!N&&R&&(B==null?void 0:B.isAfter(C))||C&&!N&&W&&(B==null?void 0:B.isBefore(C)),K=L&&P&&!(L&&z)||E&&!P&&L&&(B==null?void 0:B.isAfter(E))||E&&!P&&W&&(B==null?void 0:B.isBefore(E)),ee=O&&C&&!(R&&O)||C&&!N&&R&&(B==null?void 0:B.isBefore(C))||C&&!N&&W&&(B==null?void 0:B.isAfter(C)),ae=z&&E&&!(L&&z)||E&&!P&&L&&(B==null?void 0:B.isBefore(E))||E&&!P&&W&&(B==null?void 0:B.isAfter(E)),pe=R&&O||R&&!N,Ae=L&&z||L&&!P,Ue=C&&(N||B)&&N?x.isAfter(C)&&x.isBefore(N):x.isAfter(B)&&x.isBefore(C)||x.isBefore(B)&&x.isAfter(C),Oe=E&&(P||B)&&P?x.isAfter(E)&&x.isBefore(P):x.isAfter(B)&&x.isBefore(E)||x.isBefore(B)&&x.isAfter(E),he=()=>{if(s.value.filter(pt=>{var et;for(const kr in pt)if((et=pt[kr])!=null&&et.isSame(x,"day"))return!0;return!1}).length===2)return"bg-fm-color-system-success-400 before:bg-fm-color-system-success-100";if(R&&O&&(fe(x,E,P)||fe(x,E,B)))return"bg-fm-color-primary before:bg-fm-color-system-info-100 after:bg-fm-color-system-info-100";if(L&&z&&(fe(x,C,N)||fe(x,C,B)))return"bg-fm-color-system-info-300 before:bg-fm-color-system-warning-100 after:bg-fm-color-system-warning-100";if(X||ee)return fe(x,E,P)||fe(x,E,B)?"bg-fm-color-primary before:bg-fm-color-system-success-100 after:bg-fm-color-system-info-100":"bg-fm-color-primary before:bg-fm-color-system-warning-100";if(K||ae)return fe(x,C,N)||fe(x,C,B)?"bg-fm-color-system-info-300 before:bg-fm-color-system-success-100 after:bg-fm-color-system-warning-100":"bg-fm-color-system-info-300 before:bg-fm-color-system-info-100";if(pe)return"bg-fm-color-primary";if(Ae)return"bg-fm-color-system-info-300";if(fe(x,C,N)&&(fe(x,E,P)||fe(x,E,B)))return"bg-fm-color-system-success-100";if(Ue)return"bg-fm-color-system-warning-100";if(Oe)return"bg-fm-color-system-info-100"};return{[`fm-calendar__cell__button--selected-start ${he()}`]:X||K,[`fm-calendar__cell__button--selected-end ${he()}`]:ee||ae,[`fm-calendar__cell__button--selected-between ${he()}`]:Ue||Oe,[`fm-calendar__cell__button--selected ${he()}`]:pe||Ae}},M=x=>{const C=s.value;if(C[0].startDate&&!C[0].endDate||C[1].startDate&&!C[1].endDate){h.value=x;return}h.value=null},w=x=>{f.value=x.label,s.value[0]={startDate:V(x.value.startDate,A),endDate:V(x.value.endDate,A)}},_=r.computed(()=>a.value?!s.value.every(x=>x.startDate&&x.endDate):!(s.value[0].startDate&&s.value[0].endDate)),F=x=>{d.value="",a.value=x,s.value=Array.from(Array(2),()=>({startDate:null,endDate:null})),m=0},$=r.computed(()=>{if(!i.value)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const x=a.value&&Array.isArray(i.value)?i.value[0].startDate:i.value.startDate,C=a.value&&Array.isArray(i.value)?i.value[0].endDate:i.value.endDate;return{startDate:x?V(x).format("D MMM YYYY"):"DD MM YYYY",endDate:C?V(C).format("D MMM YYYY"):"DD MM YYYY"}}),S=r.computed(()=>{const x=a.value&&Array.isArray(i.value)?i.value[1].startDate:null,C=a.value&&Array.isArray(i.value)?i.value[1].endDate:null;return x&&C?`Compared: ${V(x).format("D MMM YYYY")} - ${V(C).format("D MMM YYYY")}`:""});return r.watch(()=>i.value,()=>{var x,C;a.value?s.value=i.value.map(N=>({startDate:N!=null&&N.startDate?V(N.startDate,A):null,endDate:N!=null&&N.endDate?V(N.endDate,A):null})):s.value[0]={startDate:(x=i.value)!=null&&x.startDate?V(i.value.startDate,A):null,endDate:(C=i.value)!=null&&C.endDate?V(i.value.endDate,A):null}}),(x,C)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":C[8]||(C[8]=N=>r.isRef(i)?i.value=N:null),disabled:x.disabled,focused:l.value,"helper-state":x.helperState,"helper-text":a.value?S.value:x.helperText,rules:x.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:N})=>[r.createVNode(Vt,{disabled:x.disabled,"show-popover":l.value,"z-index":n.zIndex,onPopoverChanged:C[7]||(C[7]=E=>l.value=E)},{"popover-button":r.withCtx(()=>[x.$slots["trigger-button"]?r.renderSlot(x.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{opened:l.value,invalid:N,showValidBorder:x.showValidBorder,isComparing:a.value})),void 0,!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[x.compare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",_2,[r.createElementVNode("label",k2,[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(n.startLabel),3),r.createVNode(le,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,"icon-outlined":!l.value,invalid:N,"show-valid-border":x.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var E;return[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString((E=r.unref(i))!=null&&E.startDate?r.unref(V)(r.unref(i).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])]),C2,r.createElementVNode("label",x2,[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(n.endLabel),3),r.createVNode(le,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,"icon-outlined":!l.value,invalid:N,"show-valid-border":x.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var E;return[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled":$.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString((E=r.unref(i))!=null&&E.endDate?r.unref(V)(r.unref(i).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])])])),x.compare?(r.openBlock(),r.createElementBlock("label",S2,[r.createVNode(Kt,{label:x.compareLabel},null,8,["label"]),r.createVNode(le,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,invalid:N,"show-valid-border":x.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled":$.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString($.value.startDate)+" - "+r.toDisplayString($.value.endDate),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])])):r.createCommentVNode("",!0)],64))]),default:r.withCtx(()=>[r.createElementVNode("div",v2,[x.showPredefinedRange?(r.openBlock(),r.createElementBlock("div",D2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.predefinedRange,(E,P)=>(r.openBlock(),r.createBlock(we,{key:P,label:E.label,"model-value":f.value===E.label,selectable:"",onClick:B=>w(E)},null,8,["label","model-value","onClick"]))),128)),x.compare&&x.predefinedRange?(r.openBlock(),r.createElementBlock("div",M2,[r.createVNode(Id,{inset:""})])):r.createCommentVNode("",!0),x.compare?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(Ri,{"model-value":a.value,class:"justify-between px-12",label:"Compare","onUpdate:modelValue":C[0]||(C[0]=E=>F(E))},null,8,["model-value"]),a.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},r.renderList(e,(E,P)=>r.createVNode(we,{key:P,label:E.label,"model-value":d.value===E.id,sublabel:E.sublabel,selectable:"",onClick:B=>E.action()},null,8,["label","model-value","sublabel","onClick"])),64)):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x.showPredefinedRange?(r.openBlock(),r.createElementBlock("div",V2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass({"pl-4":x.showPredefinedRange})},[r.createElementVNode("div",B2,[a.value?(r.openBlock(),r.createElementBlock("div",E2,[r.createElementVNode("label",P2,[r.createVNode(Kt,{label:"Custom"}),r.createVNode(le,{focused:!1},{default:r.withCtx(()=>{var E,P;return[r.createElementVNode("div",{class:r.normalizeClass([[(E=s.value[0])!=null&&E.startDate&&((P=s.value[0])!=null&&P.endDate)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(s.value[0].startDate!==null?s.value[0].startDate.format("D MMM YYYY"):"DD MM YYYY")+" - "+r.toDisplayString(s.value[0].endDate!==null?s.value[0].endDate.format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:1})]),N2,r.createElementVNode("label",F2,[r.createVNode(Kt,{label:"Compare"}),r.createVNode(le,{focused:!1},{default:r.withCtx(()=>{var E,P;return[r.createElementVNode("div",{class:r.normalizeClass([[(E=s.value[1])!=null&&E.startDate&&((P=s.value[1])!=null&&P.endDate)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(s.value[1].startDate!==null?s.value[1].startDate.format("D MMM YYYY"):"DD MM YYYY")+" - "+r.toDisplayString(s.value[1].endDate!==null?s.value[1].endDate.format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:1})])])):r.createCommentVNode("",!0),r.createElementVNode("div",R2,[r.createElementVNode("div",A2,[r.createElementVNode("div",O2,[r.createElementVNode("div",I2,[r.createVNode(H,{outline:!1,class:"cursor-pointer select-none",color:"#1C1C1E",name:"chevron_left",onClick:C[1]||(C[1]=()=>y("left",c.value.subtract(1,"month")))}),r.createVNode(an,{max:x.max,min:x.min,"model-value":c.value,picker:"month","onUpdate:modelValue":C[2]||(C[2]=E=>y("left",E))},null,8,["max","min","model-value"]),r.createVNode(an,{max:x.max,min:x.min,"model-value":c.value,picker:"year","onUpdate:modelValue":C[3]||(C[3]=E=>y("left",E))},null,8,["max","min","model-value"])])]),r.createElementVNode("div",null,[r.createElementVNode("div",T2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),E=>(r.openBlock(),r.createElementBlock("div",{key:E,class:"fm-calendar__cell"},r.toDisplayString(E),1))),128))]),r.createElementVNode("div",z2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Fi)(c.value),(E,P)=>(r.openBlock(),r.createElementBlock("div",{key:P,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E,B=>(r.openBlock(),r.createElementBlock("div",{key:B.date.date(),class:"fm-calendar__cell"},[B.date.isSame(r.unref(o),"day")&&B.isCurrentMonth?(r.openBlock(),r.createElementBlock("div",L2)):r.createCommentVNode("",!0),B.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:1,class:r.normalizeClass([[k(B.date),{"fm-typo-body-lg-700":B.date.isSame(r.unref(o),"day")}],"fm-calendar__cell__button"]),type:"button",onClick:()=>p(B.date),onMouseover:R=>M(B.date)},r.toDisplayString(B.date.date()),43,H2)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",Y2,[r.createElementVNode("div",j2,[r.createElementVNode("div",W2,[r.createVNode(an,{max:x.max,min:x.min,"model-value":u.value,picker:"month","onUpdate:modelValue":C[4]||(C[4]=E=>y("right",E))},null,8,["max","min","model-value"]),r.createVNode(an,{max:x.max,min:x.min,"model-value":u.value,picker:"year","onUpdate:modelValue":C[5]||(C[5]=E=>y("right",E))},null,8,["max","min","model-value"])]),r.createVNode(H,{outline:!1,class:"cursor-pointer select-none",color:"#1C1C1E",name:"chevron_right",onClick:C[6]||(C[6]=()=>y("left",c.value.add(1,"month")))})]),r.createElementVNode("div",null,[r.createElementVNode("div",U2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),E=>(r.openBlock(),r.createElementBlock("div",{key:E,class:"fm-calendar__cell"},r.toDisplayString(E),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Fi)(u.value),(E,P)=>(r.openBlock(),r.createElementBlock("div",{key:P,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E,B=>(r.openBlock(),r.createElementBlock("div",{key:B.date.date(),class:"fm-calendar__cell"},[B.date.isSame(r.unref(o),"day")&&B.isCurrentMonth?(r.openBlock(),r.createElementBlock("div",G2)):r.createCommentVNode("",!0),B.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:1,class:r.normalizeClass([[k(B.date),{"fm-typo-body-lg-700":B.date.isSame(r.unref(o),"day")}],"fm-calendar__cell__button"]),type:"button",onClick:()=>p(B.date),onMouseover:R=>M(B.date)},r.toDisplayString(B.date.date()),43,q2)):r.createCommentVNode("",!0)]))),128))]))),128))])])])])]),r.createElementVNode("div",X2,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:b}),r.createVNode(U,{disabled:_.value,label:"Apply",size:"md",variant:"primary",onClick:g},null,8,["disabled"])])],2)])]),_:2},1032,["disabled","show-popover","z-index"])]),_:2},[x.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(x.$slots,"helper-text",{},void 0,!0)]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"]))}}),[["__scopeId","data-v-99b24dd6"]]),Z2={class:"flex flex-col gap-4"},J2=["id"],Q2={class:"flex flex-col gap-4 justify-center"},dn=J(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},maxHeight:{default:408},width:{default:void 0},menuId:{},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","dropdown-changed"],setup(t,{emit:e}){const n=t,o=r.inject(ye),i=e,s=q(n,"modelValue"),l=r.ref(!1),a=r.computed(()=>n.disabled??(o==null?void 0:o.getDisabled())??!1),d=(p,g)=>{if(n.multiselect){let b=[];p?b=s.value.length===0?[g]:n.items.filter(y=>s.value.some(k=>Se(y.value,k)||Se(y.value,g.value))):b=n.items.filter(y=>s.value.some(k=>Se(y.value,k)&&!Se(y.value,g.value))),s.value=b.map(y=>y.value)}else s.value=g.value,setTimeout(()=>{l.value=!1},0)},c=p=>{const g=[...s.value].filter((b,y)=>y!==p);s.value=g},u=r.computed(()=>n.multiselect?n.items.filter(p=>r.toRaw(s.value).some(g=>Se(g,p.value))):n.items.filter(p=>Se(s.value,p.value))),f=r.computed(()=>n.items.filter(p=>s.value.some(g=>Se(p.value,g))).map(p=>({label:p.label}))),h=r.computed(()=>{var p;return n.multiselect?n.placeholder:((p=n.items.find(g=>Se(g.value,s.value)))==null?void 0:p.label)??n.placeholder}),m=r.computed(()=>n.multiselect?s.value.length!==0:n.items.some(p=>Se(p.value,s.value)));return(p,g)=>(r.openBlock(),r.createElementBlock("div",Z2,[r.createVNode(_e,{modelValue:r.unref(s),"onUpdate:modelValue":g[1]||(g[1]=b=>r.isRef(s)?s.value=b:null),disabled:a.value,focused:l.value,"helper-state":p.helperState,"helper-text":p.helperText,info:p.labelInfo,label:p.label,optional:p.labelMark==="optional",required:p.labelMark==="required",rules:p.rules},r.createSlots({default:r.withCtx(({invalid:b})=>[r.createVNode(Ze,{"close-on-click":!p.multiselect,disabled:a.value,placement:p.placement,"show-menu":l.value,onMenuChanged:g[0]||(g[0]=y=>{l.value=y,i("dropdown-changed",l.value)})},{"menu-button":r.withCtx(()=>[r.createVNode(le,{class:r.normalizeClass(a.value?"cursor-not-allowed":"cursor-pointer"),focused:l.value,invalid:b,"show-valid-border":p.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(p.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.createVNode(H,{color:a.value?"#C7C7CC":"black",name:l.value?"expand_less":"expand_more",size:"md"},null,8,["color","name"])]),default:r.withCtx(()=>[r.renderSlot(p.$slots,"default",{},()=>[r.createElementVNode("div",{class:r.normalizeClass([[a.value?"text-fm-color-typo-disabled":m.value?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"break-all fm-typo-body-lg-400 line-clamp-1"])},r.toDisplayString(h.value),3)],!0)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",{id:p.menuId,style:r.normalizeStyle({"max-height":`${p.maxHeight}px`,width:`${p.width}px`}),class:"fm-select__menu__wrapper"},[r.renderSlot(p.$slots,"menu-wrapper",{handleItemChange:(y,k)=>d(y,k)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.items,y=>(r.openBlock(),r.createBlock(we,{key:y.value,"has-checkbox":p.multiselect,label:y.label,sublabel:y.sublabel,"model-value":u.value.some(k=>r.unref(Se)(k.value,y.value)),value:y.value,"onUpdate:modelValue":k=>d(k,y)},null,8,["has-checkbox","label","sublabel","model-value","value","onUpdate:modelValue"]))),128))],!0)],12,J2)]),_:2},1032,["close-on-click","disabled","placement","show-menu"])]),_:2},[p.label||p.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(p.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,p.helperText||p.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text",{},void 0,!0)]),key:"1"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]),r.createElementVNode("div",Q2,[p.multiselect&&u.value.length>0?(r.openBlock(),r.createBlock(Pr,{key:0,disabled:a.value,items:f.value,removable:"",onChipClosed:c},null,8,["disabled","items"])):r.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-533e5bc9"]]),eb={key:0},tb={class:"flex gap-4 items-center relative w-full"},nb={class:"flex flex-col gap-4 w-full"},ob=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),rb={class:"flex flex-col gap-4 w-full"},ib={key:1,class:"flex flex-col gap-4 w-full"},Ai=r.defineComponent({__name:"FmDateRangePickerField",props:{modelValue:{},analytic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},isComparing:{type:Boolean,default:!1},startLabel:{default:"Start date"},endLabel:{default:"End date"},compareLabel:{default:"Date"}},setup(t){const e=t,n=r.computed(()=>{if(!e.modelValue)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const o=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].startDate:e.modelValue.startDate,i=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].endDate:e.modelValue.endDate;return{startDate:o?V(o).format("D MMM YYYY"):"DD MM YYYY",endDate:i?V(i).format("D MMM YYYY"):"DD MM YYYY"}});return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[o.analytic?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",eb,[r.renderSlot(o.$slots,"popover-button",{},()=>[r.createElementVNode("div",tb,[r.createElementVNode("label",nb,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400 line-clamp-1",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.startLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.startDate?r.unref(V)(o.modelValue.startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])]),ob,r.createElementVNode("label",rb,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.endLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.endDate?r.unref(V)(o.modelValue.endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])])])])])),o.analytic?(r.openBlock(),r.createElementBlock("label",ib,[r.createVNode(Kt,{label:o.compareLabel},null,8,["label"]),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":n.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(n.value.startDate)+" - "+r.toDisplayString(n.value.endDate),3)]),_:3},8,["class","focused","invalid","show-valid-border"])])):r.createCommentVNode("",!0)]))}}),zd=t=>(r.pushScopeId("data-v-b19edd50"),t=t(),r.popScopeId(),t),sb={class:"flex flex-col gap-8 pb-8 pt-24 px-16"},lb={class:"flex items-center justify-center"},ab={class:"flex fm-typo-body-lg-400 h-48 justify-center text-fm-color-typo-tertiary w-[336px]"},db={class:"flex h-[calc(100%-172px)] justify-center relative w-full"},cb=zd(()=>r.createElementVNode("div",{class:"absolute bg-gradient-to-b from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),ub={id:"wrapper",class:"h-full relative w-[336px]"},fb=["id"],hb={class:"flex gap-4 items-center"},mb={class:"fm-typo-body-lg-700"},pb={class:"fm-typo-body-lg-700"},gb=["onClick","onMouseover"],bb={class:"absolute bg-fm-color-neutral-white bottom-0 left-0 p-16 w-full"},yb=zd(()=>r.createElementVNode("div",{class:"-top-32 absolute bg-gradient-to-t from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),$b={class:"flex gap-8 items-center justify-end w-full"},Ld=J(r.defineComponent({__name:"FmDateRangePickerMobile",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:V().format(A),endDate:V().format(A)}},{label:"Yesterday",value:{startDate:V().subtract(1,"day").format(A),endDate:V().subtract(1,"day").format(A)}},{label:"This week",value:{startDate:V().startOf("week").format(A),endDate:V().endOf("week").format(A)}},{label:"Last week",value:{startDate:V().subtract(1,"week").startOf("week").format(A),endDate:V().subtract(1,"week").endOf("week").format(A)}},{label:"Last 7 days",value:{startDate:V().subtract(7,"day").format(A),endDate:V().subtract(1,"day").format(A)}},{label:"This month",value:{startDate:V().startOf("month").format(A),endDate:V().endOf("month").format(A)}},{label:"Last month",value:{startDate:V().subtract(1,"month").startOf("month").format(A),endDate:V().subtract(1,"month").endOf("month").format(A)}},{label:"This year",value:{startDate:V().startOf("year").format(A),endDate:V().endOf("year").format(A)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},min:{default:()=>V().subtract(50,"year").format(A)},max:{default:()=>V().add(25,"year").format(A)},zIndex:{default:100},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var v,x;const e=r.ref(),n=[{id:be.PrecedingPeriod,label:"Preceding period",sublabel:"",action:()=>{u.value=be.PrecedingPeriod;const C=a.value;if(C[0].startDate&&C[0].endDate){const N=C[0].startDate.diff(C[0].endDate,"day");C[1]={startDate:C[0].startDate.subtract(+(1-N),"day"),endDate:C[0].startDate.subtract(1,"day")}}}},{id:be.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:()=>{u.value=be.PrecedingWeek;const C=a.value;if(C[0].startDate&&C[0].endDate){let N=C[0].endDate.diff(C[0].startDate,"week");N===0&&(N+=1),C[1]={startDate:C[0].startDate.subtract(N,"week"),endDate:C[0].endDate.subtract(N,"week")}}}},{id:be.PrecedingMonth,label:"Preceding period",sublabel:"Match day of month",action:()=>{u.value=be.PrecedingMonth;const C=a.value;if(C[0].startDate&&C[0].endDate){let N=C[0].endDate.diff(C[0].startDate,"month");N===0&&(N+=1),C[1]={startDate:C[0].startDate.subtract(N,"month"),endDate:C[0].endDate.subtract(N,"month")}}}},{id:be.Custom,label:"Custom",sublabel:"",action:()=>{u.value=be.Custom}}],o=t,i=Rd(o.min,o.max),s=V(),l=q(o,"modelValue"),a=r.ref([{startDate:(v=l.value)!=null&&v.startDate?V(l.value.startDate,A):null,endDate:(x=l.value)!=null&&x.endDate?V(l.value.endDate,A):null},{startDate:null,endDate:null}]),d=r.ref(!1),c=r.ref(!1),u=r.ref(""),f=r.ref(""),h=r.ref(null);let m=0;const p=C=>{var N;if(f.value="",a.value[m].startDate&&a.value[m].endDate){m===1&&(a.value=a.value.map(()=>({startDate:null,endDate:null})),m=0),a.value[0]={startDate:C,endDate:null};return}else if(!a.value[m].startDate&&!a.value[m].endDate)a.value[m].startDate=C;else{if(C.isBefore(a.value[m].startDate)){const E=a.value[m].startDate;a.value[m]={startDate:C,endDate:E}}else a.value[m].endDate=C;c.value&&(m=1),n.find(E=>E.id===u.value)||(u.value=be.Custom)}(N=n.find(E=>E.id===u.value))==null||N.action()},g=()=>{c.value?l.value=a.value.map(C=>({startDate:C.startDate.format(A),endDate:C.endDate.format(A)})):l.value={startDate:a.value[0].startDate.format(A),endDate:a.value[0].endDate.format(A)},setTimeout(()=>{d.value=!1})},b=()=>{var C,N;Array.isArray(l.value)?a.value=l.value:a.value[0]={startDate:(C=l.value)!=null&&C.startDate?V(l.value.startDate,A):null,endDate:(N=l.value)!=null&&N.endDate?V(l.value.endDate,A):null},d.value=!1},y=C=>{const N=a.value[0].startDate,E=a.value[0].endDate,P=a.value[1].startDate,B=a.value[1].endDate,R=h.value,O=N==null?void 0:N.isSame(C),L=E==null?void 0:E.isSame(C),z=P==null?void 0:P.isSame(C),W=B==null?void 0:B.isSame(C),X=R==null?void 0:R.isSame(C),K=O&&E&&!(O&&L)||N&&!E&&O&&(R==null?void 0:R.isAfter(N))||N&&!E&&X&&(R==null?void 0:R.isBefore(N)),ee=z&&B&&!(z&&W)||P&&!B&&z&&(R==null?void 0:R.isAfter(P))||P&&!B&&X&&(R==null?void 0:R.isBefore(P)),ae=L&&N&&!(O&&L)||N&&!E&&O&&(R==null?void 0:R.isBefore(N))||N&&!E&&X&&(R==null?void 0:R.isAfter(N)),pe=W&&P&&!(z&&W)||P&&!B&&z&&(R==null?void 0:R.isBefore(P))||P&&!B&&X&&(R==null?void 0:R.isAfter(P)),Ae=O&&L||O&&!E,Ue=z&&W||z&&!B,Oe=N&&(E||R)&&E?C.isAfter(N)&&C.isBefore(E):C.isAfter(R)&&C.isBefore(N)||C.isBefore(R)&&C.isAfter(N),he=P&&(B||R)&&B?C.isAfter(P)&&C.isBefore(B):C.isAfter(R)&&C.isBefore(P)||C.isBefore(R)&&C.isAfter(P),Ee=()=>{if(a.value.filter(et=>{var kr;for(const Dk in et)if((kr=et[Dk])!=null&&kr.isSame(C,"day"))return!0;return!1}).length===2)return"bg-fm-color-system-success-400 before:bg-fm-color-system-success-100";if(O&&L&&(fe(C,P,B)||fe(C,P,R)))return"bg-fm-color-primary before:bg-fm-color-system-info-100 after:bg-fm-color-system-info-100";if(z&&W&&(fe(C,N,E)||fe(C,N,R)))return"bg-fm-color-system-info-300 before:bg-fm-color-system-warning-100 after:bg-fm-color-system-warning-100";if(K||ae)return fe(C,P,B)||fe(C,P,R)?"bg-fm-color-primary before:bg-fm-color-system-success-100 after:bg-fm-color-system-info-100":"bg-fm-color-primary before:bg-fm-color-system-warning-100";if(ee||pe)return fe(C,N,E)||fe(C,N,R)?"bg-fm-color-system-info-300 before:bg-fm-color-system-success-100 after:bg-fm-color-system-warning-100":"bg-fm-color-system-info-300 before:bg-fm-color-system-info-100";if(Ae)return"bg-fm-color-primary";if(Ue)return"bg-fm-color-system-info-300";if(fe(C,N,E)&&(fe(C,P,B)||fe(C,P,R)))return"bg-fm-color-system-success-100";if(Oe)return"bg-fm-color-system-warning-100";if(he)return"bg-fm-color-system-info-100"};return{[`fm-calendar__cell__button--selected-start ${Ee()}`]:K||ee,[`fm-calendar__cell__button--selected-end ${Ee()}`]:ae||pe,[`fm-calendar__cell__button--selected-between ${Ee()}`]:Oe||he,[`fm-calendar__cell__button--selected ${Ee()}`]:Ae||Ue}},k=C=>{const N=a.value;if(N[0].startDate&&!N[0].endDate||N[1].startDate&&!N[1].endDate){h.value=C;return}h.value=null},M=C=>{a.value[0]={startDate:V(C.startDate,A),endDate:V(C.endDate,A)}},w=C=>{const N=n.find(E=>E.id===C);N==null||N.action()},_=r.computed(()=>c.value?!a.value.every(C=>C.startDate&&C.endDate):!(a.value[0].startDate&&a.value[0].endDate)),F=C=>{u.value="",c.value=C,a.value=Array.from(Array(2),()=>({startDate:null,endDate:null})),m=0},$=r.computed(()=>{const C=c.value&&Array.isArray(l.value)?l.value[1].startDate:null,N=c.value&&Array.isArray(l.value)?l.value[1].endDate:null;return C&&N?`Compared: ${V(C).format("D MMM YYYY")} - ${V(N).format("D MMM YYYY")}`:""}),S=()=>{d.value=!0,setTimeout(()=>{e.value.scrollToItem(D(s.startOf("month")))},0)},D=C=>i.findIndex(N=>N.id===C.startOf("month").format(A));return r.watch(()=>l.value,()=>{var C,N;c.value?a.value=l.value.map(E=>({startDate:E!=null&&E.startDate?V(E.startDate,A):null,endDate:E!=null&&E.endDate?V(E.endDate,A):null})):a.value[0]={startDate:(C=l.value)!=null&&C.startDate?V(l.value.startDate,A):null,endDate:(N=l.value)!=null&&N.endDate?V(l.value.endDate,A):null}}),(C,N)=>{const E=r.resolveComponent("RecycleScroller");return r.openBlock(),r.createBlock(_e,{modelValue:r.unref(l),"onUpdate:modelValue":N[3]||(N[3]=P=>r.isRef(l)?l.value=P:null),disabled:C.disabled,focused:d.value,"helper-state":C.helperState,"helper-text":c.value?$.value:C.helperText,rules:C.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:P})=>{var B,R,O,L;return[C.$slots["trigger-button"]?(r.openBlock(),r.createElementBlock("div",{key:0,onClick:S},[r.renderSlot(C.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps({opened:d.value,invalid:P,showValidBorder:C.showValidBorder,isComparing:c.value})),void 0,!0)])):(r.openBlock(),r.createBlock(Ai,{key:1,analytic:C.compare,"compare-label":C.compareLabel,disabled:C.disabled,"end-label":C.endLabel,focused:d.value,invalid:P,"is-comparing":c.value,"model-value":r.unref(l),"show-valid-border":C.showValidBorder,"start-label":C.startLabel,onClick:S},r.createSlots({_:2},[C.$slots["popover-button"]?{name:"popover-button",fn:r.withCtx(()=>[r.renderSlot(C.$slots,"popover-button",{focused:d.value},void 0,!0)]),key:"0"}:void 0]),1032,["analytic","compare-label","disabled","end-label","focused","invalid","is-comparing","model-value","show-valid-border","start-label"])),d.value?(r.openBlock(),r.createBlock(r.Teleport,{key:2,to:"body"},[r.createElementVNode("div",{class:"bg-fm-color-neutral-white fixed flex flex-col h-screen left-0 top-0 w-screen",style:r.normalizeStyle({zIndex:o.zIndex})},[r.createElementVNode("div",sb,[C.showPredefinedRange?(r.openBlock(),r.createBlock(dn,{key:0,items:C.predefinedRange,"model-value":f.value,"onUpdate:modelValue":N[0]||(N[0]=z=>M(z))},null,8,["items","model-value"])):r.createCommentVNode("",!0),r.createVNode(Ai,{analytic:C.compare,"compare-label":C.compareLabel,"end-label":C.endLabel,"is-comparing":c.value,"model-value":{startDate:((B=a.value[0].startDate)==null?void 0:B.format(r.unref(A)))??null,endDate:((R=a.value[0].endDate)==null?void 0:R.format(r.unref(A)))??null},"start-label":C.startLabel},null,8,["analytic","compare-label","end-label","is-comparing","model-value","start-label"]),C.compare?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(Ri,{"model-value":c.value,label:"Compare","label-placement":"right","onUpdate:modelValue":N[1]||(N[1]=z=>F(z))},null,8,["model-value"]),c.value&&C.compare?(r.openBlock(),r.createBlock(dn,{key:0,items:n.map(z=>({label:z.label,sublabel:z.sublabel,value:z.id})),"model-value":u.value,"onUpdate:modelValue":N[2]||(N[2]=z=>w(z))},null,8,["items","model-value"])):r.createCommentVNode("",!0),c.value&&C.compare?(r.openBlock(),r.createBlock(Ai,{key:1,analytic:C.compare,"end-label":C.endLabel,"is-comparing":c.value,"model-value":{startDate:((O=a.value[1].startDate)==null?void 0:O.format(r.unref(A)))??null,endDate:((L=a.value[1].endDate)==null?void 0:L.format(r.unref(A)))??null},"start-label":C.startLabel,"compare-label":"Compare: Custom"},null,8,["analytic","end-label","is-comparing","model-value","start-label"])):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0),r.createElementVNode("div",lb,[r.createElementVNode("div",ab,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),z=>(r.openBlock(),r.createElementBlock("div",{key:z,class:"fm-calendar__cell"},r.toDisplayString(z),1))),128))])])]),r.createElementVNode("div",db,[cb,r.createElementVNode("div",ub,[r.createVNode(E,{ref_key:"scroller",ref:e,buffer:200,"item-size":null,items:r.unref(i),class:"h-full no-scrollbar overflow-y-auto w-full","key-field":"id","size-field":"height"},{default:r.withCtx(({item:z})=>[r.createElementVNode("div",{id:z.id,class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},[r.createElementVNode("div",hb,[r.createElementVNode("div",mb,r.toDisplayString(r.unref(V)(z.id).format("MMMM")),1),r.createElementVNode("div",pb,r.toDisplayString(r.unref(V)(z.id).format("YYYY")),1)])],8,fb),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.matrix,(W,X)=>(r.openBlock(),r.createElementBlock("div",{key:X,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(W,K=>(r.openBlock(),r.createElementBlock("div",{key:K.date.date(),class:"fm-calendar__cell"},[K.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass([[y(K.date),{"fm-typo-body-lg-700":K.date.isSame(r.unref(s),"day")}],"fm-calendar__cell__button"]),type:"button",onClick:()=>p(K.date),onMouseover:ee=>k(K.date)},r.toDisplayString(K.date.date()),43,gb)):r.createCommentVNode("",!0)]))),128))]))),128))])]),_:1},8,["items"])])]),r.createElementVNode("div",bb,[yb,r.createElementVNode("div",$b,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:b}),r.createVNode(U,{disabled:_.value,label:"Apply",size:"md",variant:"primary",onClick:g},null,8,["disabled"])])])],4)])):r.createCommentVNode("",!0)]}),_:2},[C.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(C.$slots,"helper-text",{},void 0,!0)]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"])}}}),[["__scopeId","data-v-b19edd50"]]),wb=r.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:void 0},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:V().format(A),endDate:V().format(A)}},{label:"Yesterday",value:{startDate:V().subtract(1,"day").format(A),endDate:V().subtract(1,"day").format(A)}},{label:"This week",value:{startDate:V().startOf("week").format(A),endDate:V().endOf("week").format(A)}},{label:"Last week",value:{startDate:V().subtract(1,"week").startOf("week").format(A),endDate:V().subtract(1,"week").endOf("week").format(A)}},{label:"Last 7 days",value:{startDate:V().subtract(7,"day").format(A),endDate:V().subtract(1,"day").format(A)}},{label:"This month",value:{startDate:V().startOf("month").format(A),endDate:V().endOf("month").format(A)}},{label:"Last month",value:{startDate:V().subtract(1,"month").startOf("month").format(A),endDate:V().subtract(1,"month").endOf("month").format(A)}},{label:"This year",value:{startDate:V().startOf("year").format(A),endDate:V().endOf("year").format(A)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},min:{default:()=>V().subtract(50,"year").format(A)},max:{default:()=>V().add(25,"year").format(A)},zIndex:{},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,{breakpoints:n}=yt(),o=q(e,"modelValue"),i=Jo(e);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(n).md||r.unref(n).lg?(r.openBlock(),r.createBlock(K2,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(n).xs||r.unref(n).sm?(r.openBlock(),r.createBlock(Ld,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}}),I="YYYY-MM-DD",cn=t=>{const e=[],n=t.endOf("month"),o=t.month();let i=t.startOf("week"),s=[];for(;i.isBefore(n.endOf("week"));)i.day()===0&&s.length>0&&(e.push(s),s=[]),s.push({date:i,isCurrentMonth:i.month()===o}),i=i.add(1,"day");return s.length>0&&e.push(s),e.length<6&&e.push([]),e},_b=Array.from(Array(7),(t,e)=>V().day(e).format("ddd")),Hd=(t,e)=>({startAt:t?V(t,I):null,endAt:e?V(e,I):null}),kb={class:"fm-typo-body-md-700"},Cb={class:"h-[264px] overflow-y-auto w-[160px]"},xb=["onVnodeMounted"],Sb=["onVnodeMounted"],ze=r.defineComponent({__name:"FmDateRangeYearMonthPicker",props:{modelValue:{},picker:{},min:{},max:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>{const c=V(n.min).startOf("year"),u=V(n.max).startOf("year"),f=u.diff(c,"year"),h=[];for(let m=0;m<=f;m++)h.push(u.subtract(m,"year"));return h}),l=c=>{const u=V(n.min).startOf("month"),f=V(n.max).startOf("month");return c.get("year")===u.get("year")?c.startOf("month").isAfter(u)||c.get("month")===u.get("month"):c.get("year")===f.get("year")?c.startOf("month").isBefore(f)||c.get("month")===f.get("month"):!0},a=c=>{const u=V(n.min).startOf("month"),f=V(n.max).startOf("month");if(u.get("year")===c.get("year")){o("update:modelValue",u);return}if(f.get("year")===c.get("year")){o("update:modelValue",f);return}o("update:modelValue",c)};function d(c,u){if(!u)return!1;const f=c.el,h=f==null?void 0:f.parentElement;!f||!h||h.scrollTo({top:f.offsetTop-50})}return(c,u)=>(r.openBlock(),r.createBlock(Ze,{trigger:"click","in-popover":"",onMenuChanged:u[0]||(u[0]=f=>i.value=f)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-4 h-24 items-center px-4 rounded-sm",i.value?"text-fm-color-primary":"hover:bg-fm-color-neutral-gray-100"])},[r.createElementVNode("div",kb,[c.picker==="month"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(c.modelValue.format("MMMM")),1)],64)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(c.modelValue.format("YYYY")),1)],64)):r.createCommentVNode("",!0)]),r.createVNode(H,{name:i.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),default:r.withCtx(()=>[r.createElementVNode("ul",Cb,[c.picker==="month"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(Array.from(Array(12),(f,h)=>c.modelValue.month(h)),f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("MMMM"),onVnodeMounted:h=>d(h,c.modelValue.format("MMMM")===f.format("MMMM"))},[r.createVNode(we,{disabled:!l(f),"model-value":c.modelValue.format("MMMM")===f.format("MMMM"),label:f.format("MMMM"),"onUpdate:modelValue":h=>o("update:modelValue",f)},null,8,["disabled","model-value","label","onUpdate:modelValue"])],8,xb))),128)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("YYYY"),onVnodeMounted:h=>d(h,c.modelValue.format("YYYY")===f.format("YYYY"))},[r.createVNode(we,{"model-value":c.modelValue.format("YYYY")===f.format("YYYY"),label:f.format("YYYY"),"onUpdate:modelValue":h=>a(f)},null,8,["model-value","label","onUpdate:modelValue"])],8,Sb))),128)):r.createCommentVNode("",!0)])]),_:1}))}}),vb={class:"fm-calendar__name-row fm-typo-body-md-400 text-fm-color-typo-tertiary"},Db=["id"],Mb={key:0,class:"fm-calendar__cell__button--today"},Vb=["onClick","onMouseover"],un=J(r.defineComponent({__name:"FmCalendar",props:{days:{},dayCellClass:{type:[Object,Function],default:void 0},onDayClick:{},onCellMouseOver:{type:Function,default:void 0},cellSize:{default:"md"}},setup(t){const e=V(),n=(i,s)=>typeof i=="function"?i(...s):i,o=(i,s)=>{if(!s)return;const l={"fm-calendar__cell--selected":!1,"fm-calendar__cell--selected-start":!1,"fm-calendar__cell--selected-end":!1,"fm-calendar__cell--selected-between":!1};let a;if(typeof s=="function"){const{status:d,className:c}=s(i);d&&(l["fm-calendar__cell--selected"]=d.isSelected??!1,l["fm-calendar__cell--selected-start"]=d.isStart??!1,l["fm-calendar__cell--selected-end"]=d.isEnd??!1,l["fm-calendar__cell--selected-between"]=d.isBetween??!1),a=c??""}else{const{status:d,className:c}=s;d&&(l["fm-calendar__cell--selected"]=n(d.isSelected,[i])??!1,l["fm-calendar__cell--selected-start"]=n(d.isStart,[i])??!1,l["fm-calendar__cell--selected-end"]=n(d.isEnd,[i])??!1,l["fm-calendar__cell--selected-between"]=n(d.isBetween,[i])??!1),a=n(c,[i])??""}return[l,a]};return(i,s)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",vb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(_b),l=>(r.openBlock(),r.createElementBlock("div",{key:l,class:r.normalizeClass(["fm-calendar__cell",`fm-calendar__cell__${i.cellSize}`])},r.toDisplayString(l),3))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.days,(l,a)=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"fm-calendar__row fm-typo-body-md-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l,d=>(r.openBlock(),r.createElementBlock("div",{id:`${d.date.toISOString()}`,key:d.date.date(),class:r.normalizeClass(["fm-calendar__cell",[`fm-calendar__cell__${i.cellSize}`,o(d.date,i.dayCellClass),!d.isCurrentMonth&&"fm-calendar__cell--not-current-month"]])},[d.date.isSame(r.unref(e),"day")&&d.isCurrentMonth?(r.openBlock(),r.createElementBlock("div",Mb)):r.createCommentVNode("",!0),d.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:1,class:"fm-calendar__cell__button",type:"button",onClick:c=>i.onDayClick(d),onMouseover:c=>{var u;return(u=i.onCellMouseOver)==null?void 0:u.call(i,d.date)}},r.toDisplayString(d.date.date()),41,Vb)):r.createCommentVNode("",!0)],10,Db))),128))]))),128))])]))}}),[["__scopeId","data-v-0942b815"]]),Bb={class:"p-12 space-y-4 w-[552px]"},Eb={class:"w-max"},Pb={class:"flex space-x-24"},Nb={class:"flex items-center py-8 space-x-16"},Fb={class:"flex space-x-4"},Rb={class:"flex items-center justify-end py-8 space-x-16"},Ab={class:"flex space-x-4"},Ob={class:"flex gap-8 items-center justify-end w-full"},Ib=r.defineComponent({__name:"FmSimpleDatePickerDesktop",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>V().subtract(50,"year").format(I)},max:{default:()=>V().add(25,"year").format(I)},zIndex:{default:void 0},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=q(e,"modelValue"),o=r.ref(V(n.value,I)),i=r.ref(!1),s=r.ref(V().startOf("month")),l=r.ref(V().startOf("month").add(1,"month")),a=(p,g)=>{p==="left"?(s.value=g,l.value=g.add(1,"month")):p==="right"&&(l.value=g,s.value=g.subtract(1,"month"))},d=p=>{o.value=p},c=r.computed(()=>cn(s.value)),u=r.computed(()=>cn(s.value.add(1,"month"))),f=()=>{n.value=o.value.format(I),setTimeout(()=>{i.value=!1},0)},h=()=>{o.value=n.value?V(n.value):null,i.value=!1},m=p=>{i.value=p,p||h()};return(p,g)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":g[6]||(g[6]=b=>r.isRef(n)?n.value=b:null),disabled:p.disabled,focused:i.value,"helper-state":p.helperState,"helper-text":p.helperText,info:p.labelInfo,label:p.label,optional:p.labelMark==="optional",required:p.labelMark==="required",rules:p.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(p.$slots,"label")]),default:r.withCtx(({invalid:b})=>[r.createVNode(Vt,{disabled:p.disabled,"show-popover":i.value,"z-index":e.zIndex,onPopoverChanged:m},{"popover-button":r.withCtx(()=>[p.$slots["trigger-button"]?r.renderSlot(p.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:b,opened:i.value,showValidBorder:p.showValidBorder}))):(r.openBlock(),r.createBlock(le,{key:1,focused:i.value,"icon-outlined":!i.value,invalid:b,"show-valid-border":p.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(p.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(p.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(n)?r.unref(V)(r.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","icon-outlined","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",Bb,[r.createElementVNode("div",Eb,[r.createElementVNode("div",Pb,[r.createElementVNode("div",null,[r.createElementVNode("div",Nb,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:g[0]||(g[0]=()=>a("left",s.value.subtract(1,"month")))}),r.createElementVNode("div",Fb,[r.createVNode(ze,{max:p.max,min:p.min,"model-value":s.value,picker:"month","onUpdate:modelValue":g[1]||(g[1]=y=>a("left",y))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:p.max,min:p.min,"model-value":s.value,picker:"year","onUpdate:modelValue":g[2]||(g[2]=y=>a("left",y))},null,8,["max","min","model-value"])])]),r.createVNode(un,{days:c.value,"on-day-click":y=>d(y.date),"day-cell-class":{status:{isSelected:y=>y.isSame(o.value,"date")}}},null,8,["days","on-day-click","day-cell-class"])]),r.createElementVNode("div",null,[r.createElementVNode("div",Rb,[r.createElementVNode("div",Ab,[r.createVNode(ze,{max:p.max,min:p.min,"model-value":l.value,picker:"month","onUpdate:modelValue":g[3]||(g[3]=y=>a("right",y))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:p.max,min:p.min,"model-value":l.value,picker:"year","onUpdate:modelValue":g[4]||(g[4]=y=>a("right",y))},null,8,["max","min","model-value"])]),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:g[5]||(g[5]=()=>a("left",s.value.add(1,"month")))})]),r.createVNode(un,{days:u.value,"on-day-click":y=>d(y.date),"day-cell-class":{status:{isSelected:y=>y.isSame(o.value,"date")}}},null,8,["days","on-day-click","day-cell-class"])])])]),r.createElementVNode("div",Ob,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),r.createVNode(U,{disabled:!o.value,label:"Apply",size:"md",variant:"primary",onClick:f},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),Tb={class:"p-12 space-y-4 w-[276px]"},zb={class:"w-max"},Lb={class:"flex space-x-24"},Hb={class:"flex items-center justify-between py-8"},Yb={class:"flex space-x-4"},jb={class:"flex space-x-4"},Wb={class:"flex gap-8 items-center justify-end w-full"},Yd=r.defineComponent({__name:"FmSimpleDatePickerMobile",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>V().subtract(50,"year").format(I)},max:{default:()=>V().add(25,"year").format(I)},zIndex:{default:void 0},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=q(e,"modelValue"),o=r.ref(V(n.value,I)),i=r.ref(!1),s=r.ref(V().startOf("month")),l=h=>{s.value=h},a=h=>{o.value=h},d=r.computed(()=>cn(s.value)),c=()=>{n.value=o.value.format(I),setTimeout(()=>{i.value=!1},0)},u=()=>{o.value=n.value?V(n.value):null,i.value=!1},f=h=>{i.value=h,h||u()};return(h,m)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":m[4]||(m[4]=p=>r.isRef(n)?n.value=p:null),disabled:h.disabled,focused:i.value,"helper-state":h.helperState,"helper-text":h.helperText,info:h.labelInfo,label:h.label,optional:h.labelMark==="optional",required:h.labelMark==="required",rules:h.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(h.$slots,"label")]),default:r.withCtx(({invalid:p})=>[r.createVNode(Vt,{disabled:h.disabled,"show-popover":i.value,"z-index":e.zIndex,onPopoverChanged:f},{"popover-button":r.withCtx(()=>[h.$slots["trigger-button"]?r.renderSlot(h.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:p,opened:i.value,showValidBorder:h.showValidBorder}))):(r.openBlock(),r.createBlock(le,{key:1,focused:i.value,"icon-outlined":!i.value,invalid:p,"show-valid-border":h.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(h.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(h.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(n)?r.unref(V)(r.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","icon-outlined","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",Tb,[r.createElementVNode("div",zb,[r.createElementVNode("div",Lb,[r.createElementVNode("div",null,[r.createElementVNode("div",Hb,[r.createElementVNode("div",Yb,[r.createVNode(ze,{max:h.max,min:h.min,"model-value":s.value,picker:"month","onUpdate:modelValue":m[0]||(m[0]=g=>l(g))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:h.max,min:h.min,"model-value":s.value,picker:"year","onUpdate:modelValue":m[1]||(m[1]=g=>l(g))},null,8,["max","min","model-value"])]),r.createElementVNode("div",jb,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:m[2]||(m[2]=()=>l(s.value.subtract(1,"month")))}),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:m[3]||(m[3]=()=>l(s.value.add(1,"month")))})])]),r.createVNode(un,{days:d.value,"on-day-click":g=>a(g.date),"day-cell-class":{status:{isSelected:g=>g.isSame(o.value,"date")}}},null,8,["days","on-day-click","day-cell-class"])])])]),r.createElementVNode("div",Wb,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:!o.value,label:"Apply",size:"md",variant:"primary",onClick:c},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(h.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),Ub=r.defineComponent({__name:"FmSimpleDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>V().subtract(50,"year").format(I)},max:{default:()=>V().add(25,"year").format(I)},zIndex:{},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const{breakpoints:e}=yt(),n=t,o=q(n,"modelValue"),i=Jo(n);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(e).md||r.unref(e).lg?(r.openBlock(),r.createBlock(Ib,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(e).xs||r.unref(e).sm?(r.openBlock(),r.createBlock(Yd,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}});var ne=(t=>(t.NoComparison="no_comparison",t.PrecedingPeriod="preceding_period",t.PrecedingWeek="preceding_week",t.PrecedingMonth="preceding_month",t.PrecedingYear="preceding_year",t.Custom="custom",t))(ne||{});const Gb={key:1,class:"flex gap-4 items-center relative w-full"},qb={class:"flex flex-col gap-4 w-full"},Xb=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),Kb={class:"flex flex-col gap-4 w-full"},Zb={class:"flex h-[360px]"},Jb={class:"flex flex-col items-start p-12 pr-4"},Qb={key:0},ey={key:1},ty=r.createElementVNode("div",{class:"bg-fm-color-neutral-gray-100 h-full mx-4 w-px"},null,-1),ny={class:"w-max"},oy={class:"flex space-x-24"},ry={class:"flex items-center py-8 space-x-16"},iy={class:"flex space-x-4"},sy={class:"flex items-center justify-end py-8 space-x-16"},ly={class:"flex space-x-4"},ay={class:"flex gap-8 items-center justify-end w-full"},dy=r.defineComponent({__name:"FmSimpleDateRangePickerDesktop",props:{modelValue:{},compareTarget:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:V().format(I),endDate:V().format(I)}},{label:"Yesterday",value:{startDate:V().subtract(1,"day").format(I),endDate:V().subtract(1,"day").format(I)}},{label:"This week",value:{startDate:V().startOf("week").format(I),endDate:V().endOf("week").format(I)}},{label:"Last week",value:{startDate:V().subtract(1,"week").startOf("week").format(I),endDate:V().subtract(1,"week").endOf("week").format(I)}},{label:"Last 7 days",value:{startDate:V().subtract(7,"day").format(I),endDate:V().subtract(1,"day").format(I)}},{label:"This month",value:{startDate:V().startOf("month").format(I),endDate:V().endOf("month").format(I)}},{label:"Last month",value:{startDate:V().subtract(1,"month").startOf("month").format(I),endDate:V().subtract(1,"month").endOf("month").format(I)}},{label:"This year",value:{startDate:V().startOf("year").format(I),endDate:V().endOf("year").format(I)}}]},defaultCompareType:{default:ne.PrecedingPeriod},min:{default:()=>V().subtract(50,"year").format(I)},max:{default:()=>V().add(25,"year").format(I)},zIndex:{default:void 0},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var _,F;const e=$=>()=>{var x,C;const{startAt:S,endAt:D}=Hd((x=o.compareTarget)==null?void 0:x.startDate,(C=o.compareTarget)==null?void 0:C.endDate);if(!S||!D)return;const v=$({startAt:S,endAt:D});return g("right",v.endDate.startOf("month")),v},n=r.computed(()=>[{id:ne.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"week")+1;return s.value={startDate:$.subtract(D,"week"),endDate:S.subtract(D,"week")},u.value=ne.PrecedingWeek,s.value})},{id:ne.PrecedingMonth,label:"Same period last week",sublabel:"Match day of month",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"month")+1;return s.value={startDate:$.subtract(D,"month"),endDate:S.subtract(D,"month")},u.value=ne.PrecedingMonth,s.value})},{id:ne.PrecedingPeriod,label:"Preceding period",sublabel:"",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"day")+1;return s.value={startDate:$.subtract(D,"day"),endDate:S.subtract(D,"day")},u.value=ne.PrecedingPeriod,s.value})},{id:ne.PrecedingYear,label:"Same period last year",sublabel:"",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"year")+1;return s.value={startDate:$.subtract(D,"year"),endDate:S.subtract(D,"year")},u.value=ne.PrecedingYear,s.value})},{id:ne.Custom,label:"Custom",sublabel:"",action:()=>{u.value=ne.Custom}}]),o=t,i=q(o,"modelValue"),s=r.ref({startDate:(_=i.value)!=null&&_.startDate?V(i.value.startDate,I):null,endDate:(F=i.value)!=null&&F.endDate?V(i.value.endDate,I):null}),l=r.ref(!1),a=r.ref(V().startOf("month")),d=r.ref(V().startOf("month").add(1,"month")),c=r.ref(""),u=r.ref(o.defaultCompareType),f=r.ref(null),h=$=>{if(c.value="",u.value=ne.Custom,s.value.startDate&&s.value.endDate){s.value={startDate:$,endDate:null};return}else if(!s.value.startDate&&!s.value.endDate)s.value.startDate=$;else if($.isBefore(s.value.startDate)){const S=s.value.startDate;s.value={startDate:$,endDate:S}}else s.value.endDate=$},m=()=>{i.value={startDate:s.value.startDate.format(I),endDate:s.value.endDate.format(I)},setTimeout(()=>{l.value=!1})},p=()=>{var $,S;s.value={startDate:($=i.value)!=null&&$.startDate?V(i.value.startDate,I):null,endDate:(S=i.value)!=null&&S.endDate?V(i.value.endDate,I):null},l.value=!1},g=($,S)=>{$==="left"?(a.value=S,d.value=S.add(1,"month")):$==="right"&&(d.value=S,a.value=S.subtract(1,"month"))},b=$=>{const S=s.value.startDate,D=s.value.endDate,v=f.value,x=S==null?void 0:S.isSame($),C=D==null?void 0:D.isSame($),N=v==null?void 0:v.isSame($),E=x&&D&&!(x&&C)||S&&!D&&x&&(v==null?void 0:v.isAfter(S))||S&&!D&&N&&(v==null?void 0:v.isBefore(S)),P=C&&S&&!(x&&C)||S&&!D&&x&&(v==null?void 0:v.isBefore(S))||S&&!D&&N&&(v==null?void 0:v.isAfter(S)),B=x&&C||x&&!D,R=S&&(D||v)&&D?$.isAfter(S)&&$.isBefore(D):$.isAfter(v)&&$.isBefore(S)||$.isBefore(v)&&$.isAfter(S);return{status:{isStart:E??!1,isEnd:P??!1,isBetween:R??!1,isSelected:B??!1}}},y=$=>{const S=s.value;if(S.startDate&&!S.endDate){f.value=$;return}f.value=null},k=$=>{c.value=$.label;const S=V($.value.startDate,I),D=V($.value.endDate,I);s.value={startDate:S,endDate:D},g("right",D.startOf("month"))},M=$=>{l.value=$,$||p()},w=r.computed(()=>!(s.value.startDate&&s.value.endDate));return r.watch(()=>i.value,()=>{var $,S;s.value={startDate:($=i.value)!=null&&$.startDate?V(i.value.startDate,I):null,endDate:(S=i.value)!=null&&S.endDate?V(i.value.endDate,I):null}}),r.watch(()=>o.compareTarget,()=>{if(!o.compareTarget||u.value===ne.Custom)return;const $=n.value.find(D=>D.id===u.value),S=$==null?void 0:$.action();S&&(i.value=S)}),($,S)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":S[6]||(S[6]=D=>r.isRef(i)?i.value=D:null),disabled:$.disabled,focused:l.value,"helper-state":$.helperState,"helper-text":$.helperText,rules:$.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:D})=>[r.createVNode(Vt,{disabled:$.disabled,"show-popover":l.value,"z-index":o.zIndex,onPopoverChanged:M},{"popover-button":r.withCtx(()=>[$.$slots["trigger-button"]?r.renderSlot($.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{opened:l.value,invalid:D,showValidBorder:$.showValidBorder}))):(r.openBlock(),r.createElementBlock("div",Gb,[r.createElementVNode("label",qb,[r.createElementVNode("div",{class:r.normalizeClass([[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(o.startLabel),3),r.createVNode(le,{class:r.normalizeClass($.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,"icon-outlined":!l.value,invalid:D,"show-valid-border":$.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot($.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot($.$slots,"append")]),default:r.withCtx(()=>{var v;return[r.createElementVNode("div",{class:r.normalizeClass([[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString((v=r.unref(i))!=null&&v.startDate?r.unref(V)(r.unref(i).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])]),Xb,r.createElementVNode("label",Kb,[r.createElementVNode("div",{class:r.normalizeClass([[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(o.endLabel),3),r.createVNode(le,{class:r.normalizeClass($.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,"icon-outlined":!l.value,invalid:D,"show-valid-border":$.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot($.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot($.$slots,"append")]),default:r.withCtx(()=>{var v;return[r.createElementVNode("div",{class:r.normalizeClass([[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString((v=r.unref(i))!=null&&v.endDate?r.unref(V)(r.unref(i).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])])]))]),default:r.withCtx(()=>[r.createElementVNode("div",Zb,[$.showPredefinedRange||$.compareTarget?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",Jb,[$.showPredefinedRange&&!$.compareTarget?(r.openBlock(),r.createElementBlock("div",Qb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList($.predefinedRange,(v,x)=>(r.openBlock(),r.createBlock(we,{key:x,label:v.label,"model-value":c.value===v.label,selectable:"",class:"min-w-[158px]",onClick:C=>k(v)},null,8,["label","model-value","onClick"]))),128))])):r.createCommentVNode("",!0),$.compareTarget?(r.openBlock(),r.createElementBlock("div",ey,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(v,x)=>(r.openBlock(),r.createBlock(we,{key:x,label:v.label,"model-value":u.value===v.id,sublabel:v.sublabel,selectable:"",class:"min-w-[158px]",onClick:C=>v.action()},null,8,["label","model-value","sublabel","onClick"]))),128))])):r.createCommentVNode("",!0)]),ty],64)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["p-12 space-y-4",{"pl-4":$.showPredefinedRange||$.compareTarget}])},[r.createElementVNode("div",ny,[r.createElementVNode("div",oy,[r.createElementVNode("div",null,[r.createElementVNode("div",ry,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:S[0]||(S[0]=()=>g("left",a.value.subtract(1,"month")))}),r.createElementVNode("div",iy,[r.createVNode(ze,{max:$.max,min:$.min,"model-value":a.value,picker:"month","onUpdate:modelValue":S[1]||(S[1]=v=>g("left",v))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:$.max,min:$.min,"model-value":d.value,picker:"year","onUpdate:modelValue":S[2]||(S[2]=v=>g("left",v))},null,8,["max","min","model-value"])])]),r.createVNode(un,{days:r.unref(cn)(a.value),"on-day-click":v=>h(v.date),"day-cell-class":b,onCellMouseOver:y},null,8,["days","on-day-click"])]),r.createElementVNode("div",null,[r.createElementVNode("div",sy,[r.createElementVNode("div",ly,[r.createVNode(ze,{max:$.max,min:$.min,"model-value":d.value,picker:"month","onUpdate:modelValue":S[3]||(S[3]=v=>g("right",v))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:$.max,min:$.min,"model-value":d.value,picker:"year","onUpdate:modelValue":S[4]||(S[4]=v=>g("right",v))},null,8,["max","min","model-value"])]),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:S[5]||(S[5]=()=>g("left",a.value.add(1,"month")))})]),r.createVNode(un,{days:r.unref(cn)(d.value),"on-day-click":v=>h(v.date),"day-cell-class":v=>b(v),onCellMouseOver:y},null,8,["days","on-day-click","day-cell-class"])])])]),r.createElementVNode("div",ay,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:p}),r.createVNode(U,{disabled:w.value,label:"Apply",size:"md",variant:"primary",onClick:m},null,8,["disabled"])])],2)])]),_:2},1032,["disabled","show-popover","z-index"])]),_:2},[$.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot($.$slots,"helper-text")]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"]))}}),cy={key:0},uy={class:"flex gap-4 items-center relative w-full"},fy={class:"flex flex-col gap-4 w-full"},hy=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),my={class:"flex flex-col gap-4 w-full"},py={key:1,class:"flex flex-col gap-4 w-full"},gy=r.defineComponent({__name:"FmSimpleDateRangePickerField",props:{modelValue:{},analytic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},isComparing:{type:Boolean,default:!1},startLabel:{default:"Start date"},endLabel:{default:"End date"},compareLabel:{default:"Date"}},setup(t){const e=t,n=r.computed(()=>{if(!e.modelValue)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const o=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].startDate:e.modelValue.startDate,i=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].endDate:e.modelValue.endDate;return{startDate:o?V(o).format("D MMM YYYY"):"DD MM YYYY",endDate:i?V(i).format("D MMM YYYY"):"DD MM YYYY"}});return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[o.analytic?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",cy,[r.renderSlot(o.$slots,"popover-button",{},()=>[r.createElementVNode("div",uy,[r.createElementVNode("label",fy,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400 line-clamp-1",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.startLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.startDate?r.unref(V)(o.modelValue.startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])]),hy,r.createElementVNode("label",my,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.endLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.endDate?r.unref(V)(o.modelValue.endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])])])])])),o.analytic?(r.openBlock(),r.createElementBlock("label",py,[r.createVNode(Kt,{label:o.compareLabel},null,8,["label"]),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":n.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(n.value.startDate)+" - "+r.toDisplayString(n.value.endDate),3)]),_:3},8,["class","focused","invalid","show-valid-border"])])):r.createCommentVNode("",!0)]))}}),by={class:"p-12 space-y-4"},yy={class:"w-max"},$y={class:"flex space-x-24"},wy={class:"flex items-center justify-between py-8"},_y={class:"flex space-x-4"},ky={class:"flex space-x-4"},Cy={class:"flex gap-8 items-center justify-end w-full"},jd=r.defineComponent({__name:"FmSimpleDateRangePickerMobile",props:{modelValue:{},compareTarget:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:V().format(I),endDate:V().format(I)}},{label:"Yesterday",value:{startDate:V().subtract(1,"day").format(I),endDate:V().subtract(1,"day").format(I)}},{label:"This week",value:{startDate:V().startOf("week").format(I),endDate:V().endOf("week").format(I)}},{label:"Last week",value:{startDate:V().subtract(1,"week").startOf("week").format(I),endDate:V().subtract(1,"week").endOf("week").format(I)}},{label:"Last 7 days",value:{startDate:V().subtract(7,"day").format(I),endDate:V().subtract(1,"day").format(I)}},{label:"This month",value:{startDate:V().startOf("month").format(I),endDate:V().endOf("month").format(I)}},{label:"Last month",value:{startDate:V().subtract(1,"month").startOf("month").format(I),endDate:V().subtract(1,"month").endOf("month").format(I)}},{label:"This year",value:{startDate:V().startOf("year").format(I),endDate:V().endOf("year").format(I)}}]},defaultCompareType:{default:ne.PrecedingPeriod},min:{default:()=>V().subtract(50,"year").format(I)},max:{default:()=>V().add(25,"year").format(I)},zIndex:{default:void 0},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var _,F;const e=$=>()=>{var x,C;const{startAt:S,endAt:D}=Hd((x=o.compareTarget)==null?void 0:x.startDate,(C=o.compareTarget)==null?void 0:C.endDate);if(!S||!D)return;const v=$({startAt:S,endAt:D});return p(v.endDate.startOf("month")),v},n=r.computed(()=>[{id:ne.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"week")+1;return s.value={startDate:$.subtract(D,"week"),endDate:S.subtract(D,"week")},c.value=ne.PrecedingWeek,s.value})},{id:ne.PrecedingMonth,label:"Same period last week",sublabel:"Match day of month",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"month")+1;return s.value={startDate:$.subtract(D,"month"),endDate:S.subtract(D,"month")},c.value=ne.PrecedingMonth,s.value})},{id:ne.PrecedingPeriod,label:"Preceding period",sublabel:"",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"day")+1;return s.value={startDate:$.subtract(D,"day"),endDate:S.subtract(D,"day")},c.value=ne.PrecedingPeriod,s.value})},{id:ne.PrecedingYear,label:"Same period last year",sublabel:"",action:e(({startAt:$,endAt:S})=>{const D=S.diff($,"year")+1;return s.value={startDate:$.subtract(D,"year"),endDate:S.subtract(D,"year")},c.value=ne.PrecedingYear,s.value})},{id:ne.Custom,label:"Custom",sublabel:"",action:()=>{c.value=ne.Custom}}]),o=t,i=q(o,"modelValue"),s=r.ref({startDate:(_=i.value)!=null&&_.startDate?V(i.value.startDate,I):null,endDate:(F=i.value)!=null&&F.endDate?V(i.value.endDate,I):null}),l=r.ref(!1),a=r.ref(V().startOf("month")),d=r.ref(""),c=r.ref(o.defaultCompareType),u=r.ref(null),f=$=>{if(d.value="",c.value=ne.Custom,s.value.startDate&&s.value.endDate){s.value={startDate:$,endDate:null};return}else if(!s.value.startDate&&!s.value.endDate)s.value.startDate=$;else if($.isBefore(s.value.startDate)){const S=s.value.startDate;s.value={startDate:$,endDate:S}}else s.value.endDate=$},h=()=>{i.value={startDate:s.value.startDate.format(I),endDate:s.value.endDate.format(I)},setTimeout(()=>{l.value=!1})},m=()=>{var $,S;s.value={startDate:($=i.value)!=null&&$.startDate?V(i.value.startDate,I):null,endDate:(S=i.value)!=null&&S.endDate?V(i.value.endDate,I):null},l.value=!1},p=$=>{a.value=$},g=$=>{const S=s.value.startDate,D=s.value.endDate,v=u.value,x=S==null?void 0:S.isSame($),C=D==null?void 0:D.isSame($),N=v==null?void 0:v.isSame($),E=x&&D&&!(x&&C)||S&&!D&&x&&(v==null?void 0:v.isAfter(S))||S&&!D&&N&&(v==null?void 0:v.isBefore(S)),P=C&&S&&!(x&&C)||S&&!D&&x&&(v==null?void 0:v.isBefore(S))||S&&!D&&N&&(v==null?void 0:v.isAfter(S)),B=x&&C||x&&!D,R=S&&(D||v)&&D?$.isAfter(S)&&$.isBefore(D):$.isAfter(v)&&$.isBefore(S)||$.isBefore(v)&&$.isAfter(S);return{status:{isStart:E??!1,isEnd:P??!1,isBetween:R??!1,isSelected:B??!1}}},b=$=>{const S=s.value;if(S.startDate&&!S.endDate){u.value=$;return}u.value=null},y=$=>{const S=V($.startDate,I),D=V($.endDate,I);s.value={startDate:S,endDate:D},p(D.startOf("month"))},k=$=>{const S=n.value.find(D=>D.id===$);S==null||S.action()},M=$=>{l.value=$,$||m()},w=r.computed(()=>!(s.value.startDate&&s.value.endDate));return r.watch(()=>i.value,()=>{var $,S;s.value={startDate:($=i.value)!=null&&$.startDate?V(i.value.startDate,I):null,endDate:(S=i.value)!=null&&S.endDate?V(i.value.endDate,I):null}}),r.watch(()=>o.compareTarget,()=>{if(!o.compareTarget||c.value===ne.Custom)return;const $=n.value.find(D=>D.id===c.value),S=$==null?void 0:$.action();S&&(i.value=S)}),($,S)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":S[6]||(S[6]=D=>r.isRef(i)?i.value=D:null),disabled:$.disabled,focused:l.value,"helper-state":$.helperState,"helper-text":$.helperText,rules:$.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:D})=>[r.createVNode(Vt,{disabled:$.disabled,"show-popover":l.value,"z-index":o.zIndex,"exclude-el-from-click-outside":["exclude-from-click-outside"],onPopoverChanged:M},{"popover-button":r.withCtx(()=>[$.$slots["trigger-button"]?r.renderSlot($.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{opened:l.value,invalid:D,showValidBorder:$.showValidBorder}))):(r.openBlock(),r.createBlock(gy,{key:1,disabled:$.disabled,"end-label":$.endLabel,focused:l.value,invalid:D,"model-value":r.unref(i),"show-valid-border":$.showValidBorder,"start-label":$.startLabel},r.createSlots({_:2},[$.$slots["popover-button"]?{name:"popover-button",fn:r.withCtx(()=>[r.renderSlot($.$slots,"popover-button",{focused:l.value})]),key:"0"}:void 0]),1032,["disabled","end-label","focused","invalid","model-value","show-valid-border","start-label"]))]),default:r.withCtx(()=>[r.createElementVNode("div",by,[$.showPredefinedRange&&!$.compareTarget?(r.openBlock(),r.createBlock(dn,{key:0,"menu-id":"exclude-from-click-outside",items:$.predefinedRange,"model-value":d.value,"onUpdate:modelValue":S[0]||(S[0]=v=>y(v))},null,8,["items","model-value"])):r.createCommentVNode("",!0),$.compareTarget?(r.openBlock(),r.createBlock(dn,{key:1,"menu-id":"exclude-from-click-outside",items:n.value.map(v=>({label:v.label,sublabel:v.sublabel,value:v.id})),"model-value":c.value,"onUpdate:modelValue":S[1]||(S[1]=v=>k(v))},null,8,["items","model-value"])):r.createCommentVNode("",!0),r.createElementVNode("div",yy,[r.createElementVNode("div",$y,[r.createElementVNode("div",null,[r.createElementVNode("div",wy,[r.createElementVNode("div",_y,[r.createVNode(ze,{max:$.max,min:$.min,"model-value":a.value,picker:"month","onUpdate:modelValue":S[2]||(S[2]=v=>p(v))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:$.max,min:$.min,"model-value":a.value,picker:"year","onUpdate:modelValue":S[3]||(S[3]=v=>p(v))},null,8,["max","min","model-value"])]),r.createElementVNode("div",ky,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:S[4]||(S[4]=()=>p(a.value.subtract(1,"month")))}),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:S[5]||(S[5]=()=>p(a.value.add(1,"month")))})])]),r.createVNode(un,{days:r.unref(cn)(a.value),"on-day-click":v=>f(v.date),"day-cell-class":g,"cell-size":"lg",onCellMouseOver:b},null,8,["days","on-day-click"])])])]),r.createElementVNode("div",Cy,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:m}),r.createVNode(U,{disabled:w.value,label:"Apply",size:"md",variant:"primary",onClick:h},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),_:2},[$.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot($.$slots,"helper-text")]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"]))}}),xy=r.defineComponent({__name:"FmSimpleDateRangePicker",props:{modelValue:{},compareTarget:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:void 0},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:V().format(I),endDate:V().format(I)}},{label:"Yesterday",value:{startDate:V().subtract(1,"day").format(I),endDate:V().subtract(1,"day").format(I)}},{label:"This week",value:{startDate:V().startOf("week").format(I),endDate:V().endOf("week").format(I)}},{label:"Last week",value:{startDate:V().subtract(1,"week").startOf("week").format(I),endDate:V().subtract(1,"week").endOf("week").format(I)}},{label:"Last 7 days",value:{startDate:V().subtract(7,"day").format(I),endDate:V().subtract(1,"day").format(I)}},{label:"This month",value:{startDate:V().startOf("month").format(I),endDate:V().endOf("month").format(I)}},{label:"Last month",value:{startDate:V().subtract(1,"month").startOf("month").format(I),endDate:V().subtract(1,"month").endOf("month").format(I)}},{label:"This year",value:{startDate:V().startOf("year").format(I),endDate:V().endOf("year").format(I)}}]},defaultCompareType:{},min:{default:()=>V().subtract(50,"year").format(I)},max:{default:()=>V().add(25,"year").format(I)},zIndex:{},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,{breakpoints:n}=yt(),o=q(e,"modelValue"),i=Jo(e);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(n).md||r.unref(n).lg?(r.openBlock(),r.createBlock(dy,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(n).xs||r.unref(n).sm?(r.openBlock(),r.createBlock(jd,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}}),Sy=r.defineComponent({__name:"FmForm",props:{disabled:{type:Boolean,default:!1},onValidationSuccess:{},onValidationFailed:{}},emits:["validation-reset","reset"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref([]),s=r.ref(0),l=r.ref(!1),a=n,d=async()=>{var h,m;l.value=!0;let f=[];for(let p=0;p<i.value.length;p++){const g=i.value[p];f=[...f,...g.validate()]}f.length?await((m=o.onValidationFailed)==null?void 0:m.call(o,f)):await((h=o.onValidationSuccess)==null?void 0:h.call(o)),l.value=!1},c=()=>{for(let f=0;f<i.value.length;f++)i.value[f].resetValue();a("reset")};return e({validateInputs:d,resetInputsValidation:()=>{for(let f=0;f<i.value.length;f++)i.value[f].resetValidation();a("validation-reset")},resetInputs:c,isSubmitting:l}),r.provide(Rs,{register({validate:f,resetValidation:h,resetValue:m}){return i.value.push({componentId:s.value,validate:f,resetValidation:h,resetValue:m}),s.value++},unregister(f){i.value.filter(h=>h.componentId!==f)}}),r.provide(ye,{getDisabled:()=>o.disabled}),(f,h)=>(r.openBlock(),r.createElementBlock("form",{onSubmit:r.withModifiers(d,["prevent"]),onReset:r.withModifiers(c,["prevent"])},[r.renderSlot(f.$slots,"default")],32))}}),vy={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:1[3-79]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:22|44|7[27]|87|9[69])[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-689]|8[1-69]|9[1-578])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","2[0-24-9]\\d{8}|[78]\\d{10,13}|[7-9]\\d{9}|[1-9]\\d{7}|[124-7]\\d{6}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:0[0-689]|[1-79])|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:5056(?:[0-35-9]\\d|4[468])|7302[0-4]\\d)\\d{4}|(?:472[24]|505[2-57-9]|7306|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:20|33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Wd(t,e){var n=Array.prototype.slice.call(e);return n.push(vy),t.apply(this,n)}function Oi(t){"@babel/helpers - typeof";return Oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oi(t)}function Ud(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Dy(t,e,n){return e&&Ud(t.prototype,e),n&&Ud(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function My(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eo(t,e)}function By(t){var e=qd();return function(){var o=to(t),i;if(e){var s=to(this).constructor;i=Reflect.construct(o,arguments,s)}else i=o.apply(this,arguments);return Ey(this,i)}}function Ey(t,e){if(e&&(Oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gd(t)}function Gd(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ii(t){var e=typeof Map=="function"?new Map:void 0;return Ii=function(o){if(o===null||!Py(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(o))return e.get(o);e.set(o,i)}function i(){return Qo(o,arguments,to(this).constructor)}return i.prototype=Object.create(o.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),eo(i,o)},Ii(t)}function Qo(t,e,n){return qd()?Qo=Reflect.construct:Qo=function(i,s,l){var a=[null];a.push.apply(a,s);var d=Function.bind.apply(i,a),c=new d;return l&&eo(c,l.prototype),c},Qo.apply(null,arguments)}function qd(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Py(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function eo(t,e){return eo=Object.setPrototypeOf||function(o,i){return o.__proto__=i,o},eo(t,e)}function to(t){return to=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},to(t)}var ft=function(t){Vy(n,t);var e=By(n);function n(o){var i;return My(this,n),i=e.call(this,o),Object.setPrototypeOf(Gd(i),n.prototype),i.name=i.constructor.name,i}return Dy(n)}(Ii(Error)),Ti=2,Ny=17,Fy=3,je="0-90-9٠-٩۰-۹",Ry="-‐-―−ー-",Ay="//",Oy="..",Iy="  ­​⁠ ",Ty="()()[]\\[\\]",zy="~⁓∼~",er="".concat(Ry).concat(Ay).concat(Oy).concat(Iy).concat(Ty).concat(zy),zi="++";function Xd(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),o=e[0].split("."),i=0;i<3;i++){var s=Number(n[i]),l=Number(o[i]);if(s>l)return 1;if(l>s)return-1;if(!isNaN(s)&&isNaN(l))return 1;if(isNaN(s)&&!isNaN(l))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Ly={}.constructor;function tr(t){return t!=null&&t.constructor===Ly}function Li(t){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Li(t)}function nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kd(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function or(t,e,n){return e&&Kd(t.prototype,e),n&&Kd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Hy="1.2.0",Yy="1.7.35",Zd=" ext. ",jy=/^\d+$/,De=function(){function t(e){nr(this,t),qy(e),this.metadata=e,ec.call(this,e)}return or(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var o=this.countryCallingCodes()[n];if(o&&o.length===1&&o[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,o){if(n&&jy.test(n)&&(o=n,n=null),n&&n!=="001"){if(!this.hasCountry(n))throw new Error("Unknown country: ".concat(n));this.numberingPlan=new Jd(this.getCountryMetadata(n),this)}else if(o){if(!this.hasCallingCode(o))throw new Error("Unknown calling code: ".concat(o));this.numberingPlan=new Jd(this.getNumberingPlanMetadata(o),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var o=this.countryCallingCodes()[n];if(o)return o.length===1&&o[0].length===3?void 0:o}},{key:"getCountryCodeForCallingCode",value:function(n){var o=this.getCountryCodesForCallingCode(n);if(o)return o[0]}},{key:"getNumberingPlanMetadata",value:function(n){var o=this.getCountryCodeForCallingCode(n);if(o)return this.getCountryMetadata(o);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var s=this.countryCallingCodes()[n];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}]),t}(),Jd=function(){function t(e,n){nr(this,t),this.globalMetadataObject=n,this.metadata=e,ec.call(this,n.metadata)}return or(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,o=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return o.map(function(i){return new Wy(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(n){if(this.hasTypes()&&Qd(this.types(),n))return new Gy(Qd(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?Zd:this.metadata[13]||Zd}}]),t}(),Wy=function(){function t(e,n){nr(this,t),this._format=e,this.metadata=n}return or(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!Uy.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),t}(),Uy=/^\(?\$1\)?$/,Gy=function(){function t(e,n){nr(this,t),this.type=e,this.metadata=n}return or(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),t}();function Qd(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function qy(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!tr(t)||!tr(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(tr(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+Xy(t)+": "+t,"."))}var Xy=function(e){return Li(e)};function rr(t,e){if(e=new De(e),e.hasCountry(t))return e.country(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function Ky(t,e){return e.countries.hasOwnProperty(t)}function ec(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?Xd(e,Hy)===-1?this.v2=!0:Xd(e,Yy)===-1?this.v3=!0:this.v4=!0:this.v1=!0}var Zy=";ext=",fn=function(e){return"([".concat(je,"]{1,").concat(e,"})")};function tc(t){var e="20",n="15",o="9",i="6",s="[  \\t,]*",l="[:\\..]?[  \\t,-]*",a="#?",d="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",c="(?:[xx##~~]|int|int)",u="[- ]+",f="[  \\t]*",h="(?:,{2}|;)",m=Zy+fn(e),p=s+d+l+fn(e)+a,g=s+c+l+fn(o)+a,b=u+fn(i)+"#",y=f+h+l+fn(n)+a,k=f+"(?:,)+"+l+fn(o)+a;return m+"|"+p+"|"+g+"|"+b+"|"+y+"|"+k}var Jy="["+je+"]{"+Ti+"}",Qy="["+zi+"]{0,1}(?:["+er+"]*["+je+"]){3,}["+er+je+"]*",e$=new RegExp("^["+zi+"]{0,1}(?:["+er+"]*["+je+"]){1,2}$","i"),t$=Qy+"(?:"+tc()+")?",n$=new RegExp("^"+Jy+"$|^"+t$+"$","i");function o$(t){return t.length>=Ti&&n$.test(t)}function r$(t){return e$.test(t)}var nc=new RegExp("(?:"+tc()+")$","i");function i$(t){var e=t.search(nc);if(e<0)return{};for(var n=t.slice(0,e),o=t.match(nc),i=1;i<o.length;){if(o[i])return{number:n,ext:o[i]};i++}}var s$={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function l$(t){return s$[t]}function a$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=d$(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ `):t}function G0(t,e){const{element:n,datasetIndex:o,index:i}=e,s=t.getDatasetMeta(o).controller,{label:l,value:a}=s.getLabelAndValue(i);return{chart:t,label:l,parsed:s.getParsed(i),raw:t.data.datasets[o].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:o,element:n}}function Ka(t,e){const n=t.chart.ctx,{body:o,footer:i,title:s}=t,{boxWidth:l,boxHeight:a}=e,d=ge(e.bodyFont),c=ge(e.titleFont),u=ge(e.footerFont),f=s.length,h=i.length,m=o.length,p=Ce(e.padding);let g=p.height,b=0,y=o.reduce((_,x)=>_+x.before.length+x.lines.length+x.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const _=e.displayColors?Math.max(a,d.lineHeight):d.lineHeight;g+=m*_+(y-m)*d.lineHeight+(y-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let C=0;const v=function(_){b=Math.max(b,n.measureText(_).width+C)};return n.save(),n.font=c.string,ne(t.title,v),n.font=d.string,ne(t.beforeBody.concat(t.afterBody),v),C=e.displayColors?l+2+e.boxPadding:0,ne(o,_=>{ne(_.before,v),ne(_.lines,v),ne(_.after,v)}),C=0,n.font=u.string,ne(t.footer,v),n.restore(),b+=p.width,{width:b,height:g}}function q0(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function X0(t,e,n,o){const{x:i,width:s}=o,l=n.caretSize+n.caretPadding;if(t==="left"&&i+s+l>e.width||t==="right"&&i-s-l<0)return!0}function K0(t,e,n,o){const{x:i,width:s}=n,{width:l,chartArea:{left:a,right:d}}=t;let c="center";return o==="center"?c=i<=(a+d)/2?"left":"right":i<=s/2?c="left":i>=l-s/2&&(c="right"),X0(c,t,e,n)&&(c="center"),c}function Za(t,e,n){const o=n.yAlign||e.yAlign||q0(t,n);return{xAlign:n.xAlign||e.xAlign||K0(t,e,n,o),yAlign:o}}function Z0(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function J0(t,e,n){let{y:o,height:i}=t;return e==="top"?o+=n:e==="bottom"?o-=i+n:o-=i/2,o}function Ja(t,e,n,o){const{caretSize:i,caretPadding:s,cornerRadius:l}=t,{xAlign:a,yAlign:d}=n,c=i+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Tt(l);let p=Z0(e,a);const g=J0(e,d,c);return d==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+i:a==="right"&&(p+=Math.max(f,m)+i),{x:$e(p,0,o.width-e.width),y:$e(g,0,o.height-e.height)}}function Lo(t,e,n){const o=Ce(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function Qa(t){return Xe([],at(t))}function Q0(t,e,n){return St(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function ed(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const td={beforeTitle:nt,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:nt,beforeBody:nt,beforeLabel:nt,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 Q(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:nt,afterBody:nt,beforeFooter:nt,footer:nt,afterFooter:nt};function Me(t,e,n,o){const i=t[e].call(n,o);return typeof i>"u"?td[e].call(n,o):i}class yi extends lt{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 jl(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Q0(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,i=Me(o,"beforeTitle",this,e),s=Me(o,"title",this,e),l=Me(o,"afterTitle",this,e);let a=[];return a=Xe(a,at(i)),a=Xe(a,at(s)),a=Xe(a,at(l)),a}getBeforeBody(e,n){return Qa(Me(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,i=[];return ne(e,s=>{const l={before:[],lines:[],after:[]},a=ed(o,s);Xe(l.before,at(Me(a,"beforeLabel",this,s))),Xe(l.lines,Me(a,"label",this,s)),Xe(l.after,at(Me(a,"afterLabel",this,s))),i.push(l)}),i}getAfterBody(e,n){return Qa(Me(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,i=Me(o,"beforeFooter",this,e),s=Me(o,"footer",this,e),l=Me(o,"afterFooter",this,e);let a=[];return a=Xe(a,at(i)),a=Xe(a,at(s)),a=Xe(a,at(l)),a}_createItems(e){const n=this._active,o=this.chart.data,i=[],s=[],l=[];let a=[],d,c;for(d=0,c=n.length;d<c;++d)a.push(G0(this.chart,n[d]));return e.filter&&(a=a.filter((u,f,h)=>e.filter(u,f,h,o))),e.itemSort&&(a=a.sort((u,f)=>e.itemSort(u,f,o))),ne(a,u=>{const f=ed(e.callbacks,u);i.push(Me(f,"labelColor",this,u)),s.push(Me(f,"labelPointStyle",this,u)),l.push(Me(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=a,a}update(e,n){const o=this.options.setContext(this.getContext()),i=this._active;let s,l=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Ln[o.position].call(this,i,this._eventPosition);l=this._createItems(o),this.title=this.getTitle(l,o),this.beforeBody=this.getBeforeBody(l,o),this.body=this.getBody(l,o),this.afterBody=this.getAfterBody(l,o),this.footer=this.getFooter(l,o);const d=this._size=Ka(this,o),c=Object.assign({},a,d),u=Za(this.chart,o,c),f=Ja(o,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:d.width,height:d.height,caretX:a.x,caretY:a.y}}this._tooltipItems=l,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:l,cornerRadius:a}=o,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Tt(a),{x:h,y:m}=e,{width:p,height:g}=n;let b,y,C,v,_,x;return s==="center"?(_=m+g/2,i==="left"?(b=h,y=b-l,v=_+l,x=_-l):(b=h+p,y=b+l,v=_-l,x=_+l),C=b):(i==="left"?y=h+Math.max(d,u)+l:i==="right"?y=h+p-Math.max(c,f)-l:y=this.caretX,s==="top"?(v=m,_=v-l,b=y-l,C=y+l):(v=m+g,_=v+l,b=y+l,C=y-l),x=v),{x1:b,x2:y,x3:C,y1:v,y2:_,y3:x}}drawTitle(e,n,o){const i=this.title,s=i.length;let l,a,d;if(s){const c=nn(o.rtl,this.x,this.width);for(e.x=Lo(this,o.titleAlign,o),n.textAlign=c.textAlign(o.titleAlign),n.textBaseline="middle",l=ge(o.titleFont),a=o.titleSpacing,n.fillStyle=o.titleColor,n.font=l.string,d=0;d<s;++d)n.fillText(i[d],c.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+a,d+1===s&&(e.y+=o.titleMarginBottom-a)}}_drawColorBox(e,n,o,i,s){const l=this.labelColors[o],a=this.labelPointStyles[o],{boxHeight:d,boxWidth:c}=s,u=ge(s.bodyFont),f=Lo(this,"left",s),h=i.x(f),m=d<u.lineHeight?(u.lineHeight-d)/2:0,p=n.y+m;if(s.usePointStyle){const g={radius:Math.min(c,d)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=i.leftForLtr(h,c)+c/2,y=p+d/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Gr(e,g,b,y),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,Gr(e,g,b,y)}else{e.lineWidth=Z(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const g=i.leftForLtr(h,c),b=i.leftForLtr(i.xPlus(h,1),c-2),y=Tt(l.borderRadius);Object.values(y).some(C=>C!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Vn(e,{x:g,y:p,w:c,h:d,radius:y}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),Vn(e,{x:b,y:p+1,w:c-2,h:d-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,p,c,d),e.strokeRect(g,p,c,d),e.fillStyle=l.backgroundColor,e.fillRect(b,p+1,c-2,d-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:i}=this,{bodySpacing:s,bodyAlign:l,displayColors:a,boxHeight:d,boxWidth:c,boxPadding:u}=o,f=ge(o.bodyFont);let h=f.lineHeight,m=0;const p=nn(o.rtl,this.x,this.width),g=function(R){n.fillText(R,p.x(e.x+m),e.y+h/2),e.y+=h+s},b=p.textAlign(l);let y,C,v,_,x,N,E;for(n.textAlign=l,n.textBaseline="middle",n.font=f.string,e.x=Lo(this,b,o),n.fillStyle=o.bodyColor,ne(this.beforeBody,g),m=a&&b!=="right"?l==="center"?c/2+u:c+2+u:0,_=0,N=i.length;_<N;++_){for(y=i[_],C=this.labelTextColors[_],n.fillStyle=C,ne(y.before,g),v=y.lines,a&&v.length&&(this._drawColorBox(n,e,_,p,o),h=Math.max(f.lineHeight,d)),x=0,E=v.length;x<E;++x)g(v[x]),h=f.lineHeight;ne(y.after,g)}m=0,h=f.lineHeight,ne(this.afterBody,g),e.y-=s}drawFooter(e,n,o){const i=this.footer,s=i.length;let l,a;if(s){const d=nn(o.rtl,this.x,this.width);for(e.x=Lo(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=d.textAlign(o.footerAlign),n.textBaseline="middle",l=ge(o.footerFont),n.fillStyle=o.footerColor,n.font=l.string,a=0;a<s;++a)n.fillText(i[a],d.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+o.footerSpacing}}drawBackground(e,n,o,i){const{xAlign:s,yAlign:l}=this,{x:a,y:d}=e,{width:c,height:u}=o,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=Tt(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,d),l==="top"&&this.drawCaret(e,n,o,i),n.lineTo(a+c-h,d),n.quadraticCurveTo(a+c,d,a+c,d+h),l==="center"&&s==="right"&&this.drawCaret(e,n,o,i),n.lineTo(a+c,d+u-p),n.quadraticCurveTo(a+c,d+u,a+c-p,d+u),l==="bottom"&&this.drawCaret(e,n,o,i),n.lineTo(a+m,d+u),n.quadraticCurveTo(a,d+u,a,d+u-m),l==="center"&&s==="left"&&this.drawCaret(e,n,o,i),n.lineTo(a,d+f),n.quadraticCurveTo(a,d,a+f,d),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 l=Ln[e.position].call(this,this._active,this._eventPosition);if(!l)return;const a=this._size=Ka(this,e),d=Object.assign({},l,this._size),c=Za(n,e,d),u=Ja(e,d,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=l.x,this.caretY=l.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 l=Ce(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),Rl(e,n.textDirection),s.y+=l.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Al(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,i=e.map(({datasetIndex:a,index:d})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[d],index:d}}),s=!fo(o,i),l=this._positionChanged(i,n);(s||l)&&(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||[],l=this._getActiveElements(e,s,n,o),a=this._positionChanged(l,e),d=n||!fo(l,s)||a;return d&&(this._active=l,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),d}_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 l=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&l.reverse(),l}_positionChanged(e,n){const{caretX:o,caretY:i,options:s}=this,l=Ln[s.position].call(this,e,n);return l!==!1&&(o!==l.x||i!==l.y)}}T(yi,"positioners",Ln);var eg={id:"tooltip",_element:yi,positioners:Ln,afterInit(t,e,n){n&&(t.tooltip=new yi({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:td},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"]},tg=Object.freeze({__proto__:null,Colors:h0,Decimation:b0,Filler:O0,Legend:Y0,SubTitle:U0,Title:W0,Tooltip:eg});const ng=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function og(t,e,n,o){const i=t.indexOf(e);if(i===-1)return ng(t,e,n,o);const s=t.lastIndexOf(e);return i!==s?n:i}const rg=(t,e)=>t===null?null:$e(Math.round(t),0,e);function nd(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class $i extends Wt{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(Q(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:og(o,e,G(n,e),this._addedLabels),rg(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 l=e;l<=n;l++)i.push({value:l});return i}getLabelForValue(e){return nd.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}}T($i,"id","category"),T($i,"defaults",{ticks:{callback:nd}});function ig(t,e){const n=[],{bounds:i,step:s,min:l,max:a,precision:d,count:c,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,p=u-1,{min:g,max:b}=e,y=!Q(l),C=!Q(a),v=!Q(c),_=(b-g)/(f+1);let x=sl((b-g)/p/m)*m,N,E,R,k;if(x<1e-14&&!y&&!C)return[{value:g},{value:b}];k=Math.ceil(b/x)-Math.floor(g/x),k>p&&(x=sl(k*x/p/m)*m),Q(d)||(N=Math.pow(10,d),x=Math.ceil(x*N)/N),i==="ticks"?(E=Math.floor(g/x)*x,R=Math.ceil(b/x)*x):(E=g,R=b),y&&C&&s&&Qf((a-l)/s,x/1e3)?(k=Math.round(Math.min((a-l)/x,u)),x=(a-l)/k,E=l,R=a):v?(E=y?l:E,R=C?a:R,k=c-1,x=(R-E)/k):(k=(R-E)/x,xn(k,Math.round(k),x/1e3)?k=Math.round(k):k=Math.ceil(k));const S=Math.max(al(x),al(E));N=Math.pow(10,Q(d)?S:d),E=Math.round(E*N)/N,R=Math.round(R*N)/N;let w=0;for(y&&(h&&E!==l?(n.push({value:l}),E<l&&w++,xn(Math.round((E+w*x)*N)/N,l,od(l,_,t))&&w++):E<l&&w++);w<k;++w){const $=Math.round((E+w*x)*N)/N;if(C&&$>a)break;n.push({value:$})}return C&&h&&R!==a?n.length&&xn(n[n.length-1].value,a,od(a,_,t))?n[n.length-1].value=a:n.push({value:a}):(!C||R===a)&&n.push({value:R}),n}function od(t,e,{horizontal:n,minRotation:o}){const i=Le(o),s=(n?Math.sin(i):Math.cos(i))||.001,l=.75*e*(""+t).length;return Math.min(e/s,l)}class Ho extends Wt{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 Q(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 l=d=>i=n?i:d,a=d=>s=o?s:d;if(e){const d=Ge(i),c=Ge(s);d<0&&c<0?a(0):d>0&&c>0&&l(0)}if(i===s){let d=s===0?1:Math.abs(s*.05);a(s+d),e||l(i-d)}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,l=ig(i,s);return e.bounds==="ticks"&&ll(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}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 Dn(e,this.chart.options.locale,this.options.ticks.format)}}class wi extends Ho{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ce(e)?e:0,this.max=ce(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=Le(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}}T(wi,"id","linear"),T(wi,"defaults",{ticks:{callback:go.formatters.numeric}});const Hn=t=>Math.floor(xt(t)),Ut=(t,e)=>Math.pow(10,Hn(t)+e);function rd(t){return t/Math.pow(10,Hn(t))===1}function id(t,e,n){const o=Math.pow(10,n),i=Math.floor(t/o);return Math.ceil(e/o)-i}function sg(t,e){const n=e-t;let o=Hn(n);for(;id(t,e,o)>10;)o++;for(;id(t,e,o)<10;)o--;return Math.min(o,Hn(t))}function lg(t,{min:e,max:n}){e=Pe(t.min,e);const o=[],i=Hn(e);let s=sg(e,n),l=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),d=i>s?Math.pow(10,i):0,c=Math.round((e-d)*l)/l,u=Math.floor((e-d)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,s)),h=Pe(t.min,Math.round((d+u+f*Math.pow(10,s))*l)/l);for(;h<n;)o.push({value:h,major:rd(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,l=s>=0?1:l),h=Math.round((d+u+f*Math.pow(10,s))*l)/l;const m=Pe(t.max,h);return o.push({value:m,major:rd(m),significand:f}),o}class _i extends Wt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=Ho.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return ce(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ce(e)?Math.max(0,e):null,this.max=ce(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ce(this._userMin)&&(this.min=e===Ut(this.min,0)?Ut(this.min,-1):Ut(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,l=a=>i=n?i:a;o===i&&(o<=0?(s(1),l(10)):(s(Ut(o,-1)),l(Ut(i,1)))),o<=0&&s(Ut(i,-1)),i<=0&&l(Ut(o,1)),this.min=o,this.max=i}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=lg(n,this);return e.bounds==="ticks"&&ll(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":Dn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=xt(e),this._valueRange=xt(this.max)-xt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(xt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}T(_i,"id","logarithmic"),T(_i,"defaults",{ticks:{callback:go.formatters.logarithmic,major:{enabled:!0}}});function ki(t){const e=t.ticks;if(e.display&&t.display){const n=Ce(e.backdropPadding);return G(e.font&&e.font.size,ue.font.size)+n.height}return 0}function ag(t,e,n){return n=re(n)?n:[n],{w:gh(t,e.string,n),h:n.length*e.lineHeight}}function sd(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 dg(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,l=t.options.pointLabels,a=l.centerPointLabels?ie/s:0;for(let d=0;d<s;d++){const c=l.setContext(t.getPointLabelContext(d));i[d]=c.padding;const u=t.getPointPosition(d,t.drawingArea+i[d],a),f=ge(c.font),h=ag(t.ctx,f,t._pointLabels[d]);o[d]=h;const m=Ne(t.getIndexAngle(d)+a),p=Math.round(Tr(m)),g=sd(p,u.x,h.w,0,180),b=sd(p,u.y,h.h,90,270);cg(n,e,m,g,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=hg(t,o,i)}function cg(t,e,n,o,i){const s=Math.abs(Math.sin(n)),l=Math.abs(Math.cos(n));let a=0,d=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?(d=(e.t-i.start)/l,t.t=Math.min(t.t,e.t-d)):i.end>e.b&&(d=(i.end-e.b)/l,t.b=Math.max(t.b,e.b+d))}function ug(t,e,n){const o=t.drawingArea,{extra:i,additionalAngle:s,padding:l,size:a}=n,d=t.getPointPosition(e,o+i+l,s),c=Math.round(Tr(Ne(d.angle+me))),u=gg(d.y,a.h,c),f=mg(c),h=pg(d.x,a.w,f);return{visible:!0,x:d.x,y:u,textAlign:f,left:h,top:u,right:h+a.w,bottom:u+a.h}}function fg(t,e){if(!e)return!0;const{left:n,top:o,right:i,bottom:s}=t;return!(it({x:n,y:o},e)||it({x:n,y:s},e)||it({x:i,y:o},e)||it({x:i,y:s},e))}function hg(t,e,n){const o=[],i=t._pointLabels.length,s=t.options,{centerPointLabels:l,display:a}=s.pointLabels,d={extra:ki(s)/2,additionalAngle:l?ie/i:0};let c;for(let u=0;u<i;u++){d.padding=n[u],d.size=e[u];const f=ug(t,u,d);o.push(f),a==="auto"&&(f.visible=fg(f,c),f.visible&&(c=f))}return o}function mg(t){return t===0||t===180?"center":t<180?"left":"right"}function pg(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function gg(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function bg(t,e,n){const{left:o,top:i,right:s,bottom:l}=n,{backdropColor:a}=e;if(!Q(a)){const d=Tt(e.borderRadius),c=Ce(e.backdropPadding);t.fillStyle=a;const u=o-c.left,f=i-c.top,h=s-o+c.width,m=l-i+c.height;Object.values(d).some(p=>p!==0)?(t.beginPath(),Vn(t,{x:u,y:f,w:h,h:m,radius:d}),t.fill()):t.fillRect(u,f,h,m)}}function yg(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 l=o.setContext(t.getPointLabelContext(i));bg(n,l,s);const a=ge(l.font),{x:d,y:c,textAlign:u}=s;It(n,t._pointLabels[i],d,c+a.lineHeight/2,a,{color:l.color,textAlign:u,textBaseline:"middle"})}}function ld(t,e,n,o){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,se);else{let s=t.getPointPosition(0,e);i.moveTo(s.x,s.y);for(let l=1;l<o;l++)s=t.getPointPosition(l,e),i.lineTo(s.x,s.y)}}function $g(t,e,n,o,i){const s=t.ctx,l=e.circular,{color:a,lineWidth:d}=e;!l&&!o||!a||!d||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=d,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),ld(t,n,l,o),s.closePath(),s.stroke(),s.restore())}function wg(t,e,n){return St(t,{label:n,index:e,type:"pointLabel"})}class Yn extends Ho{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=Ce(ki(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=ce(e)&&!isNaN(e)?e:0,this.max=ce(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ki(this.options))}generateTickLabels(e){Ho.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const i=oe(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?dg(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=se/(this._pointLabels.length||1),o=this.options.startAngle||0;return Ne(e*n+Le(o))}getDistanceFromCenterForValue(e){if(Q(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(Q(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 wg(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const i=this.getIndexAngle(e)-me+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(),ld(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,l=this._pointLabels.length;let a,d,c;if(n.pointLabels.display&&yg(this,l),i.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){d=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=i.setContext(h),p=s.setContext(h);$g(this,m,d,l,p)}}),o.display){for(e.save(),a=l-1;a>=0;a--){const u=o.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,d=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,d),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.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,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,d)=>{if(d===0&&this.min>=0&&!n.reverse)return;const c=o.setContext(this.getContext(d)),u=ge(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[d].value),c.showLabelBackdrop){e.font=u.string,l=e.measureText(a.label).width,e.fillStyle=c.backdropColor;const f=Ce(c.backdropPadding);e.fillRect(-l/2-f.left,-s-u.size/2-f.top,l+f.width,u.size+f.height)}It(e,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}T(Yn,"id","radialLinear"),T(Yn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:go.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),T(Yn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),T(Yn,"descriptors",{angleLines:{_fallback:"grid"}});const Yo={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}},Ve=Object.keys(Yo);function ad(t,e){return t-e}function dd(t,e){if(Q(e))return null;const n=t._adapter,{parser:o,round:i,isoWeekday:s}=t._parseOpts;let l=e;return typeof o=="function"&&(l=o(l)),ce(l)||(l=typeof o=="string"?n.parse(l,o):n.parse(l)),l===null?null:(i&&(l=i==="week"&&(Qt(s)||s===!0)?n.startOf(l,"isoWeek",s):n.startOf(l,i)),+l)}function cd(t,e,n,o){const i=Ve.length;for(let s=Ve.indexOf(t);s<i-1;++s){const l=Yo[Ve[s]],a=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((n-e)/(a*l.size))<=o)return Ve[s]}return Ve[i-1]}function _g(t,e,n,o,i){for(let s=Ve.length-1;s>=Ve.indexOf(n);s--){const l=Ve[s];if(Yo[l].common&&t._adapter.diff(i,o,l)>=e-1)return l}return Ve[n?Ve.indexOf(n):0]}function kg(t){for(let e=Ve.indexOf(t)+1,n=Ve.length;e<n;++e)if(Yo[Ve[e]].common)return Ve[e]}function ud(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:i}=Lr(n,e),s=n[o]>=e?n[o]:n[i];t[s]=!0}}function Cg(t,e,n,o){const i=t._adapter,s=+i.startOf(e[0].value,o),l=e[e.length-1].value;let a,d;for(a=s;a<=l;a=+i.add(a,1,o))d=n[a],d>=0&&(e[d].major=!0);return e}function fd(t,e,n){const o=[],i={},s=e.length;let l,a;for(l=0;l<s;++l)a=e[l],i[a]=l,o.push({value:a,major:!1});return s===0||!n?o:Cg(t,o,i,n)}class jn extends Wt{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 Pm._date(e.adapters.date);i.init(n),kn(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:dd(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:l,maxDefined:a}=this.getUserBounds();function d(c){!l&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!l||!a)&&(d(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&d(this.getMinMax(!1))),i=ce(i)&&!isNaN(i)?i:+n.startOf(Date.now(),o),s=ce(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,l=this.max,a=oh(i,s,l);return this._unit=n.unit||(o.autoSkip?cd(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):_g(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:kg(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),fd(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 l=e.length<3?.5:.25;n=$e(n,0,l),o=$e(o,0,l),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,l=s.unit||cd(s.minUnit,n,o,this._getLabelCapacity(n)),a=G(i.ticks.stepSize,1),d=l==="week"?s.isoWeekday:!1,c=Qt(d)||d===!0,u={};let f=n,h,m;if(c&&(f=+e.startOf(f,"isoWeek",d)),f=+e.startOf(f,c?"day":l),e.diff(o,n,l)>1e5*a)throw new Error(n+" and "+o+" are too far apart with stepSize of "+a+" "+l);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<o;h=+e.add(h,a,l),m++)ud(u,h,p);return(h===o||i.bounds==="ticks"||m===1)&&ud(u,h,p),Object.keys(u).sort(ad).map(g=>+g)}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,l=n||i[s];return this._adapter.format(e,l)}_tickFormatFunction(e,n,o,i){const s=this.options,l=s.ticks.callback;if(l)return oe(l,[e,n,o],this);const a=s.time.displayFormats,d=this._unit,c=this._majorUnit,u=d&&a[d],f=c&&a[c],h=o[n],m=c&&f&&h&&h.major;return this._adapter.format(e,i||(m?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=Le(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),l=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:o*s+a*l,h:o*l+a*s}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,i=o[n.unit]||o.millisecond,s=this._tickFormatFunction(e,0,fd(this,[e],this._majorUnit),i),l=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.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(dd(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return fl(e.sort(ad))}}T(jn,"id","time"),T(jn,"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 jo(t,e,n){let o=0,i=t.length-1,s,l,a,d;n?(e>=t[o].pos&&e<=t[i].pos&&({lo:o,hi:i}=rt(t,"pos",e)),{pos:s,time:a}=t[o],{pos:l,time:d}=t[i]):(e>=t[o].time&&e<=t[i].time&&({lo:o,hi:i}=rt(t,"time",e)),{time:s,pos:a}=t[o],{time:l,pos:d}=t[i]);const c=l-s;return c?a+(d-a)*(e-s)/c:a}class Ci extends jn{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=jo(n,this.min),this._tableRange=jo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,i=[],s=[];let l,a,d,c,u;for(l=0,a=e.length;l<a;++l)c=e[l],c>=n&&c<=o&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(l=0,a=i.length;l<a;++l)u=i[l+1],d=i[l-1],c=i[l],Math.round((u+d)/2)!==c&&s.push({time:c,pos:l/(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(jo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return jo(this._table,o*this._tableRange+this._minPos,!0)}}T(Ci,"id","timeseries"),T(Ci,"defaults",jn.defaults);var xg=Object.freeze({__proto__:null,CategoryScale:$i,LinearScale:wi,LogarithmicScale:_i,RadialLinearScale:Yn,TimeScale:jn,TimeSeriesScale:Ci});const Sg=[Em,l0,tg,xg];Ye.register(...Sg);const vg={class:"flex flex-col h-full m-24 overflow-hidden p-24"},Dg={class:"flex flex-col gap-8"},Mg={class:"fm-color-typo-primary fm-typo-body-lg-400"},Vg={class:"fm-color-typo-secondary fm-typo-body-md-400"},Bg={class:"grow"},Eg=r.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{},transpose:{type:Boolean,default:!1},stacked:{type:Boolean},maintainAspectRatio:{type:Boolean},hideXAxis:{type:Boolean,default:void 0},hideYAxis:{type:Boolean,default:void 0},legend:{default:void 0}},setup(t){const e=t,n=r.ref(null);let o=null;r.watch([()=>e.transpose,()=>e.maintainAspectRatio,()=>e.hideXAxis,()=>e.hideYAxis,()=>e.legend],()=>{o&&o.config.options&&(o.destroy(),a())});const i=r.computed(()=>e.transpose?"y":"x");function s({context:d,color:c}){const{ctx:u,chartArea:f}=d.chart;if(!f)return;const h=u==null?void 0:u.createLinearGradient(0,0,0,f.height);return h.addColorStop(0,vr(c,.5)),h.addColorStop(1,vr(c,0)),h}const l=r.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(d=>{const c=pn(d.color)??"";return{...d,backgroundColor:c?u=>s({context:u,color:c}):"",borderColor:c,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));r.watch(l,()=>{o&&(o.data=l.value,o.update())},{deep:!0});function a(){n.value&&(o=new Ye(n.value,{type:"line",data:l.value,options:{plugins:{legend:e.legend||{display:!0,position:"bottom",maxHeight:60,labels:{usePointStyle:!0,pointStyle:"line"}}},maintainAspectRatio:e.maintainAspectRatio,responsive:!0,indexAxis:i.value,scales:{x:{display:!e.hideXAxis,stacked:e.stacked,grid:{display:!1},beginAtZero:!0},y:{display:!e.hideYAxis,stacked:e.stacked,grid:{display:!0},position:"right",beginAtZero:!0}},elements:{line:{borderWidth:1.5},point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return r.onMounted(()=>{a()}),(d,c)=>(r.openBlock(),r.createElementBlock("div",vg,[r.createElementVNode("div",Dg,[r.renderSlot(d.$slots,"title"),r.createElementVNode("div",Mg,r.toDisplayString(d.name),1),r.createElementVNode("div",Vg,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("div",Bg,[r.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)])]))}}),Pg={class:"flex flex-col h-full overflow-hidden px-24 py-16"},Ng={class:"flex flex-col gap-8"},Fg={class:"fm-color-typo-primary fm-typo-body-lg-400"},Rg={class:"fm-color-typo-secondary fm-typo-body-md-400"},Ag={class:"grow"},Og=r.defineComponent({__name:"FmPie",props:{name:{default:void 0},variant:{},paragraph:{default:void 0},datasets:{},metrics:{},legend:{default:void 0},text:{default:void 0},textColor:{default:"#0E1715"},textStyle:{default:"bold 30px sans-serif"},maintainAspectRatio:{type:Boolean,default:!0},percentage:{default:void 0}},setup(t){const e=t,n=r.ref(null);let o=null;const i=r.computed(()=>e.percentage?e.percentage:e.variant==="doughnut"?"90%":"0"),s=r.computed(()=>e.text);r.watch([()=>e.metrics,()=>e.datasets,()=>e.variant,()=>e.legend,()=>e.textColor,()=>e.textStyle,()=>e.text,()=>e.maintainAspectRatio,()=>e.percentage],()=>{o&&(o.destroy(),a())});const l=r.computed(()=>({labels:e.metrics,datasets:e.datasets.map(d=>{var u;const c=(u=d.backgroundColor)==null?void 0:u.map(f=>pn(f)??"");return{...d,backgroundColor:c??void 0,hoverOffset:d.hoverOffset??0}})}));function a(){n.value&&(o=new Ye(n.value,{type:"doughnut",data:l.value,options:{maintainAspectRatio:e.maintainAspectRatio,responsive:!0,cutout:i.value,plugins:{legend:e.legend||{display:!0,position:"bottom",maxHeight:60,labels:{usePointStyle:!0}}}},plugins:[{id:"doughnutlabel",beforeDatasetsDraw:d=>{if(e.variant==="doughnut"){const{ctx:c}=d;c.save();const u=d.getDatasetMeta(0).data[0].x,f=d.getDatasetMeta(0).data[0].y;if(c.font=e.textStyle,c.textAlign="center",c.textBaseline="middle",s.value&&s.value!==""){const h=s.value.split(`
27
+ `);for(let m=0;m<h.length;m++){const p=m===0?1:.7;c.fillStyle=vr(pn(e.textColor)??"",p),c.fillText(h[m],u,f+m*40)}}}}}]}))}return r.onMounted(()=>{a()}),(d,c)=>(r.openBlock(),r.createElementBlock("div",Pg,[r.createElementVNode("div",Ng,[r.renderSlot(d.$slots,"title"),r.createElementVNode("div",Fg,r.toDisplayString(d.name),1),r.createElementVNode("div",Rg,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("div",Ag,[r.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)])]))}}),Ig={class:"flex flex-col h-full overflow-hidden px-24 py-16"},Tg={class:"flex flex-col gap-8"},zg={class:"fm-color-typo-primary fm-typo-body-lg-400"},Lg={class:"fm-color-typo-secondary fm-typo-body-md-400"},Hg={class:"grow"},Yg=r.defineComponent({__name:"FmBar",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{},transpose:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},maintainAspectRatio:{type:Boolean,default:!0},hideXAxis:{type:Boolean,default:void 0},hideYAxis:{type:Boolean,default:void 0},legend:{default:void 0}},setup(t){const e=t,n=r.ref(null);let o=null;r.watch([()=>e.transpose,()=>e.maintainAspectRatio,()=>e.legend,()=>e.hideXAxis,()=>e.hideYAxis],()=>{o&&(o.destroy(),l())});const i=r.computed(()=>e.transpose?"y":"x"),s=r.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(a=>{var u;let d,c;return typeof a.backgroundColor=="string"?d=a.backgroundColor:typeof a.backgroundColor=="object"&&(d=a.backgroundColor.map(f=>pn(f)??"")),typeof a.borderColor=="string"?c=a.borderColor:typeof a.borderColor=="object"&&(c=(u=a.borderColor)==null?void 0:u.map(f=>pn(f)??"")),{...a,backgroundColor:d,borderColor:c,borderRadius:10,borderWidth:c?1:0}})}));r.watch(s,()=>{o&&(o.data=s.value,o.update())},{deep:!0});function l(){n.value&&(o=new Ye(n.value,{type:"bar",data:s.value,options:{plugins:{legend:e.legend||{display:!0,position:"bottom",maxHeight:60,labels:{usePointStyle:!0}}},maintainAspectRatio:e.maintainAspectRatio,responsive:!0,indexAxis:i.value,scales:{x:{display:!e.hideXAxis,stacked:e.stacked,grid:{display:!1},beginAtZero:!0},y:{display:!e.hideYAxis,stacked:e.stacked,grid:{display:!1},position:"right",beginAtZero:!0}},elements:{point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return r.onMounted(()=>{l()}),(a,d)=>(r.openBlock(),r.createElementBlock("div",Ig,[r.createElementVNode("div",Tg,[r.renderSlot(a.$slots,"title"),r.createElementVNode("div",zg,r.toDisplayString(a.name),1),r.createElementVNode("div",Lg,r.toDisplayString(a.paragraph),1)]),r.createElementVNode("div",Hg,[r.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)])]))}});var jg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hd={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(jg,function(){var n=1e3,o=6e4,i=36e5,s="millisecond",l="second",a="minute",d="hour",c="day",u="week",f="month",h="quarter",m="year",p="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+)?$/,y=/\[([^\]]+)]|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,C={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(M){var P=["th","st","nd","rd"],V=M%100;return"["+M+(P[(V-20)%10]||P[V]||P[0])+"]"}},v=function(M,P,V){var F=String(M);return!F||F.length>=P?M:""+Array(P+1-F.length).join(V)+M},_={s:v,z:function(M){var P=-M.utcOffset(),V=Math.abs(P),F=Math.floor(V/60),A=V%60;return(P<=0?"+":"-")+v(F,2,"0")+":"+v(A,2,"0")},m:function M(P,V){if(P.date()<V.date())return-M(V,P);var F=12*(V.year()-P.year())+(V.month()-P.month()),A=P.clone().add(F,f),L=V-A<0,z=P.clone().add(F+(L?-1:1),f);return+(-(F+(V-A)/(L?A-z:z-A))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:f,y:m,w:u,d:c,D:p,h:d,m:a,s:l,ms:s,Q:h}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},x="en",N={};N[x]=C;var E="$isDayjsObject",R=function(M){return M instanceof $||!(!M||!M[E])},k=function M(P,V,F){var A;if(!P)return x;if(typeof P=="string"){var L=P.toLowerCase();N[L]&&(A=L),V&&(N[L]=V,A=L);var z=P.split("-");if(!A&&z.length>1)return M(z[0])}else{var W=P.name;N[W]=P,A=W}return!F&&A&&(x=A),A||!F&&x},S=function(M,P){if(R(M))return M.clone();var V=typeof P=="object"?P:{};return V.date=M,V.args=arguments,new $(V)},w=_;w.l=k,w.i=R,w.w=function(M,P){return S(M,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var $=function(){function M(V){this.$L=k(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[E]=!0}var P=M.prototype;return P.parse=function(V){this.$d=function(F){var A=F.date,L=F.utc;if(A===null)return new Date(NaN);if(w.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var z=A.match(b);if(z){var W=z[2]-1||0,X=(z[7]||"0").substring(0,3);return L?new Date(Date.UTC(z[1],W,z[3]||1,z[4]||0,z[5]||0,z[6]||0,X)):new Date(z[1],W,z[3]||1,z[4]||0,z[5]||0,z[6]||0,X)}}return new Date(A)}(V),this.init()},P.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},P.$utils=function(){return w},P.isValid=function(){return this.$d.toString()!==g},P.isSame=function(V,F){var A=S(V);return this.startOf(F)<=A&&A<=this.endOf(F)},P.isAfter=function(V,F){return S(V)<this.startOf(F)},P.isBefore=function(V,F){return this.endOf(F)<S(V)},P.$g=function(V,F,A){return w.u(V)?this[F]:this.set(A,V)},P.unix=function(){return Math.floor(this.valueOf()/1e3)},P.valueOf=function(){return this.$d.getTime()},P.startOf=function(V,F){var A=this,L=!!w.u(F)||F,z=w.p(V),W=function(Oe,he){var Ee=w.w(A.$u?Date.UTC(A.$y,he,Oe):new Date(A.$y,he,Oe),A);return L?Ee:Ee.endOf(c)},X=function(Oe,he){return w.w(A.toDate()[Oe].apply(A.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(he)),A)},K=this.$W,te=this.$M,ae=this.$D,pe="set"+(this.$u?"UTC":"");switch(z){case m:return L?W(1,0):W(31,11);case f:return L?W(1,te):W(0,te+1);case u:var Ae=this.$locale().weekStart||0,Ue=(K<Ae?K+7:K)-Ae;return W(L?ae-Ue:ae+(6-Ue),te);case c:case p:return X(pe+"Hours",0);case d:return X(pe+"Minutes",1);case a:return X(pe+"Seconds",2);case l:return X(pe+"Milliseconds",3);default:return this.clone()}},P.endOf=function(V){return this.startOf(V,!1)},P.$set=function(V,F){var A,L=w.p(V),z="set"+(this.$u?"UTC":""),W=(A={},A[c]=z+"Date",A[p]=z+"Date",A[f]=z+"Month",A[m]=z+"FullYear",A[d]=z+"Hours",A[a]=z+"Minutes",A[l]=z+"Seconds",A[s]=z+"Milliseconds",A)[L],X=L===c?this.$D+(F-this.$W):F;if(L===f||L===m){var K=this.clone().set(p,1);K.$d[W](X),K.init(),this.$d=K.set(p,Math.min(this.$D,K.daysInMonth())).$d}else W&&this.$d[W](X);return this.init(),this},P.set=function(V,F){return this.clone().$set(V,F)},P.get=function(V){return this[w.p(V)]()},P.add=function(V,F){var A,L=this;V=Number(V);var z=w.p(F),W=function(te){var ae=S(L);return w.w(ae.date(ae.date()+Math.round(te*V)),L)};if(z===f)return this.set(f,this.$M+V);if(z===m)return this.set(m,this.$y+V);if(z===c)return W(1);if(z===u)return W(7);var X=(A={},A[a]=o,A[d]=i,A[l]=n,A)[z]||1,K=this.$d.getTime()+V*X;return w.w(K,this)},P.subtract=function(V,F){return this.add(-1*V,F)},P.format=function(V){var F=this,A=this.$locale();if(!this.isValid())return A.invalidDate||g;var L=V||"YYYY-MM-DDTHH:mm:ssZ",z=w.z(this),W=this.$H,X=this.$m,K=this.$M,te=A.weekdays,ae=A.months,pe=A.meridiem,Ae=function(he,Ee,pt,et){return he&&(he[Ee]||he(F,L))||pt[Ee].slice(0,et)},Ue=function(he){return w.s(W%12||12,he,"0")},Oe=pe||function(he,Ee,pt){var et=he<12?"AM":"PM";return pt?et.toLowerCase():et};return L.replace(y,function(he,Ee){return Ee||function(pt){switch(pt){case"YY":return String(F.$y).slice(-2);case"YYYY":return w.s(F.$y,4,"0");case"M":return K+1;case"MM":return w.s(K+1,2,"0");case"MMM":return Ae(A.monthsShort,K,ae,3);case"MMMM":return Ae(ae,K);case"D":return F.$D;case"DD":return w.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return Ae(A.weekdaysMin,F.$W,te,2);case"ddd":return Ae(A.weekdaysShort,F.$W,te,3);case"dddd":return te[F.$W];case"H":return String(W);case"HH":return w.s(W,2,"0");case"h":return Ue(1);case"hh":return Ue(2);case"a":return Oe(W,X,!0);case"A":return Oe(W,X,!1);case"m":return String(X);case"mm":return w.s(X,2,"0");case"s":return String(F.$s);case"ss":return w.s(F.$s,2,"0");case"SSS":return w.s(F.$ms,3,"0");case"Z":return z}return null}(he)||z.replace(":","")})},P.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},P.diff=function(V,F,A){var L,z=this,W=w.p(F),X=S(V),K=(X.utcOffset()-this.utcOffset())*o,te=this-X,ae=function(){return w.m(z,X)};switch(W){case m:L=ae()/12;break;case f:L=ae();break;case h:L=ae()/3;break;case u:L=(te-K)/6048e5;break;case c:L=(te-K)/864e5;break;case d:L=te/i;break;case a:L=te/o;break;case l:L=te/n;break;default:L=te}return A?L:w.a(L)},P.daysInMonth=function(){return this.endOf(f).$D},P.$locale=function(){return N[this.$L]},P.locale=function(V,F){if(!V)return this.$L;var A=this.clone(),L=k(V,F,!0);return L&&(A.$L=L),A},P.clone=function(){return w.w(this.$d,this)},P.toDate=function(){return new Date(this.valueOf())},P.toJSON=function(){return this.isValid()?this.toISOString():null},P.toISOString=function(){return this.$d.toISOString()},P.toString=function(){return this.$d.toUTCString()},M}(),B=$.prototype;return S.prototype=B,[["$ms",s],["$s",l],["$m",a],["$H",d],["$W",c],["$M",f],["$y",m],["$D",p]].forEach(function(M){B[M[1]]=function(P){return this.$g(P,M[0],M[1])}}),S.extend=function(M,P){return M.$i||(M(P,$,S),M.$i=!0),S},S.locale=k,S.isDayjs=R,S.unix=function(M){return S(1e3*M)},S.en=N[x],S.Ls=N,S.p={},S})})(hd);var Wg=hd.exports;const D=xi(Wg);function Se(t,e){return t===null||e===null||typeof t!="object"&&typeof e!="object"?t===e:Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Se(t[n],e[n]))}const fe=(t,e,n)=>t&&e&&n?t.isAfter(e,"day")&&t.isBefore(n,"day"):!1,Ug={class:"fm-checkbox"},Gg={class:"fm-checkbox--wrapper"},qg={class:"fm-checkbox__input--container"},Xg=["checked","disabled","indeterminate"],Kg={key:0,class:"fm-checkbox__label-container"},Zg={class:"fm-typo-body-lg-400"},Jg={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},md=r.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:void 0},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=q(e,"indeterminate"),l=Array.isArray(i.value),a=r.ref(l?i.value.some(u=>Se(u,e.value)):i.value),d=r.computed(()=>{const u=l?i.value.some(f=>Se(f,e.value)):i.value;return s.value&&!u?"remove":i.value?"check_small":""});function c(){if(o.value)return;s.value=!1,a.value=!a.value;let u=i.value;l?u=a.value?u.concat(e.value):u.filter(f=>!Se(f,e.value)):u=a.value,i.value=u}return r.watch(()=>i.value,()=>{a.value=l?i.value.some(u=>Se(u,e.value)):i.value}),(u,f)=>(r.openBlock(),r.createElementBlock("div",Ug,[r.createElementVNode("label",Gg,[r.createElementVNode("div",qg,[r.createElementVNode("input",{checked:a.value,class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":a.value}),disabled:o.value,indeterminate:r.unref(s),type:"checkbox",onInput:c},null,42,Xg),r.unref(s)||a.value?(r.openBlock(),r.createBlock(H,{key:0,name:d.value,class:"fm-checkbox__input--checkmark",color:"#FFFFFF",size:"md"},null,8,["name"])):r.createCommentVNode("",!0)]),e.label?(r.openBlock(),r.createElementBlock("div",Kg,[r.renderSlot(u.$slots,"label"),r.createElementVNode("div",Zg,r.toDisplayString(e.label),1),e.sublabel?(r.openBlock(),r.createElementBlock("div",Jg,r.toDisplayString(e.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]))}}),Qg={class:"w-full"},le=J(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:void 0},focused:{type:Boolean,default:!1},iconOutlined:{type:Boolean,default:!1},size:{default:"sm"}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1);return(i,s)=>(r.openBlock(),r.createBlock(e.tag,{class:r.normalizeClass({"fm-field":!0,"fm-field--focused":i.focused,"fm-field--invalid":i.invalid,"fm-field--valid":i.showValidBorder&&!i.invalid,"fm-field--disabled":o.value,"fm-field--md":i.size==="md","fm-field--sm":i.size==="sm"})},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"prepend",{},()=>[i.prependIcon?(r.openBlock(),r.createBlock(H,{key:0,color:o.value?"disabled":"neutral-black",name:i.prependIcon,outline:i.iconOutlined,size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",Qg,[r.renderSlot(i.$slots,"default",{},void 0,!0)]),r.renderSlot(i.$slots,"append",{},()=>[i.appendIcon?(r.openBlock(),r.createBlock(H,{key:0,color:o.value?"disabled":"neutral-black",name:i.appendIcon,outline:i.iconOutlined,size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-89e62420"]]),e1={class:"flex gap-4"},pd=r.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:void 0},state:{default:"none"},errorMessages:{default:()=>[]}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=r.computed(()=>e.state==="success"?"check_circle":e.state==="warning"?"warning":e.state==="error"?"error":""),s=r.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(l,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":o.value,"text-fm-color-typo-secondary":l.state==="none"&&!o.value,"text-fm-color-typo-success":l.state==="success"&&!o.value,"text-fm-color-typo-warning":l.state==="warning"&&!o.value,"text-fm-color-typo-error":l.state==="error"&&!o.value}])},[l.errorMessages.length===0?r.renderSlot(l.$slots,"default",{key:0},()=>[r.createElementVNode("div",e1,[i.value?(r.openBlock(),r.createBlock(H,{key:0,class:r.normalizeClass([s.value,"mt-[2px]"]),name:i.value,size:"sm"},null,8,["class","name"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(l.text),1)])]):r.renderSlot(l.$slots,"default",{key:1},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.errorMessages,d=>(r.openBlock(),r.createElementBlock("div",{key:d,class:"flex gap-4 text-fm-color-typo-error"},[r.createVNode(H,{class:"mt-[2px] text-fm-color-system-error-300",name:"error",size:"sm"}),r.createElementVNode("span",null,r.toDisplayString(d),1)]))),128))])],2))}}),rn=Math.min,Gt=Math.max,Wo=Math.round,Uo=Math.floor,Mt=t=>({x:t,y:t}),t1={left:"right",right:"left",bottom:"top",top:"bottom"},n1={start:"end",end:"start"};function Si(t,e,n){return Gt(t,rn(e,n))}function Wn(t,e){return typeof t=="function"?t(e):t}function qt(t){return t.split("-")[0]}function Un(t){return t.split("-")[1]}function gd(t){return t==="x"?"y":"x"}function vi(t){return t==="y"?"height":"width"}function Go(t){return["top","bottom"].includes(qt(t))?"y":"x"}function Di(t){return gd(Go(t))}function o1(t,e,n){n===void 0&&(n=!1);const o=Un(t),i=Di(t),s=vi(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=qo(l)),[l,qo(l)]}function r1(t){const e=qo(t);return[Mi(t),e,Mi(e)]}function Mi(t){return t.replace(/start|end/g,e=>n1[e])}function i1(t,e,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:l;default:return[]}}function s1(t,e,n,o){const i=Un(t);let s=i1(qt(t),n==="start",o);return i&&(s=s.map(l=>l+"-"+i),e&&(s=s.concat(s.map(Mi)))),s}function qo(t){return t.replace(/left|right|bottom|top/g,e=>t1[e])}function l1(t){return{top:0,right:0,bottom:0,left:0,...t}}function bd(t){return typeof t!="number"?l1(t):{top:t,right:t,bottom:t,left:t}}function Xo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function yd(t,e,n){let{reference:o,floating:i}=t;const s=Go(e),l=Di(e),a=vi(l),d=qt(e),c=s==="y",u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let m;switch(d){case"top":m={x:u,y:o.y-i.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-i.width,y:f};break;default:m={x:o.x,y:o.y}}switch(Un(e)){case"start":m[l]-=h*(n&&c?-1:1);break;case"end":m[l]+=h*(n&&c?-1:1);break}return m}const a1=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,a=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=yd(c,o,d),h=o,m={},p=0;for(let g=0;g<a.length;g++){const{name:b,fn:y}=a[g],{x:C,y:v,data:_,reset:x}=await y({x:u,y:f,initialPlacement:o,placement:h,strategy:i,middlewareData:m,rects:c,platform:l,elements:{reference:t,floating:e}});u=C??u,f=v??f,m={...m,[b]:{...m[b],..._}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(c=x.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:u,y:f}=yd(c,h,d)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:m}};async function $d(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:l,elements:a,strategy:d}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Wn(e,t),p=bd(m),b=a[h?f==="floating"?"reference":"floating":f],y=Xo(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:c,rootBoundary:u,strategy:d})),C=f==="floating"?{...l.floating,x:o,y:i}:l.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),_=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},x=Xo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:v,strategy:d}):C);return{top:(y.top-x.top+p.top)/_.y,bottom:(x.bottom-y.bottom+p.bottom)/_.y,left:(y.left-x.left+p.left)/_.x,right:(x.right-y.right+p.right)/_.x}}const d1=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:s,platform:l,elements:a,middlewareData:d}=e,{element:c,padding:u=0}=Wn(t,e)||{};if(c==null)return{};const f=bd(u),h={x:n,y:o},m=Di(i),p=vi(m),g=await l.getDimensions(c),b=m==="y",y=b?"top":"left",C=b?"bottom":"right",v=b?"clientHeight":"clientWidth",_=s.reference[p]+s.reference[m]-h[m]-s.floating[p],x=h[m]-s.reference[m],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let E=N?N[v]:0;(!E||!await(l.isElement==null?void 0:l.isElement(N)))&&(E=a.floating[v]||s.floating[p]);const R=_/2-x/2,k=E/2-g[p]/2-1,S=rn(f[y],k),w=rn(f[C],k),$=S,B=E-g[p]-w,M=E/2-g[p]/2+R,P=Si($,M,B),V=!d.arrow&&Un(i)!=null&&M!==P&&s.reference[p]/2-(M<$?S:w)-g[p]/2<0,F=V?M<$?M-$:M-B:0;return{[m]:h[m]+F,data:{[m]:P,centerOffset:M-P-F,...V&&{alignmentOffset:F}},reset:V}}}),c1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:l,initialPlacement:a,platform:d,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...b}=Wn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=qt(i),C=qt(a)===a,v=await(d.isRTL==null?void 0:d.isRTL(c.floating)),_=h||(C||!g?[qo(a)]:r1(a));!h&&p!=="none"&&_.push(...s1(a,g,p,v));const x=[a,..._],N=await $d(e,b),E=[];let R=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&E.push(N[y]),f){const $=o1(i,l,v);E.push(N[$[0]],N[$[1]])}if(R=[...R,{placement:i,overflows:E}],!E.every($=>$<=0)){var k,S;const $=(((k=s.flip)==null?void 0:k.index)||0)+1,B=x[$];if(B)return{data:{index:$,overflows:R},reset:{placement:B}};let M=(S=R.filter(P=>P.overflows[0]<=0).sort((P,V)=>P.overflows[1]-V.overflows[1])[0])==null?void 0:S.placement;if(!M)switch(m){case"bestFit":{var w;const P=(w=R.map(V=>[V.placement,V.overflows.filter(F=>F>0).reduce((F,A)=>F+A,0)]).sort((V,F)=>V[1]-F[1])[0])==null?void 0:w[0];P&&(M=P);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};async function u1(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=qt(n),a=Un(n),d=Go(n)==="y",c=["left","top"].includes(l)?-1:1,u=s&&d?-1:1,f=Wn(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),d?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const Gn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:l,middlewareData:a}=e,d=await u1(e,t);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:s+d.y,data:{...d,placement:l}}}}},f1=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:l=!1,limiter:a={fn:b=>{let{x:y,y:C}=b;return{x:y,y:C}}},...d}=Wn(t,e),c={x:n,y:o},u=await $d(e,d),f=Go(qt(i)),h=gd(f);let m=c[h],p=c[f];if(s){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",C=m+u[b],v=m-u[y];m=Si(C,m,v)}if(l){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",C=p+u[b],v=p-u[y];p=Si(C,p,v)}const g=a.fn({...e,[h]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-o}}}}};function dt(t){return Vi(t)?(t.nodeName||"").toLowerCase():"#document"}function Fe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ct(t){var e;return(e=(Vi(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vi(t){return t instanceof Node||t instanceof Fe(t).Node}function ut(t){return t instanceof Element||t instanceof Fe(t).Element}function Ke(t){return t instanceof HTMLElement||t instanceof Fe(t).HTMLElement}function wd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Fe(t).ShadowRoot}function qn(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Te(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function h1(t){return["table","td","th"].includes(dt(t))}function Bi(t){const e=Ei(),n=Te(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 m1(t){let e=sn(t);for(;Ke(e)&&!Ko(e);){if(Bi(e))return e;e=sn(e)}return null}function Ei(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ko(t){return["html","body","#document"].includes(dt(t))}function Te(t){return Fe(t).getComputedStyle(t)}function Zo(t){return ut(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function sn(t){if(dt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||wd(t)&&t.host||ct(t);return wd(e)?e.host:e}function _d(t){const e=sn(t);return Ko(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ke(e)&&qn(e)?e:_d(e)}function Xn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=_d(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),l=Fe(i);return s?e.concat(l,l.visualViewport||[],qn(i)?i:[],l.frameElement&&n?Xn(l.frameElement):[]):e.concat(i,Xn(i,[],n))}function kd(t){const e=Te(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Ke(t),s=i?t.offsetWidth:n,l=i?t.offsetHeight:o,a=Wo(n)!==s||Wo(o)!==l;return a&&(n=s,o=l),{width:n,height:o,$:a}}function Pi(t){return ut(t)?t:t.contextElement}function ln(t){const e=Pi(t);if(!Ke(e))return Mt(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=kd(e);let l=(s?Wo(n.width):n.width)/o,a=(s?Wo(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const p1=Mt(0);function Cd(t){const e=Fe(t);return!Ei()||!e.visualViewport?p1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function g1(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Fe(t)?!1:e}function Xt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Pi(t);let l=Mt(1);e&&(o?ut(o)&&(l=ln(o)):l=ln(t));const a=g1(s,n,o)?Cd(s):Mt(0);let d=(i.left+a.x)/l.x,c=(i.top+a.y)/l.y,u=i.width/l.x,f=i.height/l.y;if(s){const h=Fe(s),m=o&&ut(o)?Fe(o):o;let p=h,g=p.frameElement;for(;g&&o&&m!==p;){const b=ln(g),y=g.getBoundingClientRect(),C=Te(g),v=y.left+(g.clientLeft+parseFloat(C.paddingLeft))*b.x,_=y.top+(g.clientTop+parseFloat(C.paddingTop))*b.y;d*=b.x,c*=b.y,u*=b.x,f*=b.y,d+=v,c+=_,p=Fe(g),g=p.frameElement}}return Xo({width:u,height:f,x:d,y:c})}const b1=[":popover-open",":modal"];function xd(t){return b1.some(e=>{try{return t.matches(e)}catch{return!1}})}function y1(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",l=ct(o),a=e?xd(e.floating):!1;if(o===l||a&&s)return n;let d={scrollLeft:0,scrollTop:0},c=Mt(1);const u=Mt(0),f=Ke(o);if((f||!f&&!s)&&((dt(o)!=="body"||qn(l))&&(d=Zo(o)),Ke(o))){const h=Xt(o);c=ln(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+u.x,y:n.y*c.y-d.scrollTop*c.y+u.y}}function $1(t){return Array.from(t.getClientRects())}function Sd(t){return Xt(ct(t)).left+Zo(t).scrollLeft}function w1(t){const e=ct(t),n=Zo(t),o=t.ownerDocument.body,i=Gt(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=Gt(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Sd(t);const a=-n.scrollTop;return Te(o).direction==="rtl"&&(l+=Gt(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:l,y:a}}function _1(t,e){const n=Fe(t),o=ct(t),i=n.visualViewport;let s=o.clientWidth,l=o.clientHeight,a=0,d=0;if(i){s=i.width,l=i.height;const c=Ei();(!c||c&&e==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}return{width:s,height:l,x:a,y:d}}function k1(t,e){const n=Xt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ke(t)?ln(t):Mt(1),l=t.clientWidth*s.x,a=t.clientHeight*s.y,d=i*s.x,c=o*s.y;return{width:l,height:a,x:d,y:c}}function vd(t,e,n){let o;if(e==="viewport")o=_1(t,n);else if(e==="document")o=w1(ct(t));else if(ut(e))o=k1(e,n);else{const i=Cd(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return Xo(o)}function Dd(t,e){const n=sn(t);return n===e||!ut(n)||Ko(n)?!1:Te(n).position==="fixed"||Dd(n,e)}function C1(t,e){const n=e.get(t);if(n)return n;let o=Xn(t,[],!1).filter(a=>ut(a)&&dt(a)!=="body"),i=null;const s=Te(t).position==="fixed";let l=s?sn(t):t;for(;ut(l)&&!Ko(l);){const a=Te(l),d=Bi(l);!d&&a.position==="fixed"&&(i=null),(s?!d&&!i:!d&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||qn(l)&&!d&&Dd(t,l))?o=o.filter(u=>u!==l):i=a,l=sn(l)}return e.set(t,o),o}function x1(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?C1(e,this._c):[].concat(n),o],a=l[0],d=l.reduce((c,u)=>{const f=vd(e,u,i);return c.top=Gt(f.top,c.top),c.right=rn(f.right,c.right),c.bottom=rn(f.bottom,c.bottom),c.left=Gt(f.left,c.left),c},vd(e,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function S1(t){const{width:e,height:n}=kd(t);return{width:e,height:n}}function v1(t,e,n){const o=Ke(e),i=ct(e),s=n==="fixed",l=Xt(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const d=Mt(0);if(o||!o&&!s)if((dt(e)!=="body"||qn(i))&&(a=Zo(e)),o){const f=Xt(e,!0,s,e);d.x=f.x+e.clientLeft,d.y=f.y+e.clientTop}else i&&(d.x=Sd(i));const c=l.left+a.scrollLeft-d.x,u=l.top+a.scrollTop-d.y;return{x:c,y:u,width:l.width,height:l.height}}function Md(t,e){return!Ke(t)||Te(t).position==="fixed"?null:e?e(t):t.offsetParent}function Vd(t,e){const n=Fe(t);if(!Ke(t)||xd(t))return n;let o=Md(t,e);for(;o&&h1(o)&&Te(o).position==="static";)o=Md(o,e);return o&&(dt(o)==="html"||dt(o)==="body"&&Te(o).position==="static"&&!Bi(o))?n:o||m1(t)||n}const D1=async function(t){const e=this.getOffsetParent||Vd,n=this.getDimensions;return{reference:v1(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}};function M1(t){return Te(t).direction==="rtl"}const V1={convertOffsetParentRelativeRectToViewportRelativeRect:y1,getDocumentElement:ct,getClippingRect:x1,getOffsetParent:Vd,getElementRects:D1,getClientRects:$1,getDimensions:S1,getScale:ln,isElement:ut,isRTL:M1};function B1(t,e){let n=null,o;const i=ct(t);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),s();const{left:c,top:u,width:f,height:h}=t.getBoundingClientRect();if(a||e(),!f||!h)return;const m=Uo(u),p=Uo(i.clientWidth-(c+f)),g=Uo(i.clientHeight-(u+h)),b=Uo(c),C={rootMargin:-m+"px "+-p+"px "+-g+"px "+-b+"px",threshold:Gt(0,rn(1,d))||1};let v=!0;function _(x){const N=x[0].intersectionRatio;if(N!==d){if(!v)return l();N?l(!1,N):o=setTimeout(()=>{l(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(_,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,C)}n.observe(t)}return l(!0),s}function Kn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=Pi(t),u=i||s?[...c?Xn(c):[],...Xn(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=c&&a?B1(c,n):null;let h=-1,m=null;l&&(m=new ResizeObserver(y=>{let[C]=y;C&&C.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),c&&!d&&m.observe(c),m.observe(e));let p,g=d?Xt(t):null;d&&b();function b(){const y=Xt(t);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,p=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,d&&cancelAnimationFrame(p)}}const Bd=f1,Zn=c1,E1=d1,P1=(t,e,n)=>{const o=new Map,i={platform:V1,...n},s={...i.platform,_c:o};return a1(t,e,{...i,platform:s})};function N1(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ni(t){if(N1(t)){const e=t.$el;return Vi(e)&&dt(e)==="#comment"?null:e}return t}function Ed(t){return{name:"arrow",options:t,fn(e){const n=Ni(r.unref(t.element));return n==null?{}:E1({element:n,padding:t.padding}).fn(e)}}}function Pd(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Nd(t,e){const n=Pd(t);return Math.round(e*n)/n}function Jn(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=r.computed(()=>{var E;return(E=r.unref(n.open))!=null?E:!0}),s=r.computed(()=>r.unref(n.middleware)),l=r.computed(()=>{var E;return(E=r.unref(n.placement))!=null?E:"bottom"}),a=r.computed(()=>{var E;return(E=r.unref(n.strategy))!=null?E:"absolute"}),d=r.computed(()=>{var E;return(E=r.unref(n.transform))!=null?E:!0}),c=r.computed(()=>Ni(t.value)),u=r.computed(()=>Ni(e.value)),f=r.ref(0),h=r.ref(0),m=r.ref(a.value),p=r.ref(l.value),g=r.shallowRef({}),b=r.ref(!1),y=r.computed(()=>{const E={position:m.value,left:"0",top:"0"};if(!u.value)return E;const R=Nd(u.value,f.value),k=Nd(u.value,h.value);return d.value?{...E,transform:"translate("+R+"px, "+k+"px)",...Pd(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:R+"px",top:k+"px"}});let C;function v(){c.value==null||u.value==null||P1(c.value,u.value,{middleware:s.value,placement:l.value,strategy:a.value}).then(E=>{f.value=E.x,h.value=E.y,m.value=E.strategy,p.value=E.placement,g.value=E.middlewareData,b.value=!0})}function _(){typeof C=="function"&&(C(),C=void 0)}function x(){if(_(),o===void 0){v();return}if(c.value!=null&&u.value!=null){C=o(c.value,u.value,v);return}}function N(){i.value||(b.value=!1)}return r.watch([s,l,a],v,{flush:"sync"}),r.watch([c,u],x,{flush:"sync"}),r.watch(i,N,{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(_),{x:r.shallowReadonly(f),y:r.shallowReadonly(h),strategy:r.shallowReadonly(m),placement:r.shallowReadonly(p),middlewareData:r.shallowReadonly(g),isPositioned:r.shallowReadonly(b),floatingStyles:y,update:v}}const Fd=r.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},placement:{default:"top"},hideArrow:{type:Boolean,default:!1},content:{default:""},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=r.ref(null),o=r.ref(null),i=r.ref(null),{floatingStyles:s,middlewareData:l,placement:a}=Jn(n,o,{whileElementsMounted:Kn,placement:e.placement,middleware:[Zn(),Gn({mainAxis:6}),Ed({element:i})]}),d=r.ref(!1),c=r.ref(0),u=r.ref(0),f=()=>{e.disabled||(clearTimeout(u.value),c.value=window.setTimeout(()=>{d.value=!0},250))},h=()=>{e.disabled||(clearTimeout(c.value),u.value=window.setTimeout(()=>d.value=!1,250))},m=()=>{clearTimeout(u.value),d.value=!0},p=r.computed(()=>{var b,y,C,v;const g={top:"bottom",right:"left",bottom:"top",left:"right"}[a.value];return{left:((b=l.value.arrow)==null?void 0:b.x)!=null?`${(y=l.value.arrow)==null?void 0:y.x}px`:"",top:((C=l.value.arrow)==null?void 0:C.y)!=null?`${(v=l.value.arrow)==null?void 0:v.y}px`:"",[g]:"-3px"}});return(g,b)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"referenceEl",ref:n,class:r.normalizeClass([{"cursor-not-allowed pointer-events-none":g.disabled},"cursor-pointer flex items-center justify-center relative w-max"]),onPointerdown:h,onPointerleave:h,onPointermove:b[0]||(b[0]=y=>{y.pointerType!=="touch"&&f()}),onPointerup:h},[r.renderSlot(g.$slots,"default")],34),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[d.value&&!g.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"tooltipContent",ref:o,class:r.normalizeClass([{"bg-fm-color-neutral-black text-fm-color-typo-white fm-typo-body-sm-400":g.variant==="plain","bg-fm-color-neutral-white text-fm-color-typo-secondary fm-typo-body-md-400":g.variant==="rich"},"fm-shadow-light-300 max-w-[240px] px-8 py-4 rounded-md"]),style:r.normalizeStyle(r.unref(s)),onMouseenter:m,onMouseleave:h},[r.renderSlot(g.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(g.content),1)]),r.withDirectives(r.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:r.normalizeClass([{"bg-fm-color-neutral-black":g.variant==="plain","bg-fm-color-neutral-white":g.variant==="rich"},"absolute h-8 rotate-45 rounded-[2px] w-8"]),style:r.normalizeStyle(p.value)},null,6),[[r.vShow,!g.hideArrow]])],38)):r.createCommentVNode("",!0)]))]))}}),Kt=r.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:void 0},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1);return(i,s)=>i.label||i.$slots.default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 flex gap-4",o.value?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":i.info}])},[r.renderSlot(i.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(i.label),1),i.required?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["fm-typo-body-lg-700",o.value?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):r.createCommentVNode("",!0),i.optional?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-md-400",o.value?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):r.createCommentVNode("",!0),i.info?(r.openBlock(),r.createBlock(Fd,{key:2,content:i.info,disabled:o.value,placement:"top"},{default:r.withCtx(()=>[r.createVNode(H,{class:r.normalizeClass(["fm-typo-body-md-400",o.value?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"]),name:"info",size:"sm"},null,8,["class"])]),_:1},8,["content","disabled"])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)}}),F1={key:1,class:"flex items-center justify-between"},_e=r.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:void 0},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,n=r.inject(ye),{errorMessages:o,isPristine:i}=Us(e),{focus:s,blur:l}=bn(),a=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),d=r.computed(()=>({label:e.label,disabled:a.value,required:e.required,optional:e.optional,info:e.info})),c=r.computed(()=>({text:e.helperText,disabled:a.value,state:e.helperState,errorMessages:o.value})),u=r.computed(()=>({isPristine:i,invalid:o.value.length>0}));return(f,h)=>(r.openBlock(),r.createBlock(e.tag,{class:"flex flex-col gap-4",onBlur:r.unref(l),onClick:r.unref(s)},{default:r.withCtx(()=>[f.label||f.$slots.label?(r.openBlock(),r.createBlock(Kt,r.normalizeProps(r.mergeProps({key:0},d.value)),{default:r.withCtx(()=>[r.renderSlot(f.$slots,"label")]),_:3},16)):r.createCommentVNode("",!0),r.renderSlot(f.$slots,"default",r.normalizeProps(r.guardReactiveProps(u.value))),c.value.text||c.value.errorMessages.length>0||f.$slots["helper-text"]||f.$slots["helper-append"]?(r.openBlock(),r.createElementBlock("div",F1,[r.createVNode(pd,r.normalizeProps(r.guardReactiveProps(c.value)),{default:r.withCtx(()=>[r.renderSlot(f.$slots,"helper-text")]),_:3},16),r.renderSlot(f.$slots,"helper-append")])):r.createCommentVNode("",!0)]),_:3},8,["onBlur","onClick"]))}}),Ze=J(r.defineComponent({__name:"FmMenu",props:{placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1},trigger:{default:"click"},closeOnClick:{type:Boolean,default:!0},width:{default:void 0},maxHeight:{default:408},inPopover:{type:Boolean,default:!1},stopClickPropagation:{type:Boolean},zIndex:{default:99}},emits:["menu-changed"],setup(t,{emit:e}){const n=t,o=e,i=r.ref([]);let s;const l=r.ref(),a=r.ref(!1),d=r.ref(!1),c=r.inject(Ts,null),u=r.ref(null),f=r.ref(null),{floatingStyles:h}=Jn(u,f,{middleware:[Gn({mainAxis:c?8:4,crossAxis:c?-12:0}),Zn({crossAxis:!1,fallbackStrategy:"initialPlacement"}),Bd()],placement:n.placement,whileElementsMounted:Kn,strategy:"fixed"}),m=()=>{x.value==="hover"&&g()},p=E=>{if(n.stopClickPropagation&&E.stopPropagation(),!n.disabled){if(a.value){a.value=!1;return}x.value==="click"&&g()}},g=()=>{d.value=!0,a.value=!0,c==null||c.setChildId(s)},b=()=>{x.value==="hover"&&(d.value=!1)},y=()=>{d.value=!0},C=()=>{d.value=!1},v=()=>{n.closeOnClick&&setTimeout(()=>{a.value=!1,c==null||c.closeParent()},10)},_=r.computed(()=>({mouseInMenu:d}));r.provide(Ts,{register({injectProps:E}){return i.value=[...i.value,{injectProps:E}],i.value.length},closeParent(){c?(a.value=!1,c==null||c.closeParent()):a.value=x.value!=="click"},setChildId(E){l.value=E},mouseInChildId:l,trigger:n.trigger}),r.provide(zs,{handleContentClick:v}),r.onMounted(()=>{window.addEventListener("click",N),c&&(s=c.register({injectProps:_}))}),r.onUnmounted(()=>{window.removeEventListener("click",N)}),r.watch(()=>c==null?void 0:c.mouseInChildId.value,E=>{E!==s&&(a.value=!1)});const x=r.computed(()=>c===null?n.trigger:"hover");r.watch(()=>a.value,()=>o("menu-changed",a.value));const N=E=>{if(!a.value)return;const R=E.path||E.composedPath();for(const k of R)if(k==u.value||k==f.value)return;a.value=!1};return(E,R)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:u,class:"fm-menu",onClick:p,onMouseenter:m,onMouseleave:b},[r.renderSlot(E.$slots,"menu-button",{},void 0,!0)],544),(r.openBlock(),r.createBlock(r.Teleport,{disabled:!!r.unref(c)||E.inPopover,to:"body"},[a.value?(r.openBlock(),r.createElementBlock("div",{key:0,id:"fm-menu",ref_key:"menuEl",ref:f,style:r.normalizeStyle({...r.unref(h),zIndex:n.zIndex}),class:"block",onMouseenter:y,onMouseleave:C},[r.renderSlot(E.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",{style:r.normalizeStyle({"max-height":`${E.maxHeight}px`,width:`${E.width}px`}),class:"fm-menu__wrapper"},[r.renderSlot(E.$slots,"default",{},void 0,!0)],4)],!0)],36)):r.createCommentVNode("",!0)],8,["disabled"]))]))}}),[["__scopeId","data-v-f3e9026f"]]),R1={class:"fm-menu-item--left"},A1={key:0,class:"fm-menu-item--right"},we=J(r.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=r.ref(!1),i=r.inject(zs,null),s=e,l=c=>{c.preventDefault(),i==null||i.handleContentClick(),!(n.disabled||!n.selectable)&&s("update:modelValue",!n.modelValue)},a=()=>{s("update:modelValue",n.modelValue)};function d(c){o.value=c}return(c,u)=>(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,"hover:bg-fm-color-opacity-sm":!c.disabled&&!c.modelValue&&c.selectable}),onClick:l,onMousedown:u[1]||(u[1]=()=>d(!0)),onMouseleave:u[2]||(u[2]=()=>d(!1)),onMouseup:u[3]||(u[3]=()=>d(!1))},[r.createElementVNode("div",R1,[r.renderSlot(c.$slots,"prepend",{},()=>[!c.hasCheckbox&&c.icon?(r.openBlock(),r.createBlock(H,{key:0,color:c.disabled?"#C7C7CC":c.modelValue?"#FF7823":"#1C1C1E",name:c.icon,outline:!o.value&&!c.modelValue,size:"md"},null,8,["color","name","outline"])):r.createCommentVNode("",!0),c.hasCheckbox?(r.openBlock(),r.createBlock(md,{key:1,disabled:c.disabled,indeterminate:c.indeterminate,"model-value":c.modelValue,label:"",name:"something",sublabel:"",value:"",onClick:u[0]||(u[0]=f=>f.preventDefault()),"onUpdate:modelValue":a},null,8,["disabled","indeterminate","model-value"])):r.createCommentVNode("",!0)],!0),r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-md-400 max-w-[240px]",c.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"])},r.toDisplayString(c.label),3),c.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-sm-400 ${c.disabled?"text-fm-color-typo-disabled":"text-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",A1,[r.createVNode(H,{color:c.disabled?"#C7C7CC":"#AEAEB2",name:"chevron_right",size:"md"},null,8,["color"])])):r.createCommentVNode("",!0)],34)]))}}),[["__scopeId","data-v-9a24e799"]]),O1={class:"fm-typo-body-lg-700"},I1={class:"h-[264px] overflow-y-auto w-[160px]"},T1=["onVnodeMounted"],z1=["onVnodeMounted"],an=r.defineComponent({__name:"FmDateRangeYearMonthPicker",props:{modelValue:{},picker:{},min:{},max:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>{const c=D(n.min).startOf("year"),u=D(n.max).startOf("year"),f=u.diff(c,"year"),h=[];for(let m=0;m<=f;m++)h.push(u.subtract(m,"year"));return h}),l=c=>{const u=D(n.min).startOf("month"),f=D(n.max).startOf("month");return c.get("year")===u.get("year")?c.startOf("month").isAfter(u)||c.get("month")===u.get("month"):c.get("year")===f.get("year")?c.startOf("month").isBefore(f)||c.get("month")===f.get("month"):!0},a=c=>{const u=D(n.min).startOf("month"),f=D(n.max).startOf("month");if(u.get("year")===c.get("year")){o("update:modelValue",u);return}if(f.get("year")===c.get("year")){o("update:modelValue",f);return}o("update:modelValue",c)};function d(c,u){if(!u)return!1;const f=c.el,h=f==null?void 0:f.parentElement;!f||!h||h.scrollTo({top:f.offsetTop-50})}return(c,u)=>(r.openBlock(),r.createBlock(Ze,{trigger:"click","in-popover":"",onMenuChanged:u[0]||(u[0]=f=>i.value=f)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-4 h-24 items-center px-8 rounded-sm",i.value?"text-fm-color-primary":"hover:bg-fm-color-neutral-gray-100"])},[r.createElementVNode("div",O1,[c.picker==="month"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(c.modelValue.format("MMMM")),1)],64)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(c.modelValue.format("YYYY")),1)],64)):r.createCommentVNode("",!0)]),r.createVNode(H,{name:i.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),default:r.withCtx(()=>[r.createElementVNode("ul",I1,[c.picker==="month"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(Array.from(Array(12),(f,h)=>c.modelValue.month(h)),f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("MMMM"),onVnodeMounted:h=>d(h,c.modelValue.format("MMMM")===f.format("MMMM"))},[r.createVNode(we,{disabled:!l(f),"model-value":c.modelValue.format("MMMM")===f.format("MMMM"),label:f.format("MMMM"),"onUpdate:modelValue":h=>o("update:modelValue",f)},null,8,["disabled","model-value","label","onUpdate:modelValue"])],8,T1))),128)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("YYYY"),onVnodeMounted:h=>d(h,c.modelValue.format("YYYY")===f.format("YYYY"))},[r.createVNode(we,{"model-value":c.modelValue.format("YYYY")===f.format("YYYY"),label:f.format("YYYY"),"onUpdate:modelValue":h=>a(f)},null,8,["model-value","label","onUpdate:modelValue"])],8,z1))),128)):r.createCommentVNode("",!0)])]),_:1}))}}),L1={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)}},Vt=J(r.defineComponent({__name:"FmPopover",props:{showPopover:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1},zIndex:{default:99},excludeElFromClickOutside:{default:void 0}},emits:["popover-changed"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref(o.showPopover),s=r.ref(null),l=r.ref(null),{floatingStyles:a}=Jn(s,l,{middleware:[Gn(4),Zn(),Bd({crossAxis:!0})],placement:o.placement,whileElementsMounted:Kn,strategy:"fixed"}),d=n,c=()=>{i.value||(i.value=!0,d("popover-changed",i.value))},u=()=>{i.value&&(i.value=!1,d("popover-changed",i.value))};e({show:c,hide:u});const f=()=>{o.disabled||(i.value=!i.value,d("popover-changed",i.value))};r.watch(()=>o.showPopover,m=>i.value=m);const h=()=>{i.value&&(i.value=!1,d("popover-changed",i.value))};return(m,p)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:s,class:"fm-popover",onClick:f},[r.renderSlot(m.$slots,"popover-button",{},void 0,!0)],512),i.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"popoverEl",ref:l,style:r.normalizeStyle({...r.unref(a),zIndex:o.zIndex}),class:"fm-popover__content"},[r.renderSlot(m.$slots,"default",{hide:u,show:c},void 0,!0)],4)):r.createCommentVNode("",!0)])),[[r.unref(L1),h,m.excludeElFromClickOutside]])}}),[["__scopeId","data-v-9454a3a4"]]),O="YYYY-MM-DD",Fi=t=>{const e=[],n=t.endOf("month"),o=t.month();let i=t.startOf("week"),s=[];for(;i.isBefore(n.endOf("week"));)i.day()===0&&s.length>0&&(e.push(s),s=[]),s.push({date:i,isCurrentMonth:i.month()===o}),i=i.add(1,"day");return s.length>0&&e.push(s),e},Rd=(t,e)=>{const n=D().startOf("month"),o=D(t).diff(n,"month"),i=D(e).diff(n,"month"),s=[];for(let l=o-1;l<=i;l++){const a=[],d=n.add(l,"month").startOf("month"),c=d.endOf("month"),u=d.month();let f=d.startOf("week"),h=[];for(;f.isBefore(c.endOf("week"));)f.day()===0&&h.length>0&&(a.push(h),h=[]),h.push({id:d.format("MM-YYYY"),date:f,isCurrentMonth:f.month()===u}),f=f.add(1,"day");h.length>0&&a.push(h),s.push({id:d.format("YYYY-MM-DD"),matrix:a,height:64+48*(c.endOf("week").diff(d.startOf("week"),"week")+1)})}return s},Qn=Array.from(Array(7),(t,e)=>D().day(e).format("ddd")),H1={class:"p-12 w-[360px]"},Y1={class:"w-max"},j1={class:"flex h-40 justify-between px-4 py-8"},W1={class:"flex gap-4 items-center"},U1={class:"flex gap-4 items-center justify-center"},G1={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},q1=["onClick"],X1={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},K1=J(r.defineComponent({__name:"FmDatePickerDesktop",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>D().subtract(50,"year").format(O)},max:{default:()=>D().add(25,"year").format(O)},zIndex:{default:void 0},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=q(e,"modelValue"),o=r.ref(D(n.value,O)),i=r.ref(!1),s=r.ref(D().startOf("month")),l=r.ref(!1),a=r.ref(!1),d=h=>{o.value=h},c=()=>{n.value=o.value.format(O),setTimeout(()=>{i.value=!1},0)},u=()=>{o.value=n.value?D(n.value):null,i.value=!1},f=h=>{l.value=!1,a.value=!1,s.value=h};return(h,m)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":m[5]||(m[5]=p=>r.isRef(n)?n.value=p:null),disabled:h.disabled,focused:i.value,"helper-state":h.helperState,"helper-text":h.helperText,info:h.labelInfo,label:h.label,optional:h.labelMark==="optional",required:h.labelMark==="required",rules:h.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(h.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:p})=>[r.createVNode(Vt,{disabled:h.disabled,"show-popover":i.value,"z-index":h.zIndex,onPopoverChanged:m[4]||(m[4]=g=>i.value=g)},{"popover-button":r.withCtx(()=>[h.$slots["trigger-button"]?r.renderSlot(h.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:p,opened:i.value,showValidBorder:h.showValidBorder})),void 0,!0):(r.openBlock(),r.createBlock(le,{key:1,focused:i.value,"icon-outlined":!i.value,invalid:p,"show-valid-border":h.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(h.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(h.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(n)?r.unref(D)(r.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","icon-outlined","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",H1,[r.createElementVNode("div",Y1,[r.createElementVNode("div",j1,[r.createElementVNode("div",W1,[r.createVNode(an,{max:h.max,min:h.min,"model-value":s.value,picker:"month","onUpdate:modelValue":m[0]||(m[0]=g=>f(g))},null,8,["max","min","model-value"]),r.createVNode(an,{max:h.max,min:h.min,"model-value":s.value,picker:"year","onUpdate:modelValue":m[1]||(m[1]=g=>f(g))},null,8,["max","min","model-value"])]),r.createElementVNode("div",U1,[r.createVNode(H,{outline:!1,class:"cursor-pointer",color:"#1C1C1E",name:"chevron_left",onClick:m[2]||(m[2]=()=>f(s.value.subtract(1,"month")))}),r.createVNode(H,{outline:!1,class:"cursor-pointer",color:"#1C1C1E",name:"chevron_right",onClick:m[3]||(m[3]=()=>f(s.value.add(1,"month")))})])]),r.createElementVNode("div",null,[r.createElementVNode("div",G1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),g=>(r.openBlock(),r.createElementBlock("div",{key:g,class:"fm-calendar__cell"},r.toDisplayString(g),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Fi)(s.value),(g,b)=>(r.openBlock(),r.createElementBlock("div",{key:b,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g,y=>(r.openBlock(),r.createElementBlock("div",{key:y.date.date(),class:"fm-calendar__cell"},[y.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass([{"fm-calendar__cell__button--selected":y.date.isSame(o.value)},"fm-calendar__cell__button"]),type:"button",onClick:()=>d(y.date)},r.toDisplayString(y.date.date()),11,q1)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",X1,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:!o.value,label:"Apply",size:"md",variant:"primary",onClick:c},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(h.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),[["__scopeId","data-v-72b81a03"]]),Ad=t=>(r.pushScopeId("data-v-be5ccc8e"),t=t(),r.popScopeId(),t),Z1={class:"flex flex-col gap-8 pb-8 pt-24 px-16"},J1={class:"flex items-center justify-center"},Q1={class:"flex fm-typo-body-lg-400 h-48 justify-center text-fm-color-typo-tertiary w-[336px]"},e2={class:"flex h-[calc(100%-208px)] justify-center relative w-full"},t2=Ad(()=>r.createElementVNode("div",{class:"absolute bg-gradient-to-b from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),n2={id:"wrapper",class:"h-full relative w-[336px]"},o2=["id"],r2={class:"flex gap-4 items-center"},i2={class:"fm-typo-body-lg-700"},s2={class:"fm-typo-body-lg-700"},l2=["onClick"],a2={class:"absolute bg-fm-color-neutral-white bottom-0 left-0 p-16 w-full"},d2=Ad(()=>r.createElementVNode("div",{class:"-top-32 absolute bg-gradient-to-t from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),c2={class:"flex gap-8 items-center justify-end w-full"},Od=J(r.defineComponent({__name:"FmDatePickerMobile",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>D().subtract(50,"year").format(O)},max:{default:()=>D().add(25,"year").format(O)},zIndex:{default:99},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=Rd(e.min,e.max),o=q(e,"modelValue"),i=D(),s=r.ref(D(o.value,O)),l=r.ref(!1),a=r.ref(),d=m=>{s.value=m},c=()=>{o.value=s.value.format(O),setTimeout(()=>{l.value=!1},0)},u=()=>{s.value=o.value?D(o.value):null,l.value=!1},f=()=>{l.value=!0,setTimeout(()=>{a.value.scrollToItem(h(i.startOf("month")))},0)},h=m=>n.findIndex(p=>p.id===m.startOf("month").format(O));return(m,p)=>{const g=r.resolveComponent("RecycleScroller");return r.openBlock(),r.createBlock(_e,{modelValue:r.unref(o),"onUpdate:modelValue":p[0]||(p[0]=b=>r.isRef(o)?o.value=b:null),disabled:m.disabled,focused:l.value,"helper-state":m.helperState,"helper-text":m.helperText,info:m.labelInfo,label:m.label,optional:m.labelMark==="optional",required:m.labelMark==="required",rules:m.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:b})=>[m.$slots["trigger-button"]?(r.openBlock(),r.createElementBlock("div",{key:0,onClick:f},[r.renderSlot(m.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps({invalid:b,opened:l.value,showValidBorder:m.showValidBorder})),void 0,!0)])):(r.openBlock(),r.createBlock(le,{key:1,focused:l.value,invalid:b,"show-valid-border":m.showValidBorder,class:"cursor-pointer","icon-outlined":"","prepend-icon":"calendar_month",onClick:f},{prepend:r.withCtx(()=>[r.renderSlot(m.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(m.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(o)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(o)?r.unref(D)(r.unref(o)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])),l.value?(r.openBlock(),r.createBlock(r.Teleport,{key:2,to:"body"},[r.createElementVNode("div",{class:"bg-fm-color-neutral-white fixed flex flex-col h-screen left-0 top-0 w-screen",style:r.normalizeStyle({zIndex:e.zIndex})},[r.createElementVNode("div",Z1,[r.createVNode(le,{focused:l.value,invalid:b,"show-valid-border":m.showValidBorder,"icon-outlined":"","prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(m.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(m.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var y,C;return[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":(y=s.value)!=null&&y.isValid()?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString((C=s.value)!=null&&C.isValid()?r.unref(D)(s.value).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["focused","invalid","show-valid-border"]),r.createElementVNode("div",J1,[r.createElementVNode("div",Q1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),y=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"fm-calendar__cell"},r.toDisplayString(y),1))),128))])])]),r.createElementVNode("div",e2,[t2,r.createElementVNode("div",n2,[r.createVNode(g,{ref_key:"scroller",ref:a,buffer:200,"item-size":null,items:r.unref(n),class:"h-full no-scrollbar overflow-y-auto w-full","key-field":"id","size-field":"height"},{default:r.withCtx(({item:y})=>[r.createElementVNode("div",{id:y.id,class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},[r.createElementVNode("div",r2,[r.createElementVNode("div",i2,r.toDisplayString(r.unref(D)(y.id).format("MMMM")),1),r.createElementVNode("div",s2,r.toDisplayString(r.unref(D)(y.id).format("YYYY")),1)])],8,o2),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.matrix,(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,_=>(r.openBlock(),r.createElementBlock("div",{key:_.date.date(),class:"fm-calendar__cell"},[_.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass([{"fm-calendar__cell__button--selected":_.date.isSame(s.value),"fm-typo-body-lg-700":_.date.isSame(r.unref(i),"day")},"fm-calendar__cell__button"]),type:"button",onClick:()=>d(_.date)},r.toDisplayString(_.date.date()),11,l2)):r.createCommentVNode("",!0)]))),128))]))),128))])]),_:1},8,["items"])])]),r.createElementVNode("div",a2,[d2,r.createElementVNode("div",c2,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:!s.value,label:"Apply",size:"md",variant:"primary",onClick:c},null,8,["disabled"])])])],4)])):r.createCommentVNode("",!0)]),"helper-text":r.withCtx(()=>[r.renderSlot(m.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"])}}}),[["__scopeId","data-v-be5ccc8e"]]),Jo=t=>{const e=r.inject(ye);return r.computed(()=>{const n=t.disabled??(e==null?void 0:e.getDisabled())??!1;return{...t,disabled:n}})},u2=r.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>D().subtract(50,"year").format(O)},max:{default:()=>D().add(25,"year").format(O)},zIndex:{default:void 0},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const{breakpoints:e}=yt(),n=t,o=q(n,"modelValue"),i=Jo(n);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(e).md||r.unref(e).lg?(r.openBlock(),r.createBlock(K1,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(e).xs||r.unref(e).sm?(r.openBlock(),r.createBlock(Od,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}}),Id=r.defineComponent({__name:"FmMenuDivider",props:{vertical:{type:Boolean,default:!1},inset:{type:Boolean,default:!1}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["border-fm-color-neutral-gray-100 rounded-sm",[e.vertical?"border-l -my-4 mx-4":"border-t -mx-4 my-4",{"my-0":e.inset&&e.vertical,"mx-0":e.inset&&!e.vertical}]])},null,2))}}),f2={class:"cursor-pointer fm-switch__container"},h2={key:0},m2={class:"fm-typo-body-lg-400"},p2={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},g2={class:"fm-switch__input--container"},b2=["checked","disabled","value"],y2={key:1},$2={class:"fm-typo-body-lg-400"},w2={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Ri=J(r.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{default:null},disabled:{type:Boolean,default:void 0},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=()=>{o.value||(i.value=!i.value)};return(l,a)=>(r.openBlock(),r.createElementBlock("label",f2,[l.labelPlacement==="left"?(r.openBlock(),r.createElementBlock("div",h2,[r.renderSlot(l.$slots,"label",{},void 0,!0),r.createElementVNode("div",m2,r.toDisplayString(l.label),1),l.sublabel?(r.openBlock(),r.createElementBlock("div",p2,r.toDisplayString(l.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",g2,[r.createElementVNode("input",{checked:r.unref(i),disabled:o.value,value:l.value,class:"fm-switch__input--btn",type:"checkbox",onClick:s},null,8,b2),r.createElementVNode("div",{class:r.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":l.showIcon})},[l.showIcon?(r.openBlock(),r.createBlock(H,{key:0,color:o.value?"#C7C7CC":r.unref(i)?"#1C1C1E":"#FFFFFF",name:r.unref(i)?"check":"close",size:"sm"},null,8,["color","name"])):r.createCommentVNode("",!0)],2)]),l.labelPlacement==="right"?(r.openBlock(),r.createElementBlock("div",y2,[r.createElementVNode("div",$2,r.toDisplayString(l.label),1),l.sublabel?(r.openBlock(),r.createElementBlock("div",w2,r.toDisplayString(l.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-fcd3e9f2"]]);var be=(t=>(t.PrecedingPeriod="preceding_period",t.PrecedingWeek="preceding_week",t.PrecedingMonth="preceding_month",t.Custom="custom",t))(be||{});const Td=t=>(r.pushScopeId("data-v-99b24dd6"),t=t(),r.popScopeId(),t),_2={key:0,class:"flex gap-4 items-center relative w-full"},k2={class:"flex flex-col gap-4 w-full"},C2=Td(()=>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)),x2={class:"flex flex-col gap-4 w-full"},S2={key:1,class:"flex flex-col gap-4 w-full"},v2={class:"flex gap-4 p-12"},D2={key:0,class:"max-h-[549px] overflow-y-auto w-[171px]"},M2={key:0,class:"px-8"},V2={key:1,class:"-my-12 border-fm-color-neutral-gray-100 border-l shrink-0"},B2={class:"flex flex-col gap-24"},E2={key:0,class:"flex gap-4 items-center px-12 w-full"},P2={class:"flex flex-col gap-4 w-full"},N2=Td(()=>r.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," - ",-1)),F2={class:"flex flex-col gap-4 w-full"},R2={class:"flex gap-24"},A2={class:"w-max"},O2={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},I2={class:"flex gap-4 items-center"},T2={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},z2={class:"h-[288px]"},L2={key:0,class:"fm-calendar__cell__button--today"},H2=["onClick","onMouseover"],Y2={class:"w-max"},j2={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},W2={class:"flex gap-4 items-center"},U2={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},G2={key:0,class:"fm-calendar__cell__button--today"},q2=["onClick","onMouseover"],X2={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},K2=J(r.defineComponent({__name:"FmDateRangePickerDesktop",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:D().format(O),endDate:D().format(O)}},{label:"Yesterday",value:{startDate:D().subtract(1,"day").format(O),endDate:D().subtract(1,"day").format(O)}},{label:"This week",value:{startDate:D().startOf("week").format(O),endDate:D().endOf("week").format(O)}},{label:"Last week",value:{startDate:D().subtract(1,"week").startOf("week").format(O),endDate:D().subtract(1,"week").endOf("week").format(O)}},{label:"Last 7 days",value:{startDate:D().subtract(7,"day").format(O),endDate:D().subtract(1,"day").format(O)}},{label:"This month",value:{startDate:D().startOf("month").format(O),endDate:D().endOf("month").format(O)}},{label:"Last month",value:{startDate:D().subtract(1,"month").startOf("month").format(O),endDate:D().subtract(1,"month").endOf("month").format(O)}},{label:"This year",value:{startDate:D().startOf("year").format(O),endDate:D().endOf("year").format(O)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},min:{default:()=>D().subtract(50,"year").format(O)},max:{default:()=>D().add(25,"year").format(O)},zIndex:{default:void 0},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var k,S;const e=[{id:be.PrecedingPeriod,label:"Preceding period",sublabel:"",action:()=>{d.value=be.PrecedingPeriod;const w=s.value;if(w[0].startDate&&w[0].endDate){const $=w[0].startDate.diff(w[0].endDate,"day");w[1]={startDate:w[0].startDate.subtract(+(1-$),"day"),endDate:w[0].startDate.subtract(1,"day")}}}},{id:be.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:()=>{d.value=be.PrecedingWeek;const w=s.value;if(w[0].startDate&&w[0].endDate){let $=w[0].endDate.diff(w[0].startDate,"week");$===0&&($+=1),w[1]={startDate:w[0].startDate.subtract($,"week"),endDate:w[0].endDate.subtract($,"week")}}}},{id:be.PrecedingMonth,label:"Preceding period",sublabel:"Match day of month",action:()=>{d.value=be.PrecedingMonth;const w=s.value;if(w[0].startDate&&w[0].endDate){let $=w[0].endDate.diff(w[0].startDate,"month");$===0&&($+=1),w[1]={startDate:w[0].startDate.subtract($,"month"),endDate:w[0].endDate.subtract($,"month")}}}},{id:be.Custom,label:"Custom",sublabel:"",action:()=>{d.value=be.Custom}}],n=t,o=D(),i=q(n,"modelValue"),s=r.ref([{startDate:(k=i.value)!=null&&k.startDate?D(i.value.startDate,O):null,endDate:(S=i.value)!=null&&S.endDate?D(i.value.endDate,O):null},{startDate:null,endDate:null}]),l=r.ref(!1),a=r.ref(!1),d=r.ref(""),c=r.ref(D().startOf("month")),u=r.ref(D().startOf("month").add(1,"month")),f=r.ref(""),h=r.ref(null);let m=0;const p=w=>{var $;if(f.value="",s.value[m].startDate&&s.value[m].endDate){m===1&&(s.value=s.value.map(()=>({startDate:null,endDate:null})),m=0),s.value[0]={startDate:w,endDate:null};return}else if(!s.value[m].startDate&&!s.value[m].endDate)s.value[m].startDate=w;else{if(w.isBefore(s.value[m].startDate)){const B=s.value[m].startDate;s.value[m]={startDate:w,endDate:B}}else s.value[m].endDate=w;a.value&&(m=1),e.find(B=>B.id===d.value)||(d.value=be.Custom)}($=e.find(B=>B.id===d.value))==null||$.action()},g=()=>{a.value?i.value=s.value.map(w=>({startDate:w.startDate.format(O),endDate:w.endDate.format(O)})):i.value={startDate:s.value[0].startDate.format(O),endDate:s.value[0].endDate.format(O)},setTimeout(()=>{l.value=!1})},b=()=>{var w,$;Array.isArray(i.value)?s.value=i.value:s.value[0]={startDate:(w=i.value)!=null&&w.startDate?D(i.value.startDate,O):null,endDate:($=i.value)!=null&&$.endDate?D(i.value.endDate,O):null},l.value=!1},y=(w,$)=>{w==="left"?(c.value=$,u.value=$.add(1,"month")):w==="right"&&(u.value=$,c.value=$.subtract(1,"month"))},C=w=>{const $=s.value[0].startDate,B=s.value[0].endDate,M=s.value[1].startDate,P=s.value[1].endDate,V=h.value,F=$==null?void 0:$.isSame(w),A=B==null?void 0:B.isSame(w),L=M==null?void 0:M.isSame(w),z=P==null?void 0:P.isSame(w),W=V==null?void 0:V.isSame(w),X=F&&B&&!(F&&A)||$&&!B&&F&&(V==null?void 0:V.isAfter($))||$&&!B&&W&&(V==null?void 0:V.isBefore($)),K=L&&P&&!(L&&z)||M&&!P&&L&&(V==null?void 0:V.isAfter(M))||M&&!P&&W&&(V==null?void 0:V.isBefore(M)),te=A&&$&&!(F&&A)||$&&!B&&F&&(V==null?void 0:V.isBefore($))||$&&!B&&W&&(V==null?void 0:V.isAfter($)),ae=z&&M&&!(L&&z)||M&&!P&&L&&(V==null?void 0:V.isBefore(M))||M&&!P&&W&&(V==null?void 0:V.isAfter(M)),pe=F&&A||F&&!B,Ae=L&&z||L&&!P,Ue=$&&(B||V)&&B?w.isAfter($)&&w.isBefore(B):w.isAfter(V)&&w.isBefore($)||w.isBefore(V)&&w.isAfter($),Oe=M&&(P||V)&&P?w.isAfter(M)&&w.isBefore(P):w.isAfter(V)&&w.isBefore(M)||w.isBefore(V)&&w.isAfter(M),he=()=>{if(s.value.filter(pt=>{var et;for(const kr in pt)if((et=pt[kr])!=null&&et.isSame(w,"day"))return!0;return!1}).length===2)return"bg-fm-color-system-success-400 before:bg-fm-color-system-success-100";if(F&&A&&(fe(w,M,P)||fe(w,M,V)))return"bg-fm-color-primary before:bg-fm-color-system-info-100 after:bg-fm-color-system-info-100";if(L&&z&&(fe(w,$,B)||fe(w,$,V)))return"bg-fm-color-system-info-300 before:bg-fm-color-system-warning-100 after:bg-fm-color-system-warning-100";if(X||te)return fe(w,M,P)||fe(w,M,V)?"bg-fm-color-primary before:bg-fm-color-system-success-100 after:bg-fm-color-system-info-100":"bg-fm-color-primary before:bg-fm-color-system-warning-100";if(K||ae)return fe(w,$,B)||fe(w,$,V)?"bg-fm-color-system-info-300 before:bg-fm-color-system-success-100 after:bg-fm-color-system-warning-100":"bg-fm-color-system-info-300 before:bg-fm-color-system-info-100";if(pe)return"bg-fm-color-primary";if(Ae)return"bg-fm-color-system-info-300";if(fe(w,$,B)&&(fe(w,M,P)||fe(w,M,V)))return"bg-fm-color-system-success-100";if(Ue)return"bg-fm-color-system-warning-100";if(Oe)return"bg-fm-color-system-info-100"};return{[`fm-calendar__cell__button--selected-start ${he()}`]:X||K,[`fm-calendar__cell__button--selected-end ${he()}`]:te||ae,[`fm-calendar__cell__button--selected-between ${he()}`]:Ue||Oe,[`fm-calendar__cell__button--selected ${he()}`]:pe||Ae}},v=w=>{const $=s.value;if($[0].startDate&&!$[0].endDate||$[1].startDate&&!$[1].endDate){h.value=w;return}h.value=null},_=w=>{f.value=w.label,s.value[0]={startDate:D(w.value.startDate,O),endDate:D(w.value.endDate,O)}},x=r.computed(()=>a.value?!s.value.every(w=>w.startDate&&w.endDate):!(s.value[0].startDate&&s.value[0].endDate)),N=w=>{d.value="",a.value=w,s.value=Array.from(Array(2),()=>({startDate:null,endDate:null})),m=0},E=r.computed(()=>{if(!i.value)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const w=a.value&&Array.isArray(i.value)?i.value[0].startDate:i.value.startDate,$=a.value&&Array.isArray(i.value)?i.value[0].endDate:i.value.endDate;return{startDate:w?D(w).format("D MMM YYYY"):"DD MM YYYY",endDate:$?D($).format("D MMM YYYY"):"DD MM YYYY"}}),R=r.computed(()=>{const w=a.value&&Array.isArray(i.value)?i.value[1].startDate:null,$=a.value&&Array.isArray(i.value)?i.value[1].endDate:null;return w&&$?`Compared: ${D(w).format("D MMM YYYY")} - ${D($).format("D MMM YYYY")}`:""});return r.watch(()=>i.value,()=>{var w,$;a.value?s.value=i.value.map(B=>({startDate:B!=null&&B.startDate?D(B.startDate,O):null,endDate:B!=null&&B.endDate?D(B.endDate,O):null})):s.value[0]={startDate:(w=i.value)!=null&&w.startDate?D(i.value.startDate,O):null,endDate:($=i.value)!=null&&$.endDate?D(i.value.endDate,O):null}}),(w,$)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":$[8]||($[8]=B=>r.isRef(i)?i.value=B:null),disabled:w.disabled,focused:l.value,"helper-state":w.helperState,"helper-text":a.value?R.value:w.helperText,rules:w.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:B})=>[r.createVNode(Vt,{disabled:w.disabled,"show-popover":l.value,"z-index":n.zIndex,onPopoverChanged:$[7]||($[7]=M=>l.value=M)},{"popover-button":r.withCtx(()=>[w.$slots["trigger-button"]?r.renderSlot(w.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{opened:l.value,invalid:B,showValidBorder:w.showValidBorder,isComparing:a.value})),void 0,!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[w.compare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",_2,[r.createElementVNode("label",k2,[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(n.startLabel),3),r.createVNode(le,{class:r.normalizeClass(w.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,"icon-outlined":!l.value,invalid:B,"show-valid-border":w.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(w.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(w.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var M;return[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString((M=r.unref(i))!=null&&M.startDate?r.unref(D)(r.unref(i).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])]),C2,r.createElementVNode("label",x2,[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(n.endLabel),3),r.createVNode(le,{class:r.normalizeClass(w.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,"icon-outlined":!l.value,invalid:B,"show-valid-border":w.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(w.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(w.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var M;return[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled":E.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString((M=r.unref(i))!=null&&M.endDate?r.unref(D)(r.unref(i).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])])])),w.compare?(r.openBlock(),r.createElementBlock("label",S2,[r.createVNode(Kt,{label:w.compareLabel},null,8,["label"]),r.createVNode(le,{class:r.normalizeClass(w.disabled?"cursor-not-allowed":"cursor-pointer"),focused:l.value,invalid:B,"show-valid-border":w.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(w.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(w.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[n.disabled?"text-fm-color-typo-disabled":E.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(E.value.startDate)+" - "+r.toDisplayString(E.value.endDate),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])])):r.createCommentVNode("",!0)],64))]),default:r.withCtx(()=>[r.createElementVNode("div",v2,[w.showPredefinedRange?(r.openBlock(),r.createElementBlock("div",D2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.predefinedRange,(M,P)=>(r.openBlock(),r.createBlock(we,{key:P,label:M.label,"model-value":f.value===M.label,selectable:"",onClick:V=>_(M)},null,8,["label","model-value","onClick"]))),128)),w.compare&&w.predefinedRange?(r.openBlock(),r.createElementBlock("div",M2,[r.createVNode(Id,{inset:""})])):r.createCommentVNode("",!0),w.compare?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(Ri,{"model-value":a.value,class:"justify-between px-12",label:"Compare","onUpdate:modelValue":$[0]||($[0]=M=>N(M))},null,8,["model-value"]),a.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},r.renderList(e,(M,P)=>r.createVNode(we,{key:P,label:M.label,"model-value":d.value===M.id,sublabel:M.sublabel,selectable:"",onClick:V=>M.action()},null,8,["label","model-value","sublabel","onClick"])),64)):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),w.showPredefinedRange?(r.openBlock(),r.createElementBlock("div",V2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass({"pl-4":w.showPredefinedRange})},[r.createElementVNode("div",B2,[a.value?(r.openBlock(),r.createElementBlock("div",E2,[r.createElementVNode("label",P2,[r.createVNode(Kt,{label:"Custom"}),r.createVNode(le,{focused:!1},{default:r.withCtx(()=>{var M,P;return[r.createElementVNode("div",{class:r.normalizeClass([[(M=s.value[0])!=null&&M.startDate&&((P=s.value[0])!=null&&P.endDate)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(s.value[0].startDate!==null?s.value[0].startDate.format("D MMM YYYY"):"DD MM YYYY")+" - "+r.toDisplayString(s.value[0].endDate!==null?s.value[0].endDate.format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:1})]),N2,r.createElementVNode("label",F2,[r.createVNode(Kt,{label:"Compare"}),r.createVNode(le,{focused:!1},{default:r.withCtx(()=>{var M,P;return[r.createElementVNode("div",{class:r.normalizeClass([[(M=s.value[1])!=null&&M.startDate&&((P=s.value[1])!=null&&P.endDate)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(s.value[1].startDate!==null?s.value[1].startDate.format("D MMM YYYY"):"DD MM YYYY")+" - "+r.toDisplayString(s.value[1].endDate!==null?s.value[1].endDate.format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:1})])])):r.createCommentVNode("",!0),r.createElementVNode("div",R2,[r.createElementVNode("div",A2,[r.createElementVNode("div",O2,[r.createElementVNode("div",I2,[r.createVNode(H,{outline:!1,class:"cursor-pointer select-none",color:"#1C1C1E",name:"chevron_left",onClick:$[1]||($[1]=()=>y("left",c.value.subtract(1,"month")))}),r.createVNode(an,{max:w.max,min:w.min,"model-value":c.value,picker:"month","onUpdate:modelValue":$[2]||($[2]=M=>y("left",M))},null,8,["max","min","model-value"]),r.createVNode(an,{max:w.max,min:w.min,"model-value":c.value,picker:"year","onUpdate:modelValue":$[3]||($[3]=M=>y("left",M))},null,8,["max","min","model-value"])])]),r.createElementVNode("div",null,[r.createElementVNode("div",T2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),M=>(r.openBlock(),r.createElementBlock("div",{key:M,class:"fm-calendar__cell"},r.toDisplayString(M),1))),128))]),r.createElementVNode("div",z2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Fi)(c.value),(M,P)=>(r.openBlock(),r.createElementBlock("div",{key:P,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M,V=>(r.openBlock(),r.createElementBlock("div",{key:V.date.date(),class:"fm-calendar__cell"},[V.date.isSame(r.unref(o),"day")&&V.isCurrentMonth?(r.openBlock(),r.createElementBlock("div",L2)):r.createCommentVNode("",!0),V.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:1,class:r.normalizeClass([[C(V.date),{"fm-typo-body-lg-700":V.date.isSame(r.unref(o),"day")}],"fm-calendar__cell__button"]),type:"button",onClick:()=>p(V.date),onMouseover:F=>v(V.date)},r.toDisplayString(V.date.date()),43,H2)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",Y2,[r.createElementVNode("div",j2,[r.createElementVNode("div",W2,[r.createVNode(an,{max:w.max,min:w.min,"model-value":u.value,picker:"month","onUpdate:modelValue":$[4]||($[4]=M=>y("right",M))},null,8,["max","min","model-value"]),r.createVNode(an,{max:w.max,min:w.min,"model-value":u.value,picker:"year","onUpdate:modelValue":$[5]||($[5]=M=>y("right",M))},null,8,["max","min","model-value"])]),r.createVNode(H,{outline:!1,class:"cursor-pointer select-none",color:"#1C1C1E",name:"chevron_right",onClick:$[6]||($[6]=()=>y("left",c.value.add(1,"month")))})]),r.createElementVNode("div",null,[r.createElementVNode("div",U2,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),M=>(r.openBlock(),r.createElementBlock("div",{key:M,class:"fm-calendar__cell"},r.toDisplayString(M),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Fi)(u.value),(M,P)=>(r.openBlock(),r.createElementBlock("div",{key:P,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M,V=>(r.openBlock(),r.createElementBlock("div",{key:V.date.date(),class:"fm-calendar__cell"},[V.date.isSame(r.unref(o),"day")&&V.isCurrentMonth?(r.openBlock(),r.createElementBlock("div",G2)):r.createCommentVNode("",!0),V.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:1,class:r.normalizeClass([[C(V.date),{"fm-typo-body-lg-700":V.date.isSame(r.unref(o),"day")}],"fm-calendar__cell__button"]),type:"button",onClick:()=>p(V.date),onMouseover:F=>v(V.date)},r.toDisplayString(V.date.date()),43,q2)):r.createCommentVNode("",!0)]))),128))]))),128))])])])])]),r.createElementVNode("div",X2,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:b}),r.createVNode(U,{disabled:x.value,label:"Apply",size:"md",variant:"primary",onClick:g},null,8,["disabled"])])],2)])]),_:2},1032,["disabled","show-popover","z-index"])]),_:2},[w.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(w.$slots,"helper-text",{},void 0,!0)]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"]))}}),[["__scopeId","data-v-99b24dd6"]]),Z2={class:"flex flex-col gap-4"},J2=["id"],Q2={class:"flex flex-col gap-4 justify-center"},dn=J(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},maxHeight:{default:408},width:{default:void 0},menuId:{},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","dropdown-changed"],setup(t,{emit:e}){const n=t,o=r.inject(ye),i=e,s=q(n,"modelValue"),l=r.ref(!1),a=r.computed(()=>n.disabled??(o==null?void 0:o.getDisabled())??!1),d=(p,g)=>{if(n.multiselect){let b=[];p?b=s.value.length===0?[g]:n.items.filter(y=>s.value.some(C=>Se(y.value,C)||Se(y.value,g.value))):b=n.items.filter(y=>s.value.some(C=>Se(y.value,C)&&!Se(y.value,g.value))),s.value=b.map(y=>y.value)}else s.value=g.value,setTimeout(()=>{l.value=!1},0)},c=p=>{const g=[...s.value].filter((b,y)=>y!==p);s.value=g},u=r.computed(()=>n.multiselect?n.items.filter(p=>r.toRaw(s.value).some(g=>Se(g,p.value))):n.items.filter(p=>Se(s.value,p.value))),f=r.computed(()=>n.items.filter(p=>s.value.some(g=>Se(p.value,g))).map(p=>({label:p.label}))),h=r.computed(()=>{var p;return n.multiselect?n.placeholder:((p=n.items.find(g=>Se(g.value,s.value)))==null?void 0:p.label)??n.placeholder}),m=r.computed(()=>n.multiselect?s.value.length!==0:n.items.some(p=>Se(p.value,s.value)));return(p,g)=>(r.openBlock(),r.createElementBlock("div",Z2,[r.createVNode(_e,{modelValue:r.unref(s),"onUpdate:modelValue":g[1]||(g[1]=b=>r.isRef(s)?s.value=b:null),disabled:a.value,focused:l.value,"helper-state":p.helperState,"helper-text":p.helperText,info:p.labelInfo,label:p.label,optional:p.labelMark==="optional",required:p.labelMark==="required",rules:p.rules},r.createSlots({default:r.withCtx(({invalid:b})=>[r.createVNode(Ze,{"close-on-click":!p.multiselect,disabled:a.value,placement:p.placement,"show-menu":l.value,onMenuChanged:g[0]||(g[0]=y=>{l.value=y,i("dropdown-changed",l.value)})},{"menu-button":r.withCtx(()=>[r.createVNode(le,{class:r.normalizeClass(a.value?"cursor-not-allowed":"cursor-pointer"),focused:l.value,invalid:b,"show-valid-border":p.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(p.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.createVNode(H,{color:a.value?"#C7C7CC":"black",name:l.value?"expand_less":"expand_more",size:"md"},null,8,["color","name"])]),default:r.withCtx(()=>[r.renderSlot(p.$slots,"default",{},()=>[r.createElementVNode("div",{class:r.normalizeClass([[a.value?"text-fm-color-typo-disabled":m.value?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"break-all fm-typo-body-lg-400 line-clamp-1"])},r.toDisplayString(h.value),3)],!0)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",{id:p.menuId,style:r.normalizeStyle({"max-height":`${p.maxHeight}px`,width:`${p.width}px`}),class:"fm-select__menu__wrapper"},[r.renderSlot(p.$slots,"menu-wrapper",{handleItemChange:(y,C)=>d(y,C)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.items,y=>(r.openBlock(),r.createBlock(we,{key:y.value,"has-checkbox":p.multiselect,label:y.label,sublabel:y.sublabel,"model-value":u.value.some(C=>r.unref(Se)(C.value,y.value)),value:y.value,"onUpdate:modelValue":C=>d(C,y)},null,8,["has-checkbox","label","sublabel","model-value","value","onUpdate:modelValue"]))),128))],!0)],12,J2)]),_:2},1032,["close-on-click","disabled","placement","show-menu"])]),_:2},[p.label||p.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(p.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,p.helperText||p.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text",{},void 0,!0)]),key:"1"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]),r.createElementVNode("div",Q2,[p.multiselect&&u.value.length>0?(r.openBlock(),r.createBlock(Pr,{key:0,disabled:a.value,items:f.value,removable:"",onChipClosed:c},null,8,["disabled","items"])):r.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-533e5bc9"]]),eb={key:0},tb={class:"flex gap-4 items-center relative w-full"},nb={class:"flex flex-col gap-4 w-full"},ob=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),rb={class:"flex flex-col gap-4 w-full"},ib={key:1,class:"flex flex-col gap-4 w-full"},Ai=r.defineComponent({__name:"FmDateRangePickerField",props:{modelValue:{},analytic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},isComparing:{type:Boolean,default:!1},startLabel:{default:"Start date"},endLabel:{default:"End date"},compareLabel:{default:"Date"}},setup(t){const e=t,n=r.computed(()=>{if(!e.modelValue)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const o=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].startDate:e.modelValue.startDate,i=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].endDate:e.modelValue.endDate;return{startDate:o?D(o).format("D MMM YYYY"):"DD MM YYYY",endDate:i?D(i).format("D MMM YYYY"):"DD MM YYYY"}});return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[o.analytic?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",eb,[r.renderSlot(o.$slots,"popover-button",{},()=>[r.createElementVNode("div",tb,[r.createElementVNode("label",nb,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400 line-clamp-1",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.startLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.startDate?r.unref(D)(o.modelValue.startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])]),ob,r.createElementVNode("label",rb,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.endLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.endDate?r.unref(D)(o.modelValue.endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])])])])])),o.analytic?(r.openBlock(),r.createElementBlock("label",ib,[r.createVNode(Kt,{label:o.compareLabel},null,8,["label"]),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":n.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(n.value.startDate)+" - "+r.toDisplayString(n.value.endDate),3)]),_:3},8,["class","focused","invalid","show-valid-border"])])):r.createCommentVNode("",!0)]))}}),zd=t=>(r.pushScopeId("data-v-b19edd50"),t=t(),r.popScopeId(),t),sb={class:"flex flex-col gap-8 pb-8 pt-24 px-16"},lb={class:"flex items-center justify-center"},ab={class:"flex fm-typo-body-lg-400 h-48 justify-center text-fm-color-typo-tertiary w-[336px]"},db={class:"flex h-[calc(100%-172px)] justify-center relative w-full"},cb=zd(()=>r.createElementVNode("div",{class:"absolute bg-gradient-to-b from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),ub={id:"wrapper",class:"h-full relative w-[336px]"},fb=["id"],hb={class:"flex gap-4 items-center"},mb={class:"fm-typo-body-lg-700"},pb={class:"fm-typo-body-lg-700"},gb=["onClick","onMouseover"],bb={class:"absolute bg-fm-color-neutral-white bottom-0 left-0 p-16 w-full"},yb=zd(()=>r.createElementVNode("div",{class:"-top-32 absolute bg-gradient-to-t from-[#1C1C1E14] h-32 left-0 pointer-events-none to-80% w-full z-10"},null,-1)),$b={class:"flex gap-8 items-center justify-end w-full"},Ld=J(r.defineComponent({__name:"FmDateRangePickerMobile",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:D().format(O),endDate:D().format(O)}},{label:"Yesterday",value:{startDate:D().subtract(1,"day").format(O),endDate:D().subtract(1,"day").format(O)}},{label:"This week",value:{startDate:D().startOf("week").format(O),endDate:D().endOf("week").format(O)}},{label:"Last week",value:{startDate:D().subtract(1,"week").startOf("week").format(O),endDate:D().subtract(1,"week").endOf("week").format(O)}},{label:"Last 7 days",value:{startDate:D().subtract(7,"day").format(O),endDate:D().subtract(1,"day").format(O)}},{label:"This month",value:{startDate:D().startOf("month").format(O),endDate:D().endOf("month").format(O)}},{label:"Last month",value:{startDate:D().subtract(1,"month").startOf("month").format(O),endDate:D().subtract(1,"month").endOf("month").format(O)}},{label:"This year",value:{startDate:D().startOf("year").format(O),endDate:D().endOf("year").format(O)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},min:{default:()=>D().subtract(50,"year").format(O)},max:{default:()=>D().add(25,"year").format(O)},zIndex:{default:100},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){var S,w;const e=r.ref(),n=[{id:be.PrecedingPeriod,label:"Preceding period",sublabel:"",action:()=>{u.value=be.PrecedingPeriod;const $=a.value;if($[0].startDate&&$[0].endDate){const B=$[0].startDate.diff($[0].endDate,"day");$[1]={startDate:$[0].startDate.subtract(+(1-B),"day"),endDate:$[0].startDate.subtract(1,"day")}}}},{id:be.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:()=>{u.value=be.PrecedingWeek;const $=a.value;if($[0].startDate&&$[0].endDate){let B=$[0].endDate.diff($[0].startDate,"week");B===0&&(B+=1),$[1]={startDate:$[0].startDate.subtract(B,"week"),endDate:$[0].endDate.subtract(B,"week")}}}},{id:be.PrecedingMonth,label:"Preceding period",sublabel:"Match day of month",action:()=>{u.value=be.PrecedingMonth;const $=a.value;if($[0].startDate&&$[0].endDate){let B=$[0].endDate.diff($[0].startDate,"month");B===0&&(B+=1),$[1]={startDate:$[0].startDate.subtract(B,"month"),endDate:$[0].endDate.subtract(B,"month")}}}},{id:be.Custom,label:"Custom",sublabel:"",action:()=>{u.value=be.Custom}}],o=t,i=Rd(o.min,o.max),s=D(),l=q(o,"modelValue"),a=r.ref([{startDate:(S=l.value)!=null&&S.startDate?D(l.value.startDate,O):null,endDate:(w=l.value)!=null&&w.endDate?D(l.value.endDate,O):null},{startDate:null,endDate:null}]),d=r.ref(!1),c=r.ref(!1),u=r.ref(""),f=r.ref(""),h=r.ref(null);let m=0;const p=$=>{var B;if(f.value="",a.value[m].startDate&&a.value[m].endDate){m===1&&(a.value=a.value.map(()=>({startDate:null,endDate:null})),m=0),a.value[0]={startDate:$,endDate:null};return}else if(!a.value[m].startDate&&!a.value[m].endDate)a.value[m].startDate=$;else{if($.isBefore(a.value[m].startDate)){const M=a.value[m].startDate;a.value[m]={startDate:$,endDate:M}}else a.value[m].endDate=$;c.value&&(m=1),n.find(M=>M.id===u.value)||(u.value=be.Custom)}(B=n.find(M=>M.id===u.value))==null||B.action()},g=()=>{c.value?l.value=a.value.map($=>({startDate:$.startDate.format(O),endDate:$.endDate.format(O)})):l.value={startDate:a.value[0].startDate.format(O),endDate:a.value[0].endDate.format(O)},setTimeout(()=>{d.value=!1})},b=()=>{var $,B;Array.isArray(l.value)?a.value=l.value:a.value[0]={startDate:($=l.value)!=null&&$.startDate?D(l.value.startDate,O):null,endDate:(B=l.value)!=null&&B.endDate?D(l.value.endDate,O):null},d.value=!1},y=$=>{const B=a.value[0].startDate,M=a.value[0].endDate,P=a.value[1].startDate,V=a.value[1].endDate,F=h.value,A=B==null?void 0:B.isSame($),L=M==null?void 0:M.isSame($),z=P==null?void 0:P.isSame($),W=V==null?void 0:V.isSame($),X=F==null?void 0:F.isSame($),K=A&&M&&!(A&&L)||B&&!M&&A&&(F==null?void 0:F.isAfter(B))||B&&!M&&X&&(F==null?void 0:F.isBefore(B)),te=z&&V&&!(z&&W)||P&&!V&&z&&(F==null?void 0:F.isAfter(P))||P&&!V&&X&&(F==null?void 0:F.isBefore(P)),ae=L&&B&&!(A&&L)||B&&!M&&A&&(F==null?void 0:F.isBefore(B))||B&&!M&&X&&(F==null?void 0:F.isAfter(B)),pe=W&&P&&!(z&&W)||P&&!V&&z&&(F==null?void 0:F.isBefore(P))||P&&!V&&X&&(F==null?void 0:F.isAfter(P)),Ae=A&&L||A&&!M,Ue=z&&W||z&&!V,Oe=B&&(M||F)&&M?$.isAfter(B)&&$.isBefore(M):$.isAfter(F)&&$.isBefore(B)||$.isBefore(F)&&$.isAfter(B),he=P&&(V||F)&&V?$.isAfter(P)&&$.isBefore(V):$.isAfter(F)&&$.isBefore(P)||$.isBefore(F)&&$.isAfter(P),Ee=()=>{if(a.value.filter(et=>{var kr;for(const Dk in et)if((kr=et[Dk])!=null&&kr.isSame($,"day"))return!0;return!1}).length===2)return"bg-fm-color-system-success-400 before:bg-fm-color-system-success-100";if(A&&L&&(fe($,P,V)||fe($,P,F)))return"bg-fm-color-primary before:bg-fm-color-system-info-100 after:bg-fm-color-system-info-100";if(z&&W&&(fe($,B,M)||fe($,B,F)))return"bg-fm-color-system-info-300 before:bg-fm-color-system-warning-100 after:bg-fm-color-system-warning-100";if(K||ae)return fe($,P,V)||fe($,P,F)?"bg-fm-color-primary before:bg-fm-color-system-success-100 after:bg-fm-color-system-info-100":"bg-fm-color-primary before:bg-fm-color-system-warning-100";if(te||pe)return fe($,B,M)||fe($,B,F)?"bg-fm-color-system-info-300 before:bg-fm-color-system-success-100 after:bg-fm-color-system-warning-100":"bg-fm-color-system-info-300 before:bg-fm-color-system-info-100";if(Ae)return"bg-fm-color-primary";if(Ue)return"bg-fm-color-system-info-300";if(fe($,B,M)&&(fe($,P,V)||fe($,P,F)))return"bg-fm-color-system-success-100";if(Oe)return"bg-fm-color-system-warning-100";if(he)return"bg-fm-color-system-info-100"};return{[`fm-calendar__cell__button--selected-start ${Ee()}`]:K||te,[`fm-calendar__cell__button--selected-end ${Ee()}`]:ae||pe,[`fm-calendar__cell__button--selected-between ${Ee()}`]:Oe||he,[`fm-calendar__cell__button--selected ${Ee()}`]:Ae||Ue}},C=$=>{const B=a.value;if(B[0].startDate&&!B[0].endDate||B[1].startDate&&!B[1].endDate){h.value=$;return}h.value=null},v=$=>{a.value[0]={startDate:D($.startDate,O),endDate:D($.endDate,O)}},_=$=>{const B=n.find(M=>M.id===$);B==null||B.action()},x=r.computed(()=>c.value?!a.value.every($=>$.startDate&&$.endDate):!(a.value[0].startDate&&a.value[0].endDate)),N=$=>{u.value="",c.value=$,a.value=Array.from(Array(2),()=>({startDate:null,endDate:null})),m=0},E=r.computed(()=>{const $=c.value&&Array.isArray(l.value)?l.value[1].startDate:null,B=c.value&&Array.isArray(l.value)?l.value[1].endDate:null;return $&&B?`Compared: ${D($).format("D MMM YYYY")} - ${D(B).format("D MMM YYYY")}`:""}),R=()=>{d.value=!0,setTimeout(()=>{e.value.scrollToItem(k(s.startOf("month")))},0)},k=$=>i.findIndex(B=>B.id===$.startOf("month").format(O));return r.watch(()=>l.value,()=>{var $,B;c.value?a.value=l.value.map(M=>({startDate:M!=null&&M.startDate?D(M.startDate,O):null,endDate:M!=null&&M.endDate?D(M.endDate,O):null})):a.value[0]={startDate:($=l.value)!=null&&$.startDate?D(l.value.startDate,O):null,endDate:(B=l.value)!=null&&B.endDate?D(l.value.endDate,O):null}}),($,B)=>{const M=r.resolveComponent("RecycleScroller");return r.openBlock(),r.createBlock(_e,{modelValue:r.unref(l),"onUpdate:modelValue":B[3]||(B[3]=P=>r.isRef(l)?l.value=P:null),disabled:$.disabled,focused:d.value,"helper-state":$.helperState,"helper-text":c.value?E.value:$.helperText,rules:$.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:P})=>{var V,F,A,L;return[$.$slots["trigger-button"]?(r.openBlock(),r.createElementBlock("div",{key:0,onClick:R},[r.renderSlot($.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps({opened:d.value,invalid:P,showValidBorder:$.showValidBorder,isComparing:c.value})),void 0,!0)])):(r.openBlock(),r.createBlock(Ai,{key:1,analytic:$.compare,"compare-label":$.compareLabel,disabled:$.disabled,"end-label":$.endLabel,focused:d.value,invalid:P,"is-comparing":c.value,"model-value":r.unref(l),"show-valid-border":$.showValidBorder,"start-label":$.startLabel,onClick:R},r.createSlots({_:2},[$.$slots["popover-button"]?{name:"popover-button",fn:r.withCtx(()=>[r.renderSlot($.$slots,"popover-button",{focused:d.value},void 0,!0)]),key:"0"}:void 0]),1032,["analytic","compare-label","disabled","end-label","focused","invalid","is-comparing","model-value","show-valid-border","start-label"])),d.value?(r.openBlock(),r.createBlock(r.Teleport,{key:2,to:"body"},[r.createElementVNode("div",{class:"bg-fm-color-neutral-white fixed flex flex-col h-screen left-0 top-0 w-screen",style:r.normalizeStyle({zIndex:o.zIndex})},[r.createElementVNode("div",sb,[$.showPredefinedRange?(r.openBlock(),r.createBlock(dn,{key:0,items:$.predefinedRange,"model-value":f.value,"onUpdate:modelValue":B[0]||(B[0]=z=>v(z))},null,8,["items","model-value"])):r.createCommentVNode("",!0),r.createVNode(Ai,{analytic:$.compare,"compare-label":$.compareLabel,"end-label":$.endLabel,"is-comparing":c.value,"model-value":{startDate:((V=a.value[0].startDate)==null?void 0:V.format(r.unref(O)))??null,endDate:((F=a.value[0].endDate)==null?void 0:F.format(r.unref(O)))??null},"start-label":$.startLabel},null,8,["analytic","compare-label","end-label","is-comparing","model-value","start-label"]),$.compare?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(Ri,{"model-value":c.value,label:"Compare","label-placement":"right","onUpdate:modelValue":B[1]||(B[1]=z=>N(z))},null,8,["model-value"]),c.value&&$.compare?(r.openBlock(),r.createBlock(dn,{key:0,items:n.map(z=>({label:z.label,sublabel:z.sublabel,value:z.id})),"model-value":u.value,"onUpdate:modelValue":B[2]||(B[2]=z=>_(z))},null,8,["items","model-value"])):r.createCommentVNode("",!0),c.value&&$.compare?(r.openBlock(),r.createBlock(Ai,{key:1,analytic:$.compare,"end-label":$.endLabel,"is-comparing":c.value,"model-value":{startDate:((A=a.value[1].startDate)==null?void 0:A.format(r.unref(O)))??null,endDate:((L=a.value[1].endDate)==null?void 0:L.format(r.unref(O)))??null},"start-label":$.startLabel,"compare-label":"Compare: Custom"},null,8,["analytic","end-label","is-comparing","model-value","start-label"])):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0),r.createElementVNode("div",lb,[r.createElementVNode("div",ab,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Qn),z=>(r.openBlock(),r.createElementBlock("div",{key:z,class:"fm-calendar__cell"},r.toDisplayString(z),1))),128))])])]),r.createElementVNode("div",db,[cb,r.createElementVNode("div",ub,[r.createVNode(M,{ref_key:"scroller",ref:e,buffer:200,"item-size":null,items:r.unref(i),class:"h-full no-scrollbar overflow-y-auto w-full","key-field":"id","size-field":"height"},{default:r.withCtx(({item:z})=>[r.createElementVNode("div",{id:z.id,class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},[r.createElementVNode("div",hb,[r.createElementVNode("div",mb,r.toDisplayString(r.unref(D)(z.id).format("MMMM")),1),r.createElementVNode("div",pb,r.toDisplayString(r.unref(D)(z.id).format("YYYY")),1)])],8,fb),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.matrix,(W,X)=>(r.openBlock(),r.createElementBlock("div",{key:X,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(W,K=>(r.openBlock(),r.createElementBlock("div",{key:K.date.date(),class:"fm-calendar__cell"},[K.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass([[y(K.date),{"fm-typo-body-lg-700":K.date.isSame(r.unref(s),"day")}],"fm-calendar__cell__button"]),type:"button",onClick:()=>p(K.date),onMouseover:te=>C(K.date)},r.toDisplayString(K.date.date()),43,gb)):r.createCommentVNode("",!0)]))),128))]))),128))])]),_:1},8,["items"])])]),r.createElementVNode("div",bb,[yb,r.createElementVNode("div",$b,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:b}),r.createVNode(U,{disabled:x.value,label:"Apply",size:"md",variant:"primary",onClick:g},null,8,["disabled"])])])],4)])):r.createCommentVNode("",!0)]}),_:2},[$.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot($.$slots,"helper-text",{},void 0,!0)]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"])}}}),[["__scopeId","data-v-b19edd50"]]),wb=r.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:void 0},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:D().format(O),endDate:D().format(O)}},{label:"Yesterday",value:{startDate:D().subtract(1,"day").format(O),endDate:D().subtract(1,"day").format(O)}},{label:"This week",value:{startDate:D().startOf("week").format(O),endDate:D().endOf("week").format(O)}},{label:"Last week",value:{startDate:D().subtract(1,"week").startOf("week").format(O),endDate:D().subtract(1,"week").endOf("week").format(O)}},{label:"Last 7 days",value:{startDate:D().subtract(7,"day").format(O),endDate:D().subtract(1,"day").format(O)}},{label:"This month",value:{startDate:D().startOf("month").format(O),endDate:D().endOf("month").format(O)}},{label:"Last month",value:{startDate:D().subtract(1,"month").startOf("month").format(O),endDate:D().subtract(1,"month").endOf("month").format(O)}},{label:"This year",value:{startDate:D().startOf("year").format(O),endDate:D().endOf("year").format(O)}}]},compare:{type:Boolean,default:!1},compareLabel:{default:"Date"},min:{default:()=>D().subtract(50,"year").format(O)},max:{default:()=>D().add(25,"year").format(O)},zIndex:{},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,{breakpoints:n}=yt(),o=q(e,"modelValue"),i=Jo(e);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(n).md||r.unref(n).lg?(r.openBlock(),r.createBlock(K2,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(n).xs||r.unref(n).sm?(r.openBlock(),r.createBlock(Ld,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}}),I="YYYY-MM-DD",cn=t=>{const e=[],n=t.endOf("month"),o=t.month();let i=t.startOf("week"),s=[];for(;i.isBefore(n.endOf("week"));)i.day()===0&&s.length>0&&(e.push(s),s=[]),s.push({date:i,isCurrentMonth:i.month()===o}),i=i.add(1,"day");return s.length>0&&e.push(s),e.length<6&&e.push([]),e},_b=Array.from(Array(7),(t,e)=>D().day(e).format("ddd")),Hd=(t,e)=>({startAt:t?D(t,I):null,endAt:e?D(e,I):null}),kb={class:"fm-typo-body-md-700"},Cb={class:"h-[264px] overflow-y-auto w-[160px]"},xb=["onVnodeMounted"],Sb=["onVnodeMounted"],ze=r.defineComponent({__name:"FmDateRangeYearMonthPicker",props:{modelValue:{},picker:{},min:{},max:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>{const c=D(n.min).startOf("year"),u=D(n.max).startOf("year"),f=u.diff(c,"year"),h=[];for(let m=0;m<=f;m++)h.push(u.subtract(m,"year"));return h}),l=c=>{const u=D(n.min).startOf("month"),f=D(n.max).startOf("month");return c.get("year")===u.get("year")?c.startOf("month").isAfter(u)||c.get("month")===u.get("month"):c.get("year")===f.get("year")?c.startOf("month").isBefore(f)||c.get("month")===f.get("month"):!0},a=c=>{const u=D(n.min).startOf("month"),f=D(n.max).startOf("month");if(u.get("year")===c.get("year")){o("update:modelValue",u);return}if(f.get("year")===c.get("year")){o("update:modelValue",f);return}o("update:modelValue",c)};function d(c,u){if(!u)return!1;const f=c.el,h=f==null?void 0:f.parentElement;!f||!h||h.scrollTo({top:f.offsetTop-50})}return(c,u)=>(r.openBlock(),r.createBlock(Ze,{trigger:"click","in-popover":"",onMenuChanged:u[0]||(u[0]=f=>i.value=f)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-4 h-24 items-center px-4 rounded-sm",i.value?"text-fm-color-primary":"hover:bg-fm-color-neutral-gray-100"])},[r.createElementVNode("div",kb,[c.picker==="month"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(c.modelValue.format("MMMM")),1)],64)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(c.modelValue.format("YYYY")),1)],64)):r.createCommentVNode("",!0)]),r.createVNode(H,{name:i.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),default:r.withCtx(()=>[r.createElementVNode("ul",Cb,[c.picker==="month"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(Array.from(Array(12),(f,h)=>c.modelValue.month(h)),f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("MMMM"),onVnodeMounted:h=>d(h,c.modelValue.format("MMMM")===f.format("MMMM"))},[r.createVNode(we,{disabled:!l(f),"model-value":c.modelValue.format("MMMM")===f.format("MMMM"),label:f.format("MMMM"),"onUpdate:modelValue":h=>o("update:modelValue",f)},null,8,["disabled","model-value","label","onUpdate:modelValue"])],8,xb))),128)):r.createCommentVNode("",!0),c.picker==="year"?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("li",{key:f.format("YYYY"),onVnodeMounted:h=>d(h,c.modelValue.format("YYYY")===f.format("YYYY"))},[r.createVNode(we,{"model-value":c.modelValue.format("YYYY")===f.format("YYYY"),label:f.format("YYYY"),"onUpdate:modelValue":h=>a(f)},null,8,["model-value","label","onUpdate:modelValue"])],8,Sb))),128)):r.createCommentVNode("",!0)])]),_:1}))}}),vb={class:"fm-calendar__name-row fm-typo-body-md-400 text-fm-color-typo-tertiary"},Db=["id"],Mb={key:0,class:"fm-calendar__cell__button--today"},Vb=["onClick","onMouseover"],un=J(r.defineComponent({__name:"FmCalendar",props:{days:{},dayCellClass:{type:[Object,Function],default:void 0},onDayClick:{},onCellMouseOver:{type:Function,default:void 0},cellSize:{default:"md"}},setup(t){const e=D(),n=(i,s)=>typeof i=="function"?i(...s):i,o=(i,s)=>{if(!s)return;const l={"fm-calendar__cell--selected":!1,"fm-calendar__cell--selected-start":!1,"fm-calendar__cell--selected-end":!1,"fm-calendar__cell--selected-between":!1};let a;if(typeof s=="function"){const{status:d,className:c}=s(i);d&&(l["fm-calendar__cell--selected"]=d.isSelected??!1,l["fm-calendar__cell--selected-start"]=d.isStart??!1,l["fm-calendar__cell--selected-end"]=d.isEnd??!1,l["fm-calendar__cell--selected-between"]=d.isBetween??!1),a=c??""}else{const{status:d,className:c}=s;d&&(l["fm-calendar__cell--selected"]=n(d.isSelected,[i])??!1,l["fm-calendar__cell--selected-start"]=n(d.isStart,[i])??!1,l["fm-calendar__cell--selected-end"]=n(d.isEnd,[i])??!1,l["fm-calendar__cell--selected-between"]=n(d.isBetween,[i])??!1),a=n(c,[i])??""}return[l,a]};return(i,s)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",vb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(_b),l=>(r.openBlock(),r.createElementBlock("div",{key:l,class:r.normalizeClass(["fm-calendar__cell",`fm-calendar__cell__${i.cellSize}`])},r.toDisplayString(l),3))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.days,(l,a)=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"fm-calendar__row fm-typo-body-md-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l,d=>(r.openBlock(),r.createElementBlock("div",{id:`${d.date.toISOString()}`,key:d.date.date(),class:r.normalizeClass(["fm-calendar__cell",[`fm-calendar__cell__${i.cellSize}`,o(d.date,i.dayCellClass),!d.isCurrentMonth&&"fm-calendar__cell--not-current-month"]])},[d.date.isSame(r.unref(e),"day")&&d.isCurrentMonth?(r.openBlock(),r.createElementBlock("div",Mb)):r.createCommentVNode("",!0),d.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:1,class:"fm-calendar__cell__button",type:"button",onClick:c=>i.onDayClick(d),onMouseover:c=>{var u;return(u=i.onCellMouseOver)==null?void 0:u.call(i,d.date)}},r.toDisplayString(d.date.date()),41,Vb)):r.createCommentVNode("",!0)],10,Db))),128))]))),128))])]))}}),[["__scopeId","data-v-0942b815"]]),Bb={class:"p-12 space-y-4 w-[552px]"},Eb={class:"w-max"},Pb={class:"flex space-x-24"},Nb={class:"flex items-center py-8 space-x-16"},Fb={class:"flex space-x-4"},Rb={class:"flex items-center justify-end py-8 space-x-16"},Ab={class:"flex space-x-4"},Ob={class:"flex gap-8 items-center justify-end w-full"},Ib=r.defineComponent({__name:"FmSimpleDatePickerDesktop",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>D().subtract(50,"year").format(I)},max:{default:()=>D().add(25,"year").format(I)},zIndex:{default:void 0},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=q(e,"modelValue"),o=r.ref(D(n.value,I)),i=r.ref(!1),s=r.ref(D().startOf("month")),l=r.ref(D().startOf("month").add(1,"month")),a=(p,g)=>{p==="left"?(s.value=g,l.value=g.add(1,"month")):p==="right"&&(l.value=g,s.value=g.subtract(1,"month"))},d=p=>{o.value=p},c=r.computed(()=>cn(s.value)),u=r.computed(()=>cn(s.value.add(1,"month"))),f=()=>{n.value=o.value.format(I),setTimeout(()=>{i.value=!1},0)},h=()=>{o.value=n.value?D(n.value):null,i.value=!1},m=p=>{i.value=p,p||h()};return(p,g)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":g[6]||(g[6]=b=>r.isRef(n)?n.value=b:null),disabled:p.disabled,focused:i.value,"helper-state":p.helperState,"helper-text":p.helperText,info:p.labelInfo,label:p.label,optional:p.labelMark==="optional",required:p.labelMark==="required",rules:p.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(p.$slots,"label")]),default:r.withCtx(({invalid:b})=>[r.createVNode(Vt,{disabled:p.disabled,"show-popover":i.value,"z-index":e.zIndex,onPopoverChanged:m},{"popover-button":r.withCtx(()=>[p.$slots["trigger-button"]?r.renderSlot(p.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:b,opened:i.value,showValidBorder:p.showValidBorder}))):(r.openBlock(),r.createBlock(le,{key:1,focused:i.value,"icon-outlined":!i.value,invalid:b,"show-valid-border":p.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(p.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(p.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(n)?r.unref(D)(r.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","icon-outlined","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",Bb,[r.createElementVNode("div",Eb,[r.createElementVNode("div",Pb,[r.createElementVNode("div",null,[r.createElementVNode("div",Nb,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:g[0]||(g[0]=()=>a("left",s.value.subtract(1,"month")))}),r.createElementVNode("div",Fb,[r.createVNode(ze,{max:p.max,min:p.min,"model-value":s.value,picker:"month","onUpdate:modelValue":g[1]||(g[1]=y=>a("left",y))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:p.max,min:p.min,"model-value":s.value,picker:"year","onUpdate:modelValue":g[2]||(g[2]=y=>a("left",y))},null,8,["max","min","model-value"])])]),r.createVNode(un,{days:c.value,"on-day-click":y=>d(y.date),"day-cell-class":{status:{isSelected:y=>y.isSame(o.value,"date")}}},null,8,["days","on-day-click","day-cell-class"])]),r.createElementVNode("div",null,[r.createElementVNode("div",Rb,[r.createElementVNode("div",Ab,[r.createVNode(ze,{max:p.max,min:p.min,"model-value":l.value,picker:"month","onUpdate:modelValue":g[3]||(g[3]=y=>a("right",y))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:p.max,min:p.min,"model-value":l.value,picker:"year","onUpdate:modelValue":g[4]||(g[4]=y=>a("right",y))},null,8,["max","min","model-value"])]),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:g[5]||(g[5]=()=>a("left",s.value.add(1,"month")))})]),r.createVNode(un,{days:u.value,"on-day-click":y=>d(y.date),"day-cell-class":{status:{isSelected:y=>y.isSame(o.value,"date")}}},null,8,["days","on-day-click","day-cell-class"])])])]),r.createElementVNode("div",Ob,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),r.createVNode(U,{disabled:!o.value,label:"Apply",size:"md",variant:"primary",onClick:f},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),Tb={class:"p-12 space-y-4 w-[276px]"},zb={class:"w-max"},Lb={class:"flex space-x-24"},Hb={class:"flex items-center justify-between py-8"},Yb={class:"flex space-x-4"},jb={class:"flex space-x-4"},Wb={class:"flex gap-8 items-center justify-end w-full"},Yd=r.defineComponent({__name:"FmSimpleDatePickerMobile",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>D().subtract(50,"year").format(I)},max:{default:()=>D().add(25,"year").format(I)},zIndex:{default:void 0},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=q(e,"modelValue"),o=r.ref(D(n.value,I)),i=r.ref(!1),s=r.ref(D().startOf("month")),l=h=>{s.value=h},a=h=>{o.value=h},d=r.computed(()=>cn(s.value)),c=()=>{n.value=o.value.format(I),setTimeout(()=>{i.value=!1},0)},u=()=>{o.value=n.value?D(n.value):null,i.value=!1},f=h=>{i.value=h,h||u()};return(h,m)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":m[4]||(m[4]=p=>r.isRef(n)?n.value=p:null),disabled:h.disabled,focused:i.value,"helper-state":h.helperState,"helper-text":h.helperText,info:h.labelInfo,label:h.label,optional:h.labelMark==="optional",required:h.labelMark==="required",rules:h.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(h.$slots,"label")]),default:r.withCtx(({invalid:p})=>[r.createVNode(Vt,{disabled:h.disabled,"show-popover":i.value,"z-index":e.zIndex,onPopoverChanged:f},{"popover-button":r.withCtx(()=>[h.$slots["trigger-button"]?r.renderSlot(h.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:p,opened:i.value,showValidBorder:h.showValidBorder}))):(r.openBlock(),r.createBlock(le,{key:1,focused:i.value,"icon-outlined":!i.value,invalid:p,"show-valid-border":h.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(h.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(h.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([[e.disabled?"text-fm-color-typo-disabled":r.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"],"fm-typo-body-lg-400"])},r.toDisplayString(r.unref(n)?r.unref(D)(r.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","icon-outlined","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",Tb,[r.createElementVNode("div",zb,[r.createElementVNode("div",Lb,[r.createElementVNode("div",null,[r.createElementVNode("div",Hb,[r.createElementVNode("div",Yb,[r.createVNode(ze,{max:h.max,min:h.min,"model-value":s.value,picker:"month","onUpdate:modelValue":m[0]||(m[0]=g=>l(g))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:h.max,min:h.min,"model-value":s.value,picker:"year","onUpdate:modelValue":m[1]||(m[1]=g=>l(g))},null,8,["max","min","model-value"])]),r.createElementVNode("div",jb,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:m[2]||(m[2]=()=>l(s.value.subtract(1,"month")))}),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:m[3]||(m[3]=()=>l(s.value.add(1,"month")))})])]),r.createVNode(un,{days:d.value,"on-day-click":g=>a(g.date),"day-cell-class":{status:{isSelected:g=>g.isSame(o.value,"date")}}},null,8,["days","on-day-click","day-cell-class"])])])]),r.createElementVNode("div",Wb,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:!o.value,label:"Apply",size:"md",variant:"primary",onClick:c},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(h.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),Ub=r.defineComponent({__name:"FmSimpleDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},min:{default:()=>D().subtract(50,"year").format(I)},max:{default:()=>D().add(25,"year").format(I)},zIndex:{},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const{breakpoints:e}=yt(),n=t,o=q(n,"modelValue"),i=Jo(n);return(s,l)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(e).md||r.unref(e).lg?(r.openBlock(),r.createBlock(Ib,r.mergeProps({key:0},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(e).xs||r.unref(e).sm?(r.openBlock(),r.createBlock(Yd,r.mergeProps({key:1},r.unref(i),{modelValue:r.unref(o),"onUpdate:modelValue":l[1]||(l[1]=a=>r.isRef(o)?o.value=a:null)}),r.createSlots({_:2},[s.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(a=>[r.renderSlot(s.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(a)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}});var ee=(t=>(t.NoComparison="no_comparison",t.PrecedingPeriod="preceding_period",t.PrecedingWeek="preceding_week",t.PrecedingMonth="preceding_month",t.PrecedingYear="preceding_year",t.Custom="custom",t))(ee||{});const Gb={key:1,class:"flex gap-4 items-center relative w-full"},qb={class:"flex flex-col gap-4 w-full"},Xb=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),Kb={class:"flex flex-col gap-4 w-full"},Zb={class:"flex h-[360px]"},Jb={class:"flex flex-col items-start p-12 pr-4"},Qb={key:0},ey={key:1},ty=r.createElementVNode("div",{class:"bg-fm-color-neutral-gray-100 h-full mx-4 w-px"},null,-1),ny={class:"w-max"},oy={class:"flex space-x-24"},ry={class:"flex items-center py-8 space-x-16"},iy={class:"flex space-x-4"},sy={class:"flex items-center justify-end py-8 space-x-16"},ly={class:"flex space-x-4"},ay={class:"flex gap-8 items-center justify-end w-full"},dy=r.defineComponent({__name:"FmSimpleDateRangePickerDesktop",props:{modelValue:{},compareTarget:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:D().format(I),endDate:D().format(I)}},{label:"Yesterday",value:{startDate:D().subtract(1,"day").format(I),endDate:D().subtract(1,"day").format(I)}},{label:"This week",value:{startDate:D().startOf("week").format(I),endDate:D().endOf("week").format(I)}},{label:"Last week",value:{startDate:D().subtract(1,"week").startOf("week").format(I),endDate:D().subtract(1,"week").endOf("week").format(I)}},{label:"Last 7 days",value:{startDate:D().subtract(7,"day").format(I),endDate:D().subtract(1,"day").format(I)}},{label:"This month",value:{startDate:D().startOf("month").format(I),endDate:D().endOf("month").format(I)}},{label:"Last month",value:{startDate:D().subtract(1,"month").startOf("month").format(I),endDate:D().subtract(1,"month").endOf("month").format(I)}},{label:"This year",value:{startDate:D().startOf("year").format(I),endDate:D().endOf("year").format(I)}}]},defaultCompareType:{default:ee.PrecedingPeriod},min:{default:()=>D().subtract(50,"year").format(I)},max:{default:()=>D().add(25,"year").format(I)},zIndex:{default:void 0},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","select-comparison"],setup(t,{emit:e}){var E,R;const n=k=>()=>{var B,M;const{startAt:S,endAt:w}=Hd((B=s.compareTarget)==null?void 0:B.startDate,(M=s.compareTarget)==null?void 0:M.endDate);if(!S||!w)return;const $=k({startAt:S,endAt:w});return y("right",$.endDate.startOf("month")),$},o=r.computed(()=>[{id:ee.PrecedingWeek,label:"Same period last week",sublabel:"Match day of week",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"week")+1;return a.value={startDate:k.subtract(w,"week"),endDate:S.subtract(w,"week")},h.value=ee.PrecedingWeek,a.value})},{id:ee.PrecedingMonth,label:"Same period last month",sublabel:"Match day of month",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"month")+1;return a.value={startDate:k.subtract(w,"month"),endDate:S.subtract(w,"month")},h.value=ee.PrecedingMonth,a.value})},{id:ee.PrecedingPeriod,label:"Preceding period",sublabel:"",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"day")+1;return a.value={startDate:k.subtract(w,"day"),endDate:S.subtract(w,"day")},h.value=ee.PrecedingPeriod,a.value})},{id:ee.PrecedingYear,label:"Same period last year",sublabel:"",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"year")+1;return a.value={startDate:k.subtract(w,"year"),endDate:S.subtract(w,"year")},h.value=ee.PrecedingYear,a.value})},{id:ee.Custom,label:"Custom",sublabel:"",action:()=>{h.value=ee.Custom}},{id:ee.NoComparison,label:"No Comparison",sublabel:"",action:()=>{a.value={startDate:null,endDate:null},h.value=ee.NoComparison}}]),i=e,s=t,l=q(s,"modelValue"),a=r.ref({startDate:(E=l.value)!=null&&E.startDate?D(l.value.startDate,I):null,endDate:(R=l.value)!=null&&R.endDate?D(l.value.endDate,I):null}),d=r.ref(!1),c=r.ref(D().startOf("month")),u=r.ref(D().startOf("month").add(1,"month")),f=r.ref(""),h=r.ref(s.defaultCompareType),m=r.ref(null),p=k=>{if(f.value="",h.value=ee.Custom,a.value.startDate&&a.value.endDate){a.value={startDate:k,endDate:null};return}else if(!a.value.startDate&&!a.value.endDate)a.value.startDate=k;else if(k.isBefore(a.value.startDate)){const S=a.value.startDate;a.value={startDate:k,endDate:S}}else a.value.endDate=k},g=()=>{var k,S;l.value={startDate:(k=a.value.startDate)==null?void 0:k.format(I),endDate:(S=a.value.endDate)==null?void 0:S.format(I)},i("select-comparison",h.value),setTimeout(()=>{d.value=!1})},b=()=>{var k,S;a.value={startDate:(k=l.value)!=null&&k.startDate?D(l.value.startDate,I):null,endDate:(S=l.value)!=null&&S.endDate?D(l.value.endDate,I):null},d.value=!1},y=(k,S)=>{k==="left"?(c.value=S,u.value=S.add(1,"month")):k==="right"&&(u.value=S,c.value=S.subtract(1,"month"))},C=k=>{const S=a.value.startDate,w=a.value.endDate,$=m.value,B=S==null?void 0:S.isSame(k),M=w==null?void 0:w.isSame(k),P=$==null?void 0:$.isSame(k),V=B&&w&&!(B&&M)||S&&!w&&B&&($==null?void 0:$.isAfter(S))||S&&!w&&P&&($==null?void 0:$.isBefore(S)),F=M&&S&&!(B&&M)||S&&!w&&B&&($==null?void 0:$.isBefore(S))||S&&!w&&P&&($==null?void 0:$.isAfter(S)),A=B&&M||B&&!w,L=S&&(w||$)&&w?k.isAfter(S)&&k.isBefore(w):k.isAfter($)&&k.isBefore(S)||k.isBefore($)&&k.isAfter(S);return{status:{isStart:V??!1,isEnd:F??!1,isBetween:L??!1,isSelected:A??!1}}},v=k=>{const S=a.value;if(S.startDate&&!S.endDate){m.value=k;return}m.value=null},_=k=>{f.value=k.label;const S=D(k.value.startDate,I),w=D(k.value.endDate,I);a.value={startDate:S,endDate:w},y("right",w.startOf("month"))},x=k=>{d.value=k,k||b()},N=r.computed(()=>!h.value&&!(a.value.startDate&&a.value.endDate));return r.watch(()=>l.value,()=>{var k,S;a.value={startDate:(k=l.value)!=null&&k.startDate?D(l.value.startDate,I):null,endDate:(S=l.value)!=null&&S.endDate?D(l.value.endDate,I):null}}),r.watch(()=>s.compareTarget,()=>{if(!s.compareTarget||h.value===ee.Custom)return;const k=o.value.find(w=>w.id===h.value),S=k==null?void 0:k.action();S&&(l.value=S)}),(k,S)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(l),"onUpdate:modelValue":S[6]||(S[6]=w=>r.isRef(l)?l.value=w:null),disabled:k.disabled,focused:d.value,"helper-state":k.helperState,"helper-text":k.helperText,rules:k.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:w})=>[r.createVNode(Vt,{disabled:k.disabled,"show-popover":d.value,"z-index":s.zIndex,onPopoverChanged:x},{"popover-button":r.withCtx(()=>[k.$slots["trigger-button"]?r.renderSlot(k.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{opened:d.value,invalid:w,showValidBorder:k.showValidBorder}))):(r.openBlock(),r.createElementBlock("div",Gb,[r.createElementVNode("label",qb,[r.createElementVNode("div",{class:r.normalizeClass([[s.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(s.startLabel),3),r.createVNode(le,{class:r.normalizeClass(k.disabled?"cursor-not-allowed":"cursor-pointer"),focused:d.value,"icon-outlined":!d.value,invalid:w,"show-valid-border":k.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(k.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(k.$slots,"append")]),default:r.withCtx(()=>{var $;return[r.createElementVNode("div",{class:r.normalizeClass([[s.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(($=r.unref(l))!=null&&$.startDate?r.unref(D)(r.unref(l).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])]),Xb,r.createElementVNode("label",Kb,[r.createElementVNode("div",{class:r.normalizeClass([[s.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(s.endLabel),3),r.createVNode(le,{class:r.normalizeClass(k.disabled?"cursor-not-allowed":"cursor-pointer"),focused:d.value,"icon-outlined":!d.value,invalid:w,"show-valid-border":k.showValidBorder,"prepend-icon":"calendar_month"},{prepend:r.withCtx(()=>[r.renderSlot(k.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(k.$slots,"append")]),default:r.withCtx(()=>{var $;return[r.createElementVNode("div",{class:r.normalizeClass([[s.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"],"fm-typo-body-lg-400"])},r.toDisplayString(($=r.unref(l))!=null&&$.endDate?r.unref(D)(r.unref(l).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","icon-outlined","invalid","show-valid-border"])])]))]),default:r.withCtx(()=>[r.createElementVNode("div",Zb,[k.showPredefinedRange||k.compareTarget?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",Jb,[k.showPredefinedRange&&!k.compareTarget?(r.openBlock(),r.createElementBlock("div",Qb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.predefinedRange,($,B)=>(r.openBlock(),r.createBlock(we,{key:B,label:$.label,"model-value":f.value===$.label,selectable:"",class:"min-w-[158px]",onClick:M=>_($)},null,8,["label","model-value","onClick"]))),128))])):r.createCommentVNode("",!0),k.compareTarget?(r.openBlock(),r.createElementBlock("div",ey,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,($,B)=>(r.openBlock(),r.createBlock(we,{key:B,label:$.label,"model-value":h.value===$.id,sublabel:$.sublabel,selectable:"",class:"min-w-[158px]",onClick:M=>$.action()},null,8,["label","model-value","sublabel","onClick"]))),128))])):r.createCommentVNode("",!0)]),ty],64)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["p-12 space-y-4",{"pl-4":k.showPredefinedRange||k.compareTarget}])},[r.createElementVNode("div",ny,[r.createElementVNode("div",oy,[r.createElementVNode("div",null,[r.createElementVNode("div",ry,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:S[0]||(S[0]=()=>y("left",c.value.subtract(1,"month")))}),r.createElementVNode("div",iy,[r.createVNode(ze,{max:k.max,min:k.min,"model-value":c.value,picker:"month","onUpdate:modelValue":S[1]||(S[1]=$=>y("left",$))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:k.max,min:k.min,"model-value":u.value,picker:"year","onUpdate:modelValue":S[2]||(S[2]=$=>y("left",$))},null,8,["max","min","model-value"])])]),r.createVNode(un,{days:r.unref(cn)(c.value),"on-day-click":$=>p($.date),"day-cell-class":C,onCellMouseOver:v},null,8,["days","on-day-click"])]),r.createElementVNode("div",null,[r.createElementVNode("div",sy,[r.createElementVNode("div",ly,[r.createVNode(ze,{max:k.max,min:k.min,"model-value":u.value,picker:"month","onUpdate:modelValue":S[3]||(S[3]=$=>y("right",$))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:k.max,min:k.min,"model-value":u.value,picker:"year","onUpdate:modelValue":S[4]||(S[4]=$=>y("right",$))},null,8,["max","min","model-value"])]),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:S[5]||(S[5]=()=>y("left",c.value.add(1,"month")))})]),r.createVNode(un,{days:r.unref(cn)(u.value),"on-day-click":$=>p($.date),"day-cell-class":$=>C($),onCellMouseOver:v},null,8,["days","on-day-click","day-cell-class"])])])]),r.createElementVNode("div",ay,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:b}),r.createVNode(U,{disabled:N.value,label:"Apply",size:"md",variant:"primary",onClick:g},null,8,["disabled"])])],2)])]),_:2},1032,["disabled","show-popover","z-index"])]),_:2},[k.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(k.$slots,"helper-text")]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"]))}}),cy={key:0},uy={class:"flex gap-4 items-center relative w-full"},fy={class:"flex flex-col gap-4 w-full"},hy=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),my={class:"flex flex-col gap-4 w-full"},py={key:1,class:"flex flex-col gap-4 w-full"},gy=r.defineComponent({__name:"FmSimpleDateRangePickerField",props:{modelValue:{},analytic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},isComparing:{type:Boolean,default:!1},startLabel:{default:"Start date"},endLabel:{default:"End date"},compareLabel:{default:"Date"}},setup(t){const e=t,n=r.computed(()=>{if(!e.modelValue)return{startDate:"DD MM YYYY",endDate:"DD MM YYYY"};const o=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].startDate:e.modelValue.startDate,i=e.isComparing&&Array.isArray(e.modelValue)?e.modelValue[0].endDate:e.modelValue.endDate;return{startDate:o?D(o).format("D MMM YYYY"):"DD MM YYYY",endDate:i?D(i).format("D MMM YYYY"):"DD MM YYYY"}});return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[o.analytic?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",cy,[r.renderSlot(o.$slots,"popover-button",{},()=>[r.createElementVNode("div",uy,[r.createElementVNode("label",fy,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400 line-clamp-1",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.startLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.startDate?r.unref(D)(o.modelValue.startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])]),hy,r.createElementVNode("label",my,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(o.endLabel),3),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>{var s,l;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":(s=o.modelValue)!=null&&s.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((l=o.modelValue)!=null&&l.endDate?r.unref(D)(o.modelValue.endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:3},8,["class","focused","invalid","show-valid-border"])])])])])),o.analytic?(r.openBlock(),r.createElementBlock("label",py,[r.createVNode(Kt,{label:o.compareLabel},null,8,["label"]),r.createVNode(le,{class:r.normalizeClass(o.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.focused,invalid:o.invalid,"show-valid-border":o.showValidBorder,"prepend-icon":"calendar_month","icon-outlined":""},{prepend:r.withCtx(()=>[r.renderSlot(o.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(o.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[o.disabled?"text-fm-color-typo-disabled":n.value.startDate!=="DD MM YYYY"?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(n.value.startDate)+" - "+r.toDisplayString(n.value.endDate),3)]),_:3},8,["class","focused","invalid","show-valid-border"])])):r.createCommentVNode("",!0)]))}}),by={class:"p-12 space-y-4"},yy={class:"w-max"},$y={class:"flex space-x-24"},wy={class:"flex items-center justify-between py-8"},_y={class:"flex space-x-4"},ky={class:"flex space-x-4"},Cy={class:"flex gap-8 items-center justify-end w-full"},jd=r.defineComponent({__name:"FmSimpleDateRangePickerMobile",props:{modelValue:{},compareTarget:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:D().format(I),endDate:D().format(I)}},{label:"Yesterday",value:{startDate:D().subtract(1,"day").format(I),endDate:D().subtract(1,"day").format(I)}},{label:"This week",value:{startDate:D().startOf("week").format(I),endDate:D().endOf("week").format(I)}},{label:"Last week",value:{startDate:D().subtract(1,"week").startOf("week").format(I),endDate:D().subtract(1,"week").endOf("week").format(I)}},{label:"Last 7 days",value:{startDate:D().subtract(7,"day").format(I),endDate:D().subtract(1,"day").format(I)}},{label:"This month",value:{startDate:D().startOf("month").format(I),endDate:D().endOf("month").format(I)}},{label:"Last month",value:{startDate:D().subtract(1,"month").startOf("month").format(I),endDate:D().subtract(1,"month").endOf("month").format(I)}},{label:"This year",value:{startDate:D().startOf("year").format(I),endDate:D().endOf("year").format(I)}}]},defaultCompareType:{default:ee.PrecedingPeriod},min:{default:()=>D().subtract(50,"year").format(I)},max:{default:()=>D().add(25,"year").format(I)},zIndex:{default:void 0},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","select-comparison"],setup(t,{emit:e}){var E,R;const n=k=>()=>{var B,M;const{startAt:S,endAt:w}=Hd((B=s.compareTarget)==null?void 0:B.startDate,(M=s.compareTarget)==null?void 0:M.endDate);if(!S||!w)return;const $=k({startAt:S,endAt:w});return b($.endDate.startOf("month")),$},o=r.computed(()=>[{id:ee.PrecedingWeek,label:"Preceding period",sublabel:"Match day of week",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"week")+1;return a.value={startDate:k.subtract(w,"week"),endDate:S.subtract(w,"week")},f.value=ee.PrecedingWeek,a.value})},{id:ee.PrecedingMonth,label:"Same period last week",sublabel:"Match day of month",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"month")+1;return a.value={startDate:k.subtract(w,"month"),endDate:S.subtract(w,"month")},f.value=ee.PrecedingMonth,a.value})},{id:ee.PrecedingPeriod,label:"Preceding period",sublabel:"",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"day")+1;return a.value={startDate:k.subtract(w,"day"),endDate:S.subtract(w,"day")},f.value=ee.PrecedingPeriod,a.value})},{id:ee.PrecedingYear,label:"Same period last year",sublabel:"",action:n(({startAt:k,endAt:S})=>{const w=S.diff(k,"year")+1;return a.value={startDate:k.subtract(w,"year"),endDate:S.subtract(w,"year")},f.value=ee.PrecedingYear,a.value})},{id:ee.Custom,label:"Custom",sublabel:"",action:()=>{f.value=ee.Custom}},{id:ee.NoComparison,label:"No Comparison",sublabel:"",action:()=>{a.value={startDate:null,endDate:null},f.value=ee.NoComparison}}]),i=e,s=t,l=q(s,"modelValue"),a=r.ref({startDate:(E=l.value)!=null&&E.startDate?D(l.value.startDate,I):null,endDate:(R=l.value)!=null&&R.endDate?D(l.value.endDate,I):null}),d=r.ref(!1),c=r.ref(D().startOf("month")),u=r.ref(""),f=r.ref(s.defaultCompareType),h=r.ref(null),m=k=>{if(u.value="",f.value=ee.Custom,a.value.startDate&&a.value.endDate){a.value={startDate:k,endDate:null};return}else if(!a.value.startDate&&!a.value.endDate)a.value.startDate=k;else if(k.isBefore(a.value.startDate)){const S=a.value.startDate;a.value={startDate:k,endDate:S}}else a.value.endDate=k},p=()=>{var k,S;l.value={startDate:(k=a.value.startDate)==null?void 0:k.format(I),endDate:(S=a.value.endDate)==null?void 0:S.format(I)},i("select-comparison",f.value),setTimeout(()=>{d.value=!1})},g=()=>{var k,S;a.value={startDate:(k=l.value)!=null&&k.startDate?D(l.value.startDate,I):null,endDate:(S=l.value)!=null&&S.endDate?D(l.value.endDate,I):null},d.value=!1},b=k=>{c.value=k},y=k=>{const S=a.value.startDate,w=a.value.endDate,$=h.value,B=S==null?void 0:S.isSame(k),M=w==null?void 0:w.isSame(k),P=$==null?void 0:$.isSame(k),V=B&&w&&!(B&&M)||S&&!w&&B&&($==null?void 0:$.isAfter(S))||S&&!w&&P&&($==null?void 0:$.isBefore(S)),F=M&&S&&!(B&&M)||S&&!w&&B&&($==null?void 0:$.isBefore(S))||S&&!w&&P&&($==null?void 0:$.isAfter(S)),A=B&&M||B&&!w,L=S&&(w||$)&&w?k.isAfter(S)&&k.isBefore(w):k.isAfter($)&&k.isBefore(S)||k.isBefore($)&&k.isAfter(S);return{status:{isStart:V??!1,isEnd:F??!1,isBetween:L??!1,isSelected:A??!1}}},C=k=>{const S=a.value;if(S.startDate&&!S.endDate){h.value=k;return}h.value=null},v=k=>{const S=D(k.startDate,I),w=D(k.endDate,I);a.value={startDate:S,endDate:w},b(w.startOf("month"))},_=k=>{const S=o.value.find(w=>w.id===k);S==null||S.action()},x=k=>{d.value=k,k||g()},N=r.computed(()=>!f.value&&!(a.value.startDate&&a.value.endDate));return r.watch(()=>l.value,()=>{var k,S;a.value={startDate:(k=l.value)!=null&&k.startDate?D(l.value.startDate,I):null,endDate:(S=l.value)!=null&&S.endDate?D(l.value.endDate,I):null}}),r.watch(()=>s.compareTarget,()=>{if(!s.compareTarget||f.value===ee.Custom)return;const k=o.value.find(w=>w.id===f.value),S=k==null?void 0:k.action();S&&(l.value=S)}),(k,S)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(l),"onUpdate:modelValue":S[6]||(S[6]=w=>r.isRef(l)?l.value=w:null),disabled:k.disabled,focused:d.value,"helper-state":k.helperState,"helper-text":k.helperText,rules:k.rules,tag:"div"},r.createSlots({default:r.withCtx(({invalid:w})=>[r.createVNode(Vt,{disabled:k.disabled,"show-popover":d.value,"z-index":s.zIndex,"exclude-el-from-click-outside":["exclude-from-click-outside"],onPopoverChanged:x},{"popover-button":r.withCtx(()=>[k.$slots["trigger-button"]?r.renderSlot(k.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{opened:d.value,invalid:w,showValidBorder:k.showValidBorder}))):(r.openBlock(),r.createBlock(gy,{key:1,disabled:k.disabled,"end-label":k.endLabel,focused:d.value,invalid:w,"model-value":r.unref(l),"show-valid-border":k.showValidBorder,"start-label":k.startLabel},r.createSlots({_:2},[k.$slots["popover-button"]?{name:"popover-button",fn:r.withCtx(()=>[r.renderSlot(k.$slots,"popover-button",{focused:d.value})]),key:"0"}:void 0]),1032,["disabled","end-label","focused","invalid","model-value","show-valid-border","start-label"]))]),default:r.withCtx(()=>[r.createElementVNode("div",by,[k.showPredefinedRange&&!k.compareTarget?(r.openBlock(),r.createBlock(dn,{key:0,"menu-id":"exclude-from-click-outside",items:k.predefinedRange,"model-value":u.value,"onUpdate:modelValue":S[0]||(S[0]=$=>v($))},null,8,["items","model-value"])):r.createCommentVNode("",!0),k.compareTarget?(r.openBlock(),r.createBlock(dn,{key:1,"menu-id":"exclude-from-click-outside",items:o.value.map($=>({label:$.label,sublabel:$.sublabel,value:$.id})),"model-value":f.value,"onUpdate:modelValue":S[1]||(S[1]=$=>_($))},null,8,["items","model-value"])):r.createCommentVNode("",!0),r.createElementVNode("div",yy,[r.createElementVNode("div",$y,[r.createElementVNode("div",null,[r.createElementVNode("div",wy,[r.createElementVNode("div",_y,[r.createVNode(ze,{max:k.max,min:k.min,"model-value":c.value,picker:"month","onUpdate:modelValue":S[2]||(S[2]=$=>b($))},null,8,["max","min","model-value"]),r.createVNode(ze,{max:k.max,min:k.min,"model-value":c.value,picker:"year","onUpdate:modelValue":S[3]||(S[3]=$=>b($))},null,8,["max","min","model-value"])]),r.createElementVNode("div",ky,[r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_left",size:"md",class:"cursor-pointer select-none",onClick:S[4]||(S[4]=()=>b(c.value.subtract(1,"month")))}),r.createVNode(H,{outline:!1,color:"#1C1C1E",name:"chevron_right",class:"cursor-pointer select-none",size:"md",onClick:S[5]||(S[5]=()=>b(c.value.add(1,"month")))})])]),r.createVNode(un,{days:r.unref(cn)(c.value),"on-day-click":$=>m($.date),"day-cell-class":y,"cell-size":"lg",onCellMouseOver:C},null,8,["days","on-day-click"])])])]),r.createElementVNode("div",Cy,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:g}),r.createVNode(U,{disabled:N.value,label:"Apply",size:"md",variant:"primary",onClick:p},null,8,["disabled"])])])]),_:2},1032,["disabled","show-popover","z-index"])]),_:2},[k.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(k.$slots,"helper-text")]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","rules"]))}}),xy=r.defineComponent({__name:"FmSimpleDateRangePicker",props:{modelValue:{},compareTarget:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:void 0},showValidBorder:{type:Boolean,default:!1},showPredefinedRange:{type:Boolean,default:!1},predefinedRange:{default:()=>[{label:"Today",value:{startDate:D().format(I),endDate:D().format(I)}},{label:"Yesterday",value:{startDate:D().subtract(1,"day").format(I),endDate:D().subtract(1,"day").format(I)}},{label:"This week",value:{startDate:D().startOf("week").format(I),endDate:D().endOf("week").format(I)}},{label:"Last week",value:{startDate:D().subtract(1,"week").startOf("week").format(I),endDate:D().subtract(1,"week").endOf("week").format(I)}},{label:"Last 7 days",value:{startDate:D().subtract(7,"day").format(I),endDate:D().subtract(1,"day").format(I)}},{label:"This month",value:{startDate:D().startOf("month").format(I),endDate:D().endOf("month").format(I)}},{label:"Last month",value:{startDate:D().subtract(1,"month").startOf("month").format(I),endDate:D().subtract(1,"month").endOf("month").format(I)}},{label:"This year",value:{startDate:D().startOf("year").format(I),endDate:D().endOf("year").format(I)}}]},defaultCompareType:{},min:{default:()=>D().subtract(50,"year").format(I)},max:{default:()=>D().add(25,"year").format(I)},zIndex:{},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","select-comparison"],setup(t,{emit:e}){const n=t,{breakpoints:o}=yt(),i=q(n,"modelValue"),s=e,l=Jo(n);return(a,d)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(o).md||r.unref(o).lg?(r.openBlock(),r.createBlock(dy,r.mergeProps({key:0},r.unref(l),{modelValue:r.unref(i),"onUpdate:modelValue":d[0]||(d[0]=c=>r.isRef(i)?i.value=c:null),onSelectComparison:d[1]||(d[1]=c=>s("select-comparison",c))}),r.createSlots({_:2},[a.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(c=>[r.renderSlot(a.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(c)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0),r.unref(o).xs||r.unref(o).sm?(r.openBlock(),r.createBlock(jd,r.mergeProps({key:1},r.unref(l),{modelValue:r.unref(i),"onUpdate:modelValue":d[2]||(d[2]=c=>r.isRef(i)?i.value=c:null),onSelectComparison:d[3]||(d[3]=c=>s("select-comparison",c))}),r.createSlots({_:2},[a.$slots["trigger-button"]?{name:"trigger-button",fn:r.withCtx(c=>[r.renderSlot(a.$slots,"trigger-button",r.normalizeProps(r.guardReactiveProps(c)))]),key:"0"}:void 0]),1040,["modelValue"])):r.createCommentVNode("",!0)],64))}}),Sy=r.defineComponent({__name:"FmForm",props:{disabled:{type:Boolean,default:!1},onValidationSuccess:{},onValidationFailed:{}},emits:["validation-reset","reset"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref([]),s=r.ref(0),l=r.ref(!1),a=n,d=async()=>{var h,m;l.value=!0;let f=[];for(let p=0;p<i.value.length;p++){const g=i.value[p];f=[...f,...g.validate()]}f.length?await((m=o.onValidationFailed)==null?void 0:m.call(o,f)):await((h=o.onValidationSuccess)==null?void 0:h.call(o)),l.value=!1},c=()=>{for(let f=0;f<i.value.length;f++)i.value[f].resetValue();a("reset")};return e({validateInputs:d,resetInputsValidation:()=>{for(let f=0;f<i.value.length;f++)i.value[f].resetValidation();a("validation-reset")},resetInputs:c,isSubmitting:l}),r.provide(Rs,{register({validate:f,resetValidation:h,resetValue:m}){return i.value.push({componentId:s.value,validate:f,resetValidation:h,resetValue:m}),s.value++},unregister(f){i.value.filter(h=>h.componentId!==f)}}),r.provide(ye,{getDisabled:()=>o.disabled}),(f,h)=>(r.openBlock(),r.createElementBlock("form",{onSubmit:r.withModifiers(d,["prevent"]),onReset:r.withModifiers(c,["prevent"])},[r.renderSlot(f.$slots,"default")],32))}}),vy={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:1[3-79]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:22|44|7[27]|87|9[69])[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-689]|8[1-69]|9[1-578])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","2[0-24-9]\\d{8}|[78]\\d{10,13}|[7-9]\\d{9}|[1-9]\\d{7}|[124-7]\\d{6}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:0[0-689]|[1-79])|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:5056(?:[0-35-9]\\d|4[468])|7302[0-4]\\d)\\d{4}|(?:472[24]|505[2-57-9]|7306|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:20|33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Wd(t,e){var n=Array.prototype.slice.call(e);return n.push(vy),t.apply(this,n)}function Oi(t){"@babel/helpers - typeof";return Oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oi(t)}function Ud(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Dy(t,e,n){return e&&Ud(t.prototype,e),n&&Ud(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function My(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eo(t,e)}function By(t){var e=qd();return function(){var o=to(t),i;if(e){var s=to(this).constructor;i=Reflect.construct(o,arguments,s)}else i=o.apply(this,arguments);return Ey(this,i)}}function Ey(t,e){if(e&&(Oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gd(t)}function Gd(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ii(t){var e=typeof Map=="function"?new Map:void 0;return Ii=function(o){if(o===null||!Py(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(o))return e.get(o);e.set(o,i)}function i(){return Qo(o,arguments,to(this).constructor)}return i.prototype=Object.create(o.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),eo(i,o)},Ii(t)}function Qo(t,e,n){return qd()?Qo=Reflect.construct:Qo=function(i,s,l){var a=[null];a.push.apply(a,s);var d=Function.bind.apply(i,a),c=new d;return l&&eo(c,l.prototype),c},Qo.apply(null,arguments)}function qd(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Py(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function eo(t,e){return eo=Object.setPrototypeOf||function(o,i){return o.__proto__=i,o},eo(t,e)}function to(t){return to=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},to(t)}var ft=function(t){Vy(n,t);var e=By(n);function n(o){var i;return My(this,n),i=e.call(this,o),Object.setPrototypeOf(Gd(i),n.prototype),i.name=i.constructor.name,i}return Dy(n)}(Ii(Error)),Ti=2,Ny=17,Fy=3,je="0-90-9٠-٩۰-۹",Ry="-‐-―−ー-",Ay="//",Oy="..",Iy="  ­​⁠ ",Ty="()()[]\\[\\]",zy="~⁓∼~",er="".concat(Ry).concat(Ay).concat(Oy).concat(Iy).concat(Ty).concat(zy),zi="++";function Xd(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),o=e[0].split("."),i=0;i<3;i++){var s=Number(n[i]),l=Number(o[i]);if(s>l)return 1;if(l>s)return-1;if(!isNaN(s)&&isNaN(l))return 1;if(isNaN(s)&&!isNaN(l))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Ly={}.constructor;function tr(t){return t!=null&&t.constructor===Ly}function Li(t){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Li(t)}function nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kd(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function or(t,e,n){return e&&Kd(t.prototype,e),n&&Kd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Hy="1.2.0",Yy="1.7.35",Zd=" ext. ",jy=/^\d+$/,De=function(){function t(e){nr(this,t),qy(e),this.metadata=e,ec.call(this,e)}return or(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var o=this.countryCallingCodes()[n];if(o&&o.length===1&&o[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,o){if(n&&jy.test(n)&&(o=n,n=null),n&&n!=="001"){if(!this.hasCountry(n))throw new Error("Unknown country: ".concat(n));this.numberingPlan=new Jd(this.getCountryMetadata(n),this)}else if(o){if(!this.hasCallingCode(o))throw new Error("Unknown calling code: ".concat(o));this.numberingPlan=new Jd(this.getNumberingPlanMetadata(o),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var o=this.countryCallingCodes()[n];if(o)return o.length===1&&o[0].length===3?void 0:o}},{key:"getCountryCodeForCallingCode",value:function(n){var o=this.getCountryCodesForCallingCode(n);if(o)return o[0]}},{key:"getNumberingPlanMetadata",value:function(n){var o=this.getCountryCodeForCallingCode(n);if(o)return this.getCountryMetadata(o);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var s=this.countryCallingCodes()[n];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}]),t}(),Jd=function(){function t(e,n){nr(this,t),this.globalMetadataObject=n,this.metadata=e,ec.call(this,n.metadata)}return or(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,o=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return o.map(function(i){return new Wy(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(n){if(this.hasTypes()&&Qd(this.types(),n))return new Gy(Qd(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?Zd:this.metadata[13]||Zd}}]),t}(),Wy=function(){function t(e,n){nr(this,t),this._format=e,this.metadata=n}return or(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!Uy.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),t}(),Uy=/^\(?\$1\)?$/,Gy=function(){function t(e,n){nr(this,t),this.type=e,this.metadata=n}return or(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),t}();function Qd(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function qy(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!tr(t)||!tr(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(tr(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+Xy(t)+": "+t,"."))}var Xy=function(e){return Li(e)};function rr(t,e){if(e=new De(e),e.hasCountry(t))return e.country(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function Ky(t,e){return e.countries.hasOwnProperty(t)}function ec(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?Xd(e,Hy)===-1?this.v2=!0:Xd(e,Yy)===-1?this.v3=!0:this.v4=!0:this.v1=!0}var Zy=";ext=",fn=function(e){return"([".concat(je,"]{1,").concat(e,"})")};function tc(t){var e="20",n="15",o="9",i="6",s="[  \\t,]*",l="[:\\..]?[  \\t,-]*",a="#?",d="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",c="(?:[xx##~~]|int|int)",u="[- ]+",f="[  \\t]*",h="(?:,{2}|;)",m=Zy+fn(e),p=s+d+l+fn(e)+a,g=s+c+l+fn(o)+a,b=u+fn(i)+"#",y=f+h+l+fn(n)+a,C=f+"(?:,)+"+l+fn(o)+a;return m+"|"+p+"|"+g+"|"+b+"|"+y+"|"+C}var Jy="["+je+"]{"+Ti+"}",Qy="["+zi+"]{0,1}(?:["+er+"]*["+je+"]){3,}["+er+je+"]*",e$=new RegExp("^["+zi+"]{0,1}(?:["+er+"]*["+je+"]){1,2}$","i"),t$=Qy+"(?:"+tc()+")?",n$=new RegExp("^"+Jy+"$|^"+t$+"$","i");function o$(t){return t.length>=Ti&&n$.test(t)}function r$(t){return e$.test(t)}var nc=new RegExp("(?:"+tc()+")$","i");function i$(t){var e=t.search(nc);if(e<0)return{};for(var n=t.slice(0,e),o=t.match(nc),i=1;i<o.length;){if(o[i])return{number:n,ext:o[i]};i++}}var s$={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function l$(t){return s$[t]}function a$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=d$(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
28
28
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d$(t,e){if(t){if(typeof t=="string")return oc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oc(t,e)}}function oc(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function rc(t){for(var e="",n=a$(t.split("")),o;!(o=n()).done;){var i=o.value;e+=c$(i,e)||""}return e}function c$(t,e,n){if(t==="+"){if(e){typeof n=="function"&&n("end");return}return"+"}return l$(t)}function u$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=f$(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
29
29
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f$(t,e){if(t){if(typeof t=="string")return ic(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ic(t,e)}}function ic(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function h$(t,e){for(var n=t.slice(),o=u$(e),i;!(i=o()).done;){var s=i.value;t.indexOf(s)<0&&n.push(s)}return n.sort(function(l,a){return l-a})}function Hi(t,e){return sc(t,void 0,e)}function sc(t,e,n){var o=n.type(e),i=o&&o.possibleLengths()||n.possibleLengths();if(!i)return"IS_POSSIBLE";if(e==="FIXED_LINE_OR_MOBILE"){if(!n.type("FIXED_LINE"))return sc(t,"MOBILE",n);var s=n.type("MOBILE");s&&(i=h$(i,s.possibleLengths()))}else if(e&&!o)return"INVALID_LENGTH";var l=t.length,a=i[0];return a===l?"IS_POSSIBLE":a>l?"TOO_SHORT":i[i.length-1]<l?"TOO_LONG":i.indexOf(l,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function m$(t,e,n){if(e===void 0&&(e={}),n=new De(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return lc(t.phone||t.nationalNumber,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function lc(t,e){switch(Hi(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function ht(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function p$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=g$(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
30
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g$(t,e){if(t){if(typeof t=="string")return ac(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ac(t,e)}}function ac(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var b$=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Yi(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){n=new De(n),n.selectNumberingPlan(t.country,t.countryCallingCode);var o=e.v2?t.nationalNumber:t.phone;if(ht(o,n.nationalNumberPattern())){if(ji(o,"FIXED_LINE",n))return n.type("MOBILE")&&n.type("MOBILE").pattern()===""||!n.type("MOBILE")||ji(o,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var i=p$(b$),s;!(s=i()).done;){var l=s.value;if(ji(o,l,n))return l}}}}function ji(t,e,n){return e=n.type(e),!e||!e.pattern()||e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0?!1:ht(t,e.pattern())}function y$(t,e,n){if(e=e||{},n=new De(n),n.selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes())return Yi(t,e,n.metadata)!==void 0;var o=e.v2?t.nationalNumber:t.phone;return ht(o,n.nationalNumberPattern())}function $$(t,e,n){var o=new De(n),i=o.getCountryCodesForCallingCode(t);return i?i.filter(function(s){return w$(e,s,n)}):[]}function w$(t,e,n){var o=new De(n);return o.selectNumberingPlan(e),o.numberingPlan.possibleLengths().indexOf(t.length)>=0}function _$(t){return t.replace(new RegExp("[".concat(er,"]+"),"g")," ").trim()}var k$=/(\$\d)/;function C$(t,e,n){var o=n.useInternationalFormat,i=n.withNationalPrefix;n.carrierCode,n.metadata;var s=t.replace(new RegExp(e.pattern()),o?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(k$,e.nationalPrefixFormattingRule()):e.format());return o?_$(s):s}var x$=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function S$(t,e,n){var o=new De(n);if(o.selectNumberingPlan(t,e),o.defaultIDDPrefix())return o.defaultIDDPrefix();if(x$.test(o.IDDPrefix()))return o.IDDPrefix()}function v$(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}function D$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=M$(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
31
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M$(t,e){if(t){if(typeof t=="string")return dc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dc(t,e)}}function dc(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function cc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function uc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cc(Object(n),!0).forEach(function(o){V$(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function V$(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fc={formatExtension:function(e,n,o){return"".concat(e).concat(o.ext()).concat(n)}};function B$(t,e,n,o){if(n?n=uc(uc({},fc),n):n=fc,o=new De(o),t.country&&t.country!=="001"){if(!o.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));o.country(t.country)}else if(t.countryCallingCode)o.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var i=o.countryCallingCode(),s=n.v2?t.nationalNumber:t.phone,l;switch(e){case"NATIONAL":return s?(l=ir(s,t.carrierCode,"NATIONAL",o,n),Wi(l,t.ext,o,n.formatExtension)):"";case"INTERNATIONAL":return s?(l=ir(s,null,"INTERNATIONAL",o,n),l="+".concat(i," ").concat(l),Wi(l,t.ext,o,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(s);case"RFC3966":return v$({number:"+".concat(i).concat(s),ext:t.ext});case"IDD":if(!n.fromCountry)return;var a=P$(s,t.carrierCode,i,n.fromCountry,o);return Wi(a,t.ext,o,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function ir(t,e,n,o,i){var s=E$(o.formats(),t);return s?C$(t,s,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:e,metadata:o}):t}function E$(t,e){for(var n=D$(t),o;!(o=n()).done;){var i=o.value;if(i.leadingDigitsPatterns().length>0){var s=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(s)!==0)continue}if(ht(e,i.pattern()))return i}}function Wi(t,e,n,o){return e?o(t,e,n):t}function P$(t,e,n,o,i){var s=rr(o,i.metadata);if(s===n){var l=ir(t,e,"NATIONAL",i);return n==="1"?n+" "+l:l}var a=S$(o,void 0,i.metadata);if(a)return"".concat(a," ").concat(n," ").concat(ir(t,null,"INTERNATIONAL",i))}function hc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function mc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hc(Object(n),!0).forEach(function(o){N$(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function N$(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pc(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function R$(t,e,n){return e&&pc(t.prototype,e),n&&pc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var A$=function(){function t(e,n,o){if(F$(this,t),!e)throw new TypeError("`country` or `countryCallingCode` not passed");if(!n)throw new TypeError("`nationalNumber` not passed");if(!o)throw new TypeError("`metadata` not passed");var i=I$(e,o),s=i.country,l=i.countryCallingCode;this.country=s,this.countryCallingCode=l,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return o}}return R$(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:$$(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return m$(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return y$(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new De(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return Yi(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,o){return B$(this,n,o?mc(mc({},o),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}]),t}(),O$=function(e){return/^[A-Z]{2}$/.test(e)};function I$(t,e){var n,o,i=new De(e);return O$(t)?(n=t,i.selectNumberingPlan(n),o=i.countryCallingCode()):o=t,{country:n,countryCallingCode:o}}var T$=new RegExp("(["+je+"])");function z$(t,e,n,o){if(e){var i=new De(o);i.selectNumberingPlan(e,n);var s=new RegExp(i.IDDPrefix());if(t.search(s)===0){t=t.slice(t.match(s)[0].length);var l=t.match(T$);if(!(l&&l[1]!=null&&l[1].length>0&&l[1]==="0"))return t}}}function L$(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),o=n.exec(t);if(o){var i,s,l=o.length-1,a=l>0&&o[l];if(e.nationalPrefixTransformRule()&&a)i=t.replace(n,e.nationalPrefixTransformRule()),l>1&&(s=o[1]);else{var d=o[0];i=t.slice(d.length),a&&(s=o[1])}var c;if(a){var u=t.indexOf(o[1]),f=t.slice(0,u);f===e.numberingPlan.nationalPrefix()&&(c=e.numberingPlan.nationalPrefix())}else c=o[0];return{nationalNumber:i,nationalPrefix:c,carrierCode:s}}}return{nationalNumber:t}}function Ui(t,e){var n=L$(t,e),o=n.carrierCode,i=n.nationalNumber;if(i!==t){if(!H$(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!Y$(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:o}}function H$(t,e,n){return!(ht(t,n.nationalNumberPattern())&&!ht(e,n.nationalNumberPattern()))}function Y$(t,e){switch(Hi(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function j$(t,e,n,o){var i=e?rr(e,o):n;if(t.indexOf(i)===0){o=new De(o),o.selectNumberingPlan(e,n);var s=t.slice(i.length),l=Ui(s,o),a=l.nationalNumber,d=Ui(t,o),c=d.nationalNumber;if(!ht(c,o.nationalNumberPattern())&&ht(a,o.nationalNumberPattern())||Hi(c,o)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:t}}function W$(t,e,n,o){if(!t)return{};var i;if(t[0]!=="+"){var s=z$(t,e,n,o);if(s&&s!==t)i=!0,t="+"+s;else{if(e||n){var l=j$(t,e,n,o),a=l.countryCallingCode,d=l.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:d}}return{number:t}}}if(t[1]==="0")return{};o=new De(o);for(var c=2;c-1<=Fy&&c<=t.length;){var u=t.slice(1,c);if(o.hasCallingCode(u))return o.selectNumberingPlan(u),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(c)};c++}return{}}function U$(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=G$(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
32
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G$(t,e){if(t){if(typeof t=="string")return gc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gc(t,e)}}function gc(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function q$(t,e){var n=e.countries,o=e.defaultCountry,i=e.metadata;i=new De(i);for(var s=[],l=U$(n),a;!(a=l()).done;){var d=a.value;if(i.country(d),i.leadingDigits()){if(t&&t.search(i.leadingDigits())===0)return d}else if(Yi({phone:t,country:d},void 0,i.metadata))if(o){if(d===o)return d;s.push(d)}else return d}if(s.length>0)return s[0]}var X$=!1;function K$(t,e){var n=e.nationalNumber,o=e.defaultCountry,i=e.metadata;if(X$&&i.isNonGeographicCallingCode(t))return"001";var s=i.getCountryCodesForCallingCode(t);if(s)return s.length===1?s[0]:q$(n,{countries:s,defaultCountry:o,metadata:i.metadata})}var bc="+",Z$="[\\-\\.\\(\\)]?",yc="(["+je+"]|"+Z$+")",J$="^\\"+bc+yc+"*["+je+"]"+yc+"*$",Q$=new RegExp(J$,"g"),Gi=je,e3="["+Gi+"]+((\\-)*["+Gi+"])*",t3="a-zA-Z",n3="["+t3+"]+((\\-)*["+Gi+"])*",o3="^("+e3+"\\.)*"+n3+"\\.?$",r3=new RegExp(o3,"g"),$c="tel:",qi=";phone-context=",i3=";isub=";function s3(t){var e=t.indexOf(qi);if(e<0)return null;var n=e+qi.length;if(n>=t.length)return"";var o=t.indexOf(";",n);return o>=0?t.substring(n,o):t.substring(n)}function l3(t){return t===null?!0:t.length===0?!1:Q$.test(t)||r3.test(t)}function a3(t,e){var n=e.extractFormattedPhoneNumber,o=s3(t);if(!l3(o))throw new ft("NOT_A_NUMBER");var i;if(o===null)i=n(t)||"";else{i="",o.charAt(0)===bc&&(i+=o);var s=t.indexOf($c),l;s>=0?l=s+$c.length:l=0;var a=t.indexOf(qi);i+=t.substring(l,a)}var d=i.indexOf(i3);if(d>0&&(i=i.substring(0,d)),i!=="")return i}var d3=250,c3=new RegExp("["+zi+je+"]"),u3=new RegExp("[^"+je+"#]+$");function f3(t,e,n){if(e=e||{},n=new De(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry))throw e.v2?new ft("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var o=m3(t,e.v2,e.extract),i=o.number,s=o.ext,l=o.error;if(!i){if(e.v2)throw l==="TOO_SHORT"?new ft("TOO_SHORT"):new ft("NOT_A_NUMBER");return{}}var a=g3(i,e.defaultCountry,e.defaultCallingCode,n),d=a.country,c=a.nationalNumber,u=a.countryCallingCode,f=a.countryCallingCodeSource,h=a.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new ft("INVALID_COUNTRY");return{}}if(!c||c.length<Ti){if(e.v2)throw new ft("TOO_SHORT");return{}}if(c.length>Ny){if(e.v2)throw new ft("TOO_LONG");return{}}if(e.v2){var m=new A$(u,c,n.metadata);return d&&(m.country=d),h&&(m.carrierCode=h),s&&(m.ext=s),m.__countryCallingCodeSource=f,m}var p=(e.extended?n.hasSelectedNumberingPlan():d)?ht(c,n.nationalNumberPattern()):!1;return e.extended?{country:d,countryCallingCode:u,carrierCode:h,valid:p,possible:p?!0:!!(e.extended===!0&&n.possibleLengths()&&lc(c,n)),phone:c,ext:s}:p?p3(d,c,s):{}}function h3(t,e,n){if(t){if(t.length>d3){if(n)throw new ft("TOO_LONG");return}if(e===!1)return t;var o=t.search(c3);if(!(o<0))return t.slice(o).replace(u3,"")}}function m3(t,e,n){var o=a3(t,{extractFormattedPhoneNumber:function(l){return h3(l,n,e)}});if(!o)return{};if(!o$(o))return r$(o)?{error:"TOO_SHORT"}:{};var i=i$(o);return i.ext?i:{number:o}}function p3(t,e,n){var o={country:t,phone:e};return n&&(o.ext=n),o}function g3(t,e,n,o){var i=W$(rc(t),e,n,o.metadata),s=i.countryCallingCodeSource,l=i.countryCallingCode,a=i.number,d;if(l)o.selectNumberingPlan(l);else if(a&&(e||n))o.selectNumberingPlan(e,n),e&&(d=e),l=n||rr(e,o.metadata);else return{};if(!a)return{countryCallingCodeSource:s,countryCallingCode:l};var c=Ui(rc(a),o),u=c.nationalNumber,f=c.carrierCode,h=K$(l,{nationalNumber:u,defaultCountry:e,metadata:o});return h&&(d=h,h==="001"||o.country(d)),{country:d,countryCallingCode:l,countryCallingCodeSource:s,nationalNumber:u,carrierCode:f}}function wc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function _c(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wc(Object(n),!0).forEach(function(o){b3(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function b3(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y3(t,e,n){return f3(t,_c(_c({},e),{},{v2:!0}),n)}function kc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function $3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kc(Object(n),!0).forEach(function(o){w3(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function w3(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _3(t,e){return S3(t)||x3(t,e)||C3(t,e)||k3()}function k3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C3(t,e){if(t){if(typeof t=="string")return Cc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cc(t,e)}}function Cc(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function x3(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o=[],i=!0,s=!1,l,a;try{for(n=n.call(t);!(i=(l=n.next()).done)&&(o.push(l.value),!(e&&o.length===e));i=!0);}catch(d){s=!0,a=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return o}}function S3(t){if(Array.isArray(t))return t}function v3(t){var e=Array.prototype.slice.call(t),n=_3(e,4),o=n[0],i=n[1],s=n[2],l=n[3],a,d,c;if(typeof o=="string")a=o;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")l?(d=s,c=l):(d=void 0,c=s),i&&(d=$3({defaultCountry:i},d));else if(tr(i))s?(d=i,c=s):c=i;else throw new Error("Invalid second argument: ".concat(i));return{text:a,options:d,metadata:c}}function xc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function Sc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xc(Object(n),!0).forEach(function(o){D3(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function D3(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M3(t,e,n){e&&e.defaultCountry&&!Ky(e.defaultCountry,n)&&(e=Sc(Sc({},e),{},{defaultCountry:void 0}));try{return y3(t,e,n)}catch(o){if(!(o instanceof ft))throw o}}function V3(){var t=v3(arguments),e=t.text,n=t.options,o=t.metadata;return M3(e,n,o)}function Xi(){return Wd(V3,arguments)}function B3(){return Wd(rr,arguments)}const E3=["disabled","inputMode","maxlength","minlength","placeholder","readOnly","type","value"],Ki=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:""},showValidBorder:{type:Boolean,default:!1},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},invalid:{type:Boolean},modelValue:{},label:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","focus-changed"],setup(t,{expose:e,emit:n}){const o=t,i=r.inject(ye),s=r.computed(()=>o.disabled??(i==null?void 0:i.getDisabled())??!1),l=n,a=r.ref(null),d=q(o,"modelValue"),{isFocused:c,focus:u,blur:f}=bn(),h=m=>{d.value=m.target.value};return e({focus:u}),(m,p)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(d),"onUpdate:modelValue":p[2]||(p[2]=g=>r.isRef(d)?d.value=g:null),disabled:s.value,focused:r.unref(c),"helper-state":m.helperState,"helper-text":m.helperText,info:m.labelInfo,label:m.label,optional:m.labelMark==="optional",required:m.labelMark==="required",rules:m.rules},r.createSlots({default:r.withCtx(({invalid:g})=>[r.createVNode(le,{"append-icon":m.appendIcon,focused:r.unref(c),invalid:m.invalid||g,"prepend-icon":m.prependIcon,"show-valid-border":m.showValidBorder,class:"cursor-text"},{prepend:r.withCtx(()=>[r.renderSlot(m.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(m.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:a,class:r.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!s.value,"text-fm-color-typo-disabled":s.value}),disabled:s.value,inputMode:m.inputmode,maxlength:m.maxLength,minlength:m.minLength,placeholder:m.placeholder,readOnly:m.readonly,type:m.inputmode,value:r.unref(d),onBlur:p[0]||(p[0]=()=>{r.unref(f)(),l("focus-changed",!1)}),onFocus:p[1]||(p[1]=()=>{r.unref(u)(),l("focus-changed",!0)}),onInput:h},null,42,E3)]),_:2},1032,["append-icon","focused","invalid","prepend-icon","show-valid-border"])]),_:2},[m.label||m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label")]),key:"0"}:void 0,m.helperText||m.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"helper-text")]),key:"1"}:void 0,m.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([s.value?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(m.maxLength?`${r.unref(d).length} / ${m.maxLength}`:""),3)]),key:"2"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),P3="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-my'%20viewBox='0%200%20640%20480'%3e%3cg%20clip-path='url(%23my-a)'%3e%3cpath%20fill='%23C00'%20d='M0%200h640v480H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%200h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%2034.3h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%2068.6h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20102.9h640V137H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20137.1h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20171.4h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20205.7h640V240H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20240h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20274.3h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20308.6h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20342.9h640V377H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20377.1h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20411.4h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20445.7h640V480H0z'/%3e%3cpath%20fill='%23006'%20d='M0%20.5h320v274.3H0z'/%3e%3cpath%20fill='%23FC0'%20d='m207.5%2073.8%206%2040.7%2023-34-12.4%2039.2%2035.5-20.8-28.1%2030%2041-3.2-38.3%2014.8%2038.3%2014.8-41-3.2%2028.1%2030-35.5-20.8%2012.3%2039.3-23-34.1-6%2040.7-5.9-40.7-23%2034%2012.4-39.2-35.5%2020.8%2028-30-41%203.2%2038.4-14.8-38.3-14.8%2041%203.2-28.1-30%2035.5%2020.8-12.4-39.3%2023%2034.1zm-33.3%201.7a71.1%2071.1%200%200%200-100%2065%2071.1%2071.1%200%200%200%20100%2065%2080%2080%200%200%201-83.2%206.2%2080%2080%200%200%201-43.4-71.2%2080%2080%200%200%201%20126.6-65'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='my-a'%3e%3cpath%20fill='%23fff'%20d='M0%200h640v480H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",N3="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-sg'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cclipPath%20id='sg-a'%3e%3cpath%20fill-opacity='.7'%20d='M0%200h640v480H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20fill-rule='evenodd'%20clip-path='url(%23sg-a)'%3e%3cpath%20fill='%23fff'%20d='M-20%200h720v480H-20z'/%3e%3cpath%20fill='%23df0000'%20d='M-20%200h720v240H-20z'/%3e%3cpath%20fill='%23fff'%20d='M146%2040.2a84.4%2084.4%200%200%200%20.8%20165.2%2086%2086%200%200%201-106.6-59%2086%2086%200%200%201%2059-106c16-4.6%2030.8-4.7%2046.9-.2z'/%3e%3cpath%20fill='%23fff'%20d='m133%20110%204.9%2015-13-9.2-12.8%209.4%204.7-15.2-12.8-9.3%2015.9-.2%205-15%205%2015h15.8zm17.5%2052%205%2015.1-13-9.2-12.9%209.3%204.8-15.1-12.8-9.4%2015.9-.1%204.9-15.1%205%2015h16zm58.5-.4%204.9%2015.2-13-9.3-12.8%209.3%204.7-15.1-12.8-9.3%2015.9-.2%205-15%205%2015h15.8zm17.4-51.6%204.9%2015.1-13-9.2-12.8%209.3%204.8-15.1-12.9-9.4%2016-.1%204.8-15.1%205%2015h16zm-46.3-34.3%205%2015.2-13-9.3-12.9%209.4%204.8-15.2-12.8-9.4%2015.8-.1%205-15.1%205%2015h16z'/%3e%3c/g%3e%3c/svg%3e",F3={class:"flex gap-4"},R3=["alt","src"],A3=["alt","src"],O3=r.defineComponent({__name:"FmPhoneNumber",props:{modelValue:{},defaultCountry:{default:"MY"},placeholder:{default:""},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=r.inject(ye),i=e,s=q(n,"modelValue"),l=r.computed(()=>n.disabled??(o==null?void 0:o.getDisabled())??!1),a=["MY","SG"],d=a.reduce((k,M)=>(k[M]=`+${B3(M)}`,k),{}),c=a.map(k=>({label:"",value:k}));function u(k){var M;return k?((M=Object.entries(d).find(([,w])=>k.startsWith(w)))==null?void 0:M[0])??null:n.defaultCountry}const f=r.computed(()=>u(n.modelValue)),h=r.computed(()=>!f.value||!n.modelValue?d[n.defaultCountry]:n.modelValue),m=r.computed({get(){const k=Xi(h.value);return k?k.formatInternational().replace(d[f.value],"").trim():h.value.replace(d[f.value],"").trim()},set(k){const M=`${d[f.value]}${k}`,w=Xi(M);if(!w){s.value=M;return}s.value=w.formatInternational()}}),p=r.computed({get(){return f.value??n.defaultCountry},set(k){if(!f.value){i("update:modelValue",d[n.defaultCountry]);return}const w=d[f.value],_=d[k];s.value=h.value.replace(w,_)}}),g=r.ref({dropdown:!1,textField:!1});function b(k){const M=f.value;if(!k.replace(d[M],"").trim().length)return!0;const _=Xi(s.value,M);return!_||!_.isValid()?"Invalid phone number":!0}const y={MY:P3,SG:N3};return(k,M)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(s),"onUpdate:modelValue":M[4]||(M[4]=w=>r.isRef(s)?s.value=w:null),disabled:l.value,focused:g.value.dropdown||g.value.textField,"helper-state":k.helperState,"helper-text":k.helperText,info:k.labelInfo,label:k.label,optional:k.labelMark==="optional",required:k.labelMark==="required",rules:[...k.rules,b],class:"flex gap-4"},r.createSlots({default:r.withCtx(({invalid:w})=>[r.createElementVNode("div",F3,[r.createVNode(dn,{"model-value":p.value,"onUpdate:modelValue":M[0]||(M[0]=_=>p.value=_),disabled:l.value,items:r.unref(c),onDropdownChanged:M[1]||(M[1]=_=>g.value.dropdown=_)},{default:r.withCtx(()=>[r.createElementVNode("img",{alt:p.value,src:y[p.value],class:"h-auto w-[20px]"},null,8,R3)]),"menu-wrapper":r.withCtx(({handleItemChange:_})=>[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(a,F=>r.createVNode(we,{key:F,"model-value":p.value===F,"onUpdate:modelValue":$=>_($,r.unref(c).find(S=>S.value===F))},{label:r.withCtx(()=>[r.createElementVNode("img",{alt:F,src:y[F],class:"h-auto w-[20px]"},null,8,A3)]),_:2},1032,["model-value","onUpdate:modelValue"])),64))]),_:1},8,["model-value","disabled","items"]),r.createVNode(Ki,{"model-value":m.value,"onUpdate:modelValue":M[2]||(M[2]=_=>m.value=_),disabled:l.value,invalid:w,class:"flex-1",inputmode:"tel",onFocusChanged:M[3]||(M[3]=_=>g.value.textField=_)},{prepend:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass([l.value?"text-fm-color-typo-disabled":""])},"("+r.toDisplayString(r.unref(d)[f.value])+")",3)]),_:2},1032,["model-value","disabled","invalid"])])]),_:2},[k.label||k.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(k.$slots,"label")]),key:"0"}:void 0,k.helperText||k.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(k.$slots,"helper-text")]),key:"1"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),I3={class:"flex gap-8 items-center"},T3=["onInput","onKeydown"],z3=J(r.defineComponent({__name:"FmPinField",props:{modelValue:{default:()=>[]},length:{default:6},type:{default:"number"}},emits:["update:modelValue","complete"],setup(t,{emit:e}){const n=e,o=t,i=q(o,"modelValue"),s=r.ref([]),l=(f,h)=>{const m=f.target;if(o.type==="number"&&!/^[0-9]$/g.test(m.value)){m.value="";return}m.value=m.value.slice(-1),c(m.value,h),s.value[h+1]?s.value[h+1].focus():s.value[h].blur()},a=(f,h)=>{f.preventDefault();const m=f.target;m.value="",c(null,h),s.value[h-1]?s.value[h-1].focus():s.value[h].focus()},d=(f,h)=>{f.preventDefault(),f.key==="ArrowLeft"&&(s.value[h-1]?s.value[h-1].focus():s.value[h].focus()),f.key==="ArrowRight"&&(s.value[h+1]?s.value[h+1].focus():s.value[h].focus())},c=(f,h)=>{i.value=i.value.toSpliced(h,1,f)},u=(f,h)=>{s.value[h]=f};return r.onMounted(()=>{i.value=Array.from(Array(o.length).fill(null))}),r.watch(()=>i.value,()=>{i.value.every(f=>f!==null)&&n("complete",i.value.join(""))}),(f,h)=>(r.openBlock(),r.createElementBlock("div",I3,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.length,(m,p)=>(r.openBlock(),r.createElementBlock("input",{key:m,ref_for:!0,ref:g=>u(g,p),class:r.normalizeClass(["fm-pin-field",{"fm-pin-field--populated":r.unref(i)[p]!==null}]),type:"text",onInput:g=>l(g,p),onKeydown:[r.withKeys(g=>a(g,p),["backspace"]),r.withKeys(g=>d(g,p),["arrow-left","arrow-right"])]},null,42,T3))),128))]))}}),[["__scopeId","data-v-45a53bf7"]]),L3={class:"fm-radio-btn"},H3={class:"fm-radio-btn__input--container"},Y3=["checked","disabled","value"],j3={class:"py-8"},W3={class:"fm-typo-body-lg-400"},U3={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},G3=J(r.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=q(e,"modelValue"),o=r.ref(),i=r.inject(As,null),s=r.inject(ye),l=()=>{a.value||(i?i.updateValue(e.value):n.value=e.value)},a=r.computed(()=>e.disabled??(i==null?void 0:i.getDisabled())??(s==null?void 0:s.getDisabled())??!1),d=r.computed(()=>i?e.value===i.groupValue.value:n.value===e.value);return(c,u)=>{const f=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",L3,[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:l},[r.withDirectives((r.openBlock(),r.createElementBlock("div",H3,[r.createElementVNode("input",{ref_key:"inputEl",ref:o,checked:d.value,disabled:a.value,value:c.value,class:"fm-radio-btn__input--btn",type:"radio"},null,8,Y3)])),[[f,!a.value]]),r.createElementVNode("div",j3,[r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",W3,r.toDisplayString(c.label),1),c.sublabel?(r.openBlock(),r.createElementBlock("div",U3,r.toDisplayString(c.sublabel),1)):r.createCommentVNode("",!0)],!0)])],2)])}}}),[["__scopeId","data-v-5d4cbf27"]]),q3=r.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},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=q(e,"modelValue"),o=r.inject(ye);r.provide(As,{groupValue:n,getDisabled:()=>i.value,updateValue(s){n.value=s}});const i=r.computed(()=>e.disabled??(o==null?void 0:o.getDisabled())??!1);return(s,l)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(n)?n.value=a:null),disabled:i.value,"helper-state":s.helperState,"helper-text":s.helperText,info:s.labelInfo,label:s.label,optional:s.labelMark==="optional",required:s.labelMark==="required",rules:s.rules},{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","disabled","helper-state","helper-text","info","label","optional","required","rules"]))}}),Zi=r.defineComponent({__name:"FmSearch",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!1},maxWidth:{default:void 0},modelValue:{},label:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>{const{modelValue:h,disabled:m,...p}=e;return p}),i=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),s=q(e,"modelValue"),l=r.ref(!1),a=r.ref(),d=r.ref(e.collapsible),c=r.ref(e.collapsible);function u(){d.value=!1,r.nextTick(()=>{var h,m,p,g;(g=(p=(m=(h=a.value)==null?void 0:h.querySelector)==null?void 0:m.call(h,"input"))==null?void 0:p.focus)==null||g.call(p)})}function f(h){if(l.value=h,!!e.collapsible){if(h){c.value=!1;return}d.value=s.value.length===0,d.value&&setTimeout(()=>{c.value=!0},250)}}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"componentRoot",ref:a,class:"flex items-center justify-end min-w-48 relative"},[r.createVNode(Ki,r.mergeProps({modelValue:r.unref(s),"onUpdate:modelValue":m[1]||(m[1]=p=>r.isRef(s)?s.value=p:null),class:["transition-all",{"opacity-100":!h.collapsible||!d.value,"opacity-0 pointer-events-none":h.collapsible&&d.value}],disabled:i.value||h.collapsible&&d.value,style:{width:h.collapsible&&d.value?"24px":"100%"}},o.value,{onFocusChanged:f}),r.createSlots({_:2},[l.value?void 0:{name:"prepend",fn:r.withCtx(()=>[r.createVNode(H,{name:"search"})]),key:"0"},r.unref(s).length?{name:"append",fn:r.withCtx(()=>[r.createVNode(H,{class:"cursor-pointer text-fm-color-neutral-gray-300",name:"close",onClick:m[0]||(m[0]=p=>s.value="")})]),key:"1"}:void 0]),1040,["modelValue","class","disabled","style"]),h.collapsible?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["absolute top-0 right-0",d.value?"opacity-100":"opacity-0 pointer-events-none"]),style:r.normalizeStyle({transition:"opacity 150ms",transitionTimingFunction:d.value?"cubic-bezier(.95,-0.01,.82,.6)":"ease-out"})},[r.createVNode(U,{icon:"search",variant:"tertiary",onClick:u})],6)):r.createCommentVNode("",!0)],512))}}),X3={key:0,class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},K3={key:0},Z3={class:"overflow-y-auto"},J3={key:1,class:"flex gap-8 items-center"},vc=J(r.defineComponent({__name:"FmTopSheet",props:{header:{default:""},modelValue:{type:Boolean,default:!1},dismissAway:{type:Boolean,default:!1},fullscreenSize:{default:void 0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=q(e,"modelValue");return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{onClick:i[0]||(i[0]=s=>n.value=!0)},[r.renderSlot(o.$slots,"top-sheet-button",{},void 0,!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.unref(n)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":e.dismissAway,"z-index":e.zIndex,onClose:i[1]||(i[1]=s=>n.value=!1)},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:o.fullscreenSize?`slide-${o.fullscreenSize}`:"slide",appear:""},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-top-sheet",`fm-top-sheet--fullscreen-${o.fullscreenSize}`])},[o.header||o.$slots["top-sheet-header"]?(r.openBlock(),r.createElementBlock("div",X3,[r.renderSlot(o.$slots,"top-sheet-header",{},()=>[o.header?(r.openBlock(),r.createElementBlock("div",K3,r.toDisplayString(o.header),1)):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Z3,[r.renderSlot(o.$slots,"default",{},void 0,!0)]),o.$slots["top-sheet-footer"]?(r.openBlock(),r.createElementBlock("div",J3,[r.renderSlot(o.$slots,"top-sheet-footer",{},void 0,!0)])):r.createCommentVNode("",!0)],2)]),_:3},8,["name"])]),_:3},8,["dismiss-away","z-index"])):r.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-e0521072"]]);var Ji={exports:{}};function Dc(t,e=100,n={}){if(typeof t!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:o}=typeof n=="boolean"?{immediate:n}:n;let i,s,l,a,d;function c(){const f=Date.now()-a;if(f<e&&f>=0)l=setTimeout(c,e-f);else if(l=void 0,!o){const h=i,m=s;i=void 0,s=void 0,d=t.apply(h,m)}}const u=function(...f){if(i&&this!==i)throw new Error("Debounced method called with different contexts.");i=this,s=f,a=Date.now();const h=o&&!l;if(l||(l=setTimeout(c,e)),h){const m=i,p=s;i=void 0,s=void 0,d=t.apply(m,p)}return d};return u.clear=()=>{l&&(clearTimeout(l),l=void 0)},u.flush=()=>{if(!l)return;const f=i,h=s;i=void 0,s=void 0,d=t.apply(f,h),clearTimeout(l),l=void 0},u}Ji.exports.debounce=Dc,Ji.exports=Dc;var Q3=Ji.exports;const Qi=xi(Q3);var Mc={exports:{}};(function(t,e){(function(){var n={};t.exports=n,n.simpleFilter=function(o,i){return i.filter(function(s){return n.test(o,s)})},n.test=function(o,i){return n.match(o,i)!==null},n.match=function(o,i,s){s=s||{};var l=0,a=[],d=i.length,c=0,u=0,f=s.pre||"",h=s.post||"",m=s.caseSensitive&&i||i.toLowerCase(),p;o=s.caseSensitive&&o||o.toLowerCase();for(var g=0;g<d;g++)p=i[g],m[g]===o[l]?(p=f+p+h,l+=1,u+=1+u):u=0,c+=u,a[a.length]=p;return l===o.length?(c=m===o?1/0:c,{rendered:a.join(""),score:c}):null},n.filter=function(o,i,s){return!i||i.length===0?[]:typeof o!="string"?i:(s=s||{},i.reduce(function(l,a,d,c){var u=a;s.extract&&(u=s.extract(a));var f=n.match(o,u,s);return f!=null&&(l[l.length]={string:f.rendered,score:f.score,index:d,original:a}),l},[]).sort(function(l,a){var d=a.score-l.score;return d||l.index-a.index}))}})()})(Mc);var e4=Mc.exports;const t4=xi(e4);function sr(t,e){const[n]=t4.filter(t.toLocaleLowerCase(),[e],{pre:"|",post:"|",extract(i){return i.toLocaleLowerCase()}});if(!n)return{label:e,segments:[{segment:e,isMatch:!1}],matched:!1};const o=n.string.toString().replace(/\|\|/g,"").split("|").reduce((i,s,l)=>(i.push({segment:s,isMatch:l%2!==0}),i),new Array);return{label:e,segments:o,matched:!0}}const n4={class:"flex flex-col gap-4"},o4={class:"bg-white flex gap-4 px-24 py-8 sticky top-0"},r4={class:"hidden sm:inline xs:inline"},i4={key:0},s4={key:0,class:"flex flex-col"},l4={class:"flex flex-col"},a4={class:"flex items-center px-24 py-12"},d4=r.createElementVNode("div",{class:"fm-typo-body-md-400 text-fm-color-typo-secondary"}," Recent search ",-1),c4=r.createElementVNode("div",{class:"py-4"},[r.createElementVNode("hr",{class:"border-fm-color-neutral-gray-100"})],-1),u4=["onClick"],f4={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},h4={class:"fm-typo-body-lg-400 px-24 py-12 text-center text-fm-color-primary"},m4={class:"fm-typo-body-lg-400 px-24 py-12 text-center text-fm-color-typo-secondary"},p4={key:3,class:"flex flex-col"},g4=["onClick"],b4={class:"flex flex-col gap-4"},y4={key:0,class:"text-fm-color-typo-secondary"},$4={class:"px-16 py-4"},w4=5,_4=r.defineComponent({__name:"FmGlobalSearch",props:{show:{type:Boolean,default:!1},modelValue:{default:""},suggestions:{default:void 0},onSearch:{type:Function,default:void 0},placeholder:{default:""},hintPlaceholder:{default:""},notFoundPlaceholder:{default:""},recentSearchKey:{default:""}},emits:["dismiss","submit","update:show","update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function i(){if(!n.recentSearchKey)return;const D=n.recentSearchKey;localStorage.removeItem(D),a.value=[]}function s(){if(!n.recentSearchKey)return;const D=n.recentSearchKey,v=localStorage.getItem(D);if(!v)return[];try{return JSON.parse(v)}catch{return new Array}}const l=Qi(function(v){if(!n.recentSearchKey)return;const x=n.recentSearchKey,C=v().trim();if(!x||!C)return;const N=s()??[],E=[...new Set([C,...N])].slice(0,w4),P=JSON.stringify(E);return localStorage.setItem(x,P),a.value=E,E},800),a=r.ref(s()),d=q(n,"show");r.watch([()=>n.show],()=>{n.show?(f.value=null,n.suggestions&&k()):o("dismiss")});const c=q(n,"modelValue"),u=r.ref(n.modelValue);r.watch([()=>u.value],()=>{w()});const f=r.ref(null),h=r.ref(!0),m=r.computed(()=>{var D;return h.value?(D=f.value)==null?void 0:D.slice(0,5):f.value});r.watch([()=>f.value],([])=>{h.value=!0});const p=r.computed(()=>f.value===null),g=r.ref(!1),b=r.ref(""),y=()=>u.value;async function k(){if(!d.value)return;const D=y();if(!D)return;const v=Math.random().toString();if(b.value=v,n.suggestions){f.value=n.suggestions.map(x=>({label:sr(D,x.label),sublabel:x.sublabel?sr(D,x.sublabel):null})).filter(x=>{var C;return x.label.matched||((C=x.sublabel)==null?void 0:C.matched)}),l(y);return}if(n.onSearch)try{g.value=!0;const x=await n.onSearch(D);v===b.value&&(f.value=x.map(C=>({label:sr(D,C.label),sublabel:C.sublabel?sr(D,C.sublabel):null})))}catch{v===b.value&&(f.value=[])}finally{v===b.value&&(g.value=!1,l(y))}}function M(D){d.value=!1,o("dismiss"),c.value=D}const w=Qi(k),_=r.computed(()=>a.value&&a.value.length===0),F=r.computed(()=>(!u.value||p.value)&&!_.value),$=r.computed(()=>(!u.value||p.value)&&_.value),S=r.computed(()=>u.value&&f.value&&f.value.length===0);return(D,v)=>(r.openBlock(),r.createBlock(vc,{"model-value":r.unref(d),"onUpdate:modelValue":v[4]||(v[4]=x=>r.isRef(d)?d.value=x:null),"fullscreen-size":"sm","dismiss-away":""},{default:r.withCtx(()=>{var x,C;return[r.createElementVNode("div",n4,[r.createElementVNode("div",o4,[r.createElementVNode("div",r4,[r.createVNode(U,{"prepend-icon":"arrow_back",variant:"tertiary",onClick:v[0]||(v[0]=N=>d.value=!1)})]),r.createVNode(Zi,{"model-value":u.value,"onUpdate:modelValue":v[1]||(v[1]=N=>u.value=N),class:"flex-1",placeholder:D.placeholder},null,8,["model-value","placeholder"])]),g.value?(r.openBlock(),r.createElementBlock("div",i4,[r.createVNode(Zt,{size:"xl"})])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[F.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[D.recentSearchKey&&((x=a.value)!=null&&x.length)?(r.openBlock(),r.createElementBlock("div",s4,[r.createElementVNode("div",l4,[r.createElementVNode("div",a4,[d4,r.createVNode($t),r.createVNode(U,{label:"Clear history",variant:"plain",size:"md",onClick:v[2]||(v[2]=N=>i())})]),c4]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(N,E)=>(r.openBlock(),r.createElementBlock("div",{key:E,class:"cursor-pointer flex gap-8 hover:bg-fm-color-neutral-gray-100 items-center px-24 py-12",onClick:P=>u.value=N},[r.createVNode(H,{size:"lg",name:"history"}),r.createElementVNode("div",f4,r.toDisplayString(N),1)],8,u4))),128))])])):r.createCommentVNode("",!0)],64)):$.value?r.renderSlot(D.$slots,"hint-placeholder",{key:1},()=>[r.createElementVNode("div",h4,r.toDisplayString(D.hintPlaceholder),1)]):S.value?r.renderSlot(D.$slots,"not-found-placeholder",{key:2},()=>[r.createElementVNode("div",m4,r.toDisplayString(D.notFoundPlaceholder||`No result found for “${u.value}”`),1)]):(r.openBlock(),r.createElementBlock("div",p4,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(N,E)=>r.renderSlot(D.$slots,"search-result-item",r.mergeProps({key:E},{result:N}),()=>[r.createElementVNode("div",{class:"cursor-pointer flex gap-16 hover:bg-fm-color-neutral-gray-100 items-center px-24 py-12 w-full",onClick:P=>M(N.label.label)},[r.createVNode(H,{size:"lg",name:"arrow_forward"}),r.createElementVNode("div",b4,[r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(N.label.segments,(P,B)=>(r.openBlock(),r.createElementBlock("span",{key:B,class:r.normalizeClass({"fm-typo-body-lg-400":!P.isMatch,"fm-typo-body-lg-700":P.isMatch})},r.toDisplayString(P.segment),3))),128))]),N.sublabel?(r.openBlock(),r.createElementBlock("div",y4,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(N.sublabel.segments,(P,B)=>(r.openBlock(),r.createElementBlock("span",{key:B,class:r.normalizeClass({"fm-typo-body-md-400":!P.isMatch,"fm-typo-body-md-700":P.isMatch})},r.toDisplayString(P.segment),3))),128))])):r.createCommentVNode("",!0)])],8,g4)])),128)),r.createElementVNode("div",$4,[h.value&&(((C=f.value)==null?void 0:C.length)??0)>5?(r.openBlock(),r.createBlock(U,{key:0,label:`show ${f.value.length-5} more results`,variant:"plain",onClick:v[3]||(v[3]=N=>h.value=!1)},null,8,["label"])):r.createCommentVNode("",!0)])]))],64))])]}),_:3},8,["model-value"]))}}),k4=["inputMode","placeholder","readOnly","value","disabled"],C4={key:0},x4=["disabled"],S4=["disabled"],v4=J(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:""},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},useGrouping:{type:Boolean,default:!0},minFractionDigits:{default:0},maxFractionDigits:{default:2},label:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),{isFocused:s,blur:l,focus:a}=bn(),d=r.ref(null);let c;const u=w=>{if(w!==""){const _=+w.replace(/,/g,"");return isNaN(_)?null:_}return null},f=w=>c.format(w),h=w=>{if(typeof i.value!="number"){i.value=+i.value;return}if(w>0&&y.value||w<0&&k.value)return;let _=M(i.value)?i.value+w:0;_=m(_),i.value=_},m=w=>e.max!==void 0&&w>e.max?e.max:e.min!==void 0&&w<e.min?e.min:w,p=()=>{var w;i.value=u(((w=d.value)==null?void 0:w.value)??"")},g=w=>{if(![...Array(10).keys()].map(_=>_.toString()).includes(w.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(w.key)){w.preventDefault();return}},b=r.computed(()=>i.value!=null?f(i.value):""),y=r.computed(()=>{let w=!1;return e.max!==void 0&&(w=i.value>=e.max),e.min!==void 0&&(w=i.value<e.min),w}),k=r.computed(()=>{let w=!1;return e.max!==void 0&&(w=i.value>e.max),e.min!==void 0&&(w=i.value<=e.min),w});r.onBeforeMount(()=>{c=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping,minimumFractionDigits:e.minFractionDigits,maximumFractionDigits:e.maxFractionDigits,roundingMode:"trunc"})});function M(w){return typeof w=="number"&&isFinite(w)}return(w,_)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":_[8]||(_[8]=F=>r.isRef(i)?i.value=F:null),disabled:o.value,focused:r.unref(s),"helper-state":w.helperState,"helper-text":w.helperText,info:w.labelInfo,label:w.label,optional:w.labelMark==="optional",required:w.labelMark==="required",rules:w.rules},{label:r.withCtx(()=>[r.renderSlot(w.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:F})=>[r.createVNode(le,{"append-icon":w.appendIcon,focused:r.unref(s),invalid:F,"prepend-icon":w.prependIcon,"show-valid-border":w.showValidBorder,class:"cursor-text"},{prepend:r.withCtx(()=>[r.renderSlot(w.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(w.$slots,"append",{},()=>[r.createElementVNode("div",{class:r.normalizeClass([{"mr-32":w.showSteppers},"flex items-center justify-center"])},[w.appendText?(r.openBlock(),r.createElementBlock("div",C4,r.toDisplayString(w.appendText),1)):r.createCommentVNode("",!0),w.appendIcon?(r.openBlock(),r.createBlock(H,{key:1,color:o.value?"#C7C7CC":"#1C1C1E",name:w.appendIcon,size:"md"},null,8,["color","name"])):r.createCommentVNode("",!0)],2)],!0),w.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",type:"button",disabled:o.value||y.value,onBlur:_[2]||(_[2]=(...$)=>r.unref(l)&&r.unref(l)(...$)),onFocus:_[3]||(_[3]=(...$)=>r.unref(a)&&r.unref(a)(...$)),onMousedown:_[4]||(_[4]=()=>h(w.step))},[r.createVNode(H,{color:o.value||y.value?"#C7C7CC":"#1C1C1E",name:"expand_less",size:"md"},null,8,["color"])],40,x4),r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",type:"button",disabled:o.value||k.value,onBlur:_[5]||(_[5]=(...$)=>r.unref(l)&&r.unref(l)(...$)),onFocus:_[6]||(_[6]=(...$)=>r.unref(a)&&r.unref(a)(...$)),onMousedown:_[7]||(_[7]=()=>h(-w.step))},[r.createVNode(H,{color:o.value||k.value?"#C7C7CC":"#1C1C1E",name:"expand_more",size:"md"},null,8,["color"])],40,S4)],2)):r.createCommentVNode("",!0)]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:d,inputMode:w.inputmode,placeholder:w.placeholder,readOnly:w.readonly,value:b.value,class:"fm-stepper-field--input",type:"text",disabled:o.value,onBlur:_[0]||(_[0]=(...$)=>r.unref(l)&&r.unref(l)(...$)),onFocus:_[1]||(_[1]=(...$)=>r.unref(a)&&r.unref(a)(...$)),onInput:p,onKeydown:g},null,40,k4)]),_:2},1032,["append-icon","focused","invalid","prepend-icon","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(w.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),[["__scopeId","data-v-44c0f492"]]),D4=["disabled","maxlength","minlength","placeholder","readOnly","value"],M4=J(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:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),{isFocused:s,focus:l,blur:a}=bn(),d=c=>{i.value=c.target.value};return(c,u)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":u[2]||(u[2]=f=>r.isRef(i)?i.value=f:null),disabled:o.value,focused:r.unref(s),"helper-state":c.helperState,"helper-text":c.helperText,info:c.labelInfo,label:c.label,optional:c.labelMark==="optional",required:c.labelMark==="required",rules:c.rules},r.createSlots({label:r.withCtx(()=>[r.renderSlot(c.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:f})=>[r.createElementVNode("div",{class:r.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":r.unref(s),"fm-textarea__container--invalid":!!r.unref(i)&&f,"fm-textarea__container--valid":c.showValidBorder&&c.showSuccess&&!!r.unref(i)&&!f,"fm-textarea__container--disabled":o.value})},[r.createElementVNode("textarea",{class:r.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!o.value,"fm-color-typo-disabled":o.value}),disabled:o.value,maxlength:c.maxLength,minlength:c.minLength,placeholder:c.placeholder,readOnly:c.readonly,value:r.unref(i),onBlur:u[0]||(u[0]=(...h)=>r.unref(a)&&r.unref(a)(...h)),onFocus:u[1]||(u[1]=(...h)=>r.unref(l)&&r.unref(l)(...h)),onInput:d},null,42,D4)],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text",{},void 0,!0)]),_:2},[c.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([o.value?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(c.maxLength?`${r.unref(i).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),[["__scopeId","data-v-8e783d76"]]),V4={class:"flex flex-col fm-time-input items-center"},B4=["value"],Vc=J(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(t,{emit:e}){const n=t,o=e,i=r.ref();function s(u){i.value&&(i.value.value=u)}r.watch(()=>n.modelValue,s);function l(){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 d(){var u;(u=i.value)==null||u.focus(),o("update:model-value",a(n.modelValue)+1)}function c(){var u;(u=i.value)==null||u.focus(),o("update:model-value",a(n.modelValue)-1)}return(u,f)=>(r.openBlock(),r.createElementBlock("div",V4,[r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[r.createVNode(H,{name:"expand_less",size:"lg"})]),r.createElementVNode("input",{ref_key:"inputRef",ref:i,value:n.modelValue,onInput:l},null,40,B4),r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[r.createVNode(H,{name:"expand_more",size:"lg"})])]))}}),[["__scopeId","data-v-4a0644ef"]]);var Je=(t=>(t.AM="AM",t.PM="PM",t))(Je||{});function Qe(t){return t.toString().padStart(2,"0")}function E4(t){const[e,n]=t.split(":"),o=Number(e),i=Number(n),s=o>11?"PM":"AM";let l=o;return l===0?l=12:l>12&&(l-=12),`${Qe(l)}:${Qe(i)}:${s}`}function Be(t){const[e,n,o]=E4(t).split(":");return{hours:Number(e),minutes:Number(n),period:o}}function es({hours:t,minutes:e,period:n}){let o=t;return n==="PM"?o=t===12?t:t+12:t===12&&(o=0),`${Qe(o)}:${Qe(e)}`}const P4={class:"flex fm-time-input gap-16 items-center"},N4=r.createElementVNode("div",{class:"fm-typo-title-sm-700"},":",-1),F4={class:"fm-time-input-periods"},R4=["onClick"],lr=r.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 l={hours:s.hours??n.modelValue.hours,minutes:s.minutes??n.modelValue.minutes,period:s.period??n.modelValue.period},a=n.modelValue.hours;(a===12&&l.hours===11||a===11&&l.hours===12)&&(l.period=n.modelValue.period===Je.AM?Je.PM:Je.AM),l.hours>12?l.hours=1:l.hours<1&&(l.hours=12),l.minutes>59?l.minutes=0:l.minutes<0&&(l.minutes=59),o("update:model-value",l)}return(s,l)=>(r.openBlock(),r.createElementBlock("div",P4,[r.createVNode(Vc,{"model-value":r.unref(Qe)(t.modelValue.hours),min:1,max:12,"onUpdate:modelValue":l[0]||(l[0]=a=>i({hours:a}))},null,8,["model-value"]),N4,r.createVNode(Vc,{"model-value":r.unref(Qe)(t.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":l[1]||(l[1]=a=>i({minutes:a}))},null,8,["model-value"]),r.createElementVNode("div",F4,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Je),a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:r.normalizeClass([{"fm-time-input-period__selected":a===t.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},r.toDisplayString(a),11,R4))),128))])]))}}),A4={class:"flex gap-8"},O4={class:"bg-fm-color-neutral-white flex flex-col px-24 py-16 rounded-lg shadow-light-300 w-[343px]"},I4=r.createElementVNode("div",{class:"fm-typo-title-sm-700 mb-8"},"Enter time",-1),T4={class:"flex items-center justify-center py-16 w-full"},z4={class:"flex justify-end"},L4=r.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},placeholder:{default:"HH:MM"},zIndex:{default:void 0},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=r.ref(null),l=r.computed(()=>{if(!i.value)return null;const{hours:c,minutes:u,period:f}=Be(i.value);return`${Qe(c)}:${Qe(u)} ${f}`});function a(){if(!s.value){i.value=null;return}const c=es(s.value);i.value=c,d.value=!1}r.onMounted(()=>{i.value&&(s.value=Be(i.value))}),r.watch(()=>i.value,c=>{c&&(s.value=Be(c))});const d=r.ref(!1);return r.watchEffect(()=>{o.value||(d.value?s.value=Be(i.value??"00:00"):s.value=i.value?Be(i.value):null)}),(c,u)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":u[3]||(u[3]=f=>r.isRef(i)?i.value=f:null),disabled:o.value,"disable-auto-focus":"",focused:d.value,"helper-state":c.helperState,"helper-text":c.helperText,info:c.labelInfo,label:c.label,optional:c.labelMark==="optional",required:c.labelMark==="required",rules:c.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(c.$slots,"label")]),default:r.withCtx(({invalid:f})=>[r.createVNode(Vt,{disabled:c.disabled,"show-popover":d.value,"z-index":c.zIndex,onPopoverChanged:u[2]||(u[2]=h=>d.value=h)},{"popover-button":r.withCtx(()=>[c.$slots["trigger-button"]?r.renderSlot(c.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:f,dropdownShowed:d.value,showValidBorder:c.showValidBorder,shouldDisable:o.value}))):(r.openBlock(),r.createBlock(le,{key:1,class:r.normalizeClass(o.value?"cursor-not-allowed":"cursor-pointer"),focused:d.value,invalid:f,"show-valid-border":c.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",A4,[r.createVNode(H,{outline:!d.value,name:"schedule"},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass([{"text-fm-color-typo-disabled":!l.value},"grow"])},r.toDisplayString(l.value??c.placeholder??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",O4,[I4,r.createElementVNode("div",T4,[r.createVNode(lr,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Je).AM},"onUpdate:modelValue":u[0]||(u[0]=h=>s.value=h)},null,8,["model-value"])]),r.createElementVNode("div",z4,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u[1]||(u[1]=h=>d.value=!1)}),r.createVNode(U,{label:"Apply",size:"md",variant:"primary",onClick:a})])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),H4={class:"flex gap-8"},Y4={class:"bg-fm-color-neutral-white flex flex-col px-24 py-16 rounded-lg shadow-light-300"},j4=r.createElementVNode("div",{class:"fm-typo-title-sm-700 mb-8"},"Enter time",-1),W4={class:"flex flex-col gap-16 items-center justify-center py-16 w-full"},U4=r.createElementVNode("div",{class:"fm-typo-body-lg-700 text-left w-full"}," Starting Time ",-1),G4=r.createElementVNode("div",{class:"fm-typo-body-lg-700 text-left w-full"}," Ending Time ",-1),q4={class:"flex gap-8 items-center justify-end"},X4=r.defineComponent({__name:"FmTimeRangePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},placeholder:{default:"HH:MM"},zIndex:{default:void 0},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=r.ref(null),l=r.ref(null),a=r.computed(()=>{const g=Array.isArray(i.value);return!i.value||!g||g&&i.value.every(b=>!m(b))?null:i.value.map(b=>{const{hours:y,minutes:k,period:M}=Be(b);return`${Qe(y)}:${Qe(k)} ${M}`}).join(" - ")});function d(){if(!s.value||!l.value){i.value=null;return}let g=!1;const b=s.value,y=l.value;(b.period===Je.PM&&y.period===Je.AM||b.period===y.period&&(b.hours<y.hours||b.minutes<y.minutes))&&(g=!0);const k=es(s.value),M=es(l.value);i.value=g?[M,k]:[k,M],u()}r.onMounted(()=>{Array.isArray(i.value)&&i.value.every(g=>!!g)&&(s.value=Be(i.value[0]),l.value=Be(i.value[1]))}),r.watch(()=>i.value,g=>{const b=Array.isArray(g);g&&b&&g.every(y=>m(y))&&(s.value=Be(g[0]),l.value=Be(g[1]))});const c=r.ref();function u(){var g;(g=c.value)==null||g.hide()}const f=r.ref(!1);function h(g){var b,y,k,M;g?(s.value=Be(((k=i.value)==null?void 0:k[0])??"00:00"),l.value=Be(((M=i.value)==null?void 0:M[1])??"23:59")):(s.value=(b=i.value)!=null&&b[0]?Be(i.value[0]):null,l.value=(y=i.value)!=null&&y[1]?Be(i.value[1]):null),f.value=g}const m=g=>/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(g),p=r.computed(()=>Se(s.value,l.value));return(g,b)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":b[2]||(b[2]=y=>r.isRef(i)?i.value=y:null),disabled:o.value,focused:f.value,"helper-state":g.helperState,"helper-text":g.helperText,info:g.labelInfo,label:g.label,optional:g.labelMark==="optional",required:g.labelMark==="required",rules:g.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(g.$slots,"label")]),default:r.withCtx(({invalid:y})=>[r.createVNode(Vt,{ref_key:"dropdownRef",ref:c,width:343,"show-popover":f.value,"z-index":e.zIndex,onPopoverChanged:h},{"popover-button":r.withCtx(()=>[g.$slots["trigger-button"]?r.renderSlot(g.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:y,dropdownShowed:f.value,showValidBorder:g.showValidBorder,shouldDisable:o.value}))):(r.openBlock(),r.createBlock(le,{key:1,class:r.normalizeClass(o.value?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:y,"show-valid-border":g.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",H4,[r.createVNode(H,{outline:!f.value,name:"schedule"},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass([{"text-fm-color-typo-disabled":!a.value},"grow"])},r.toDisplayString(a.value??g.placeholder??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",Y4,[j4,r.createElementVNode("div",W4,[r.createElementVNode("div",null,[U4,r.createVNode(lr,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Je).AM},"onUpdate:modelValue":b[0]||(b[0]=k=>s.value=k)},null,8,["model-value"])]),r.createElementVNode("div",null,[G4,r.createVNode(lr,{"model-value":l.value??{hours:0,minutes:0,period:r.unref(Je).AM},"onUpdate:modelValue":b[1]||(b[1]=k=>l.value=k)},null,8,["model-value"])])]),r.createElementVNode("div",q4,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:p.value,label:"Apply",size:"md",variant:"primary",onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(g.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),ts=J(r.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass({"fm-list--separator":e.separator,activeClass:e.activeClass})},[r.renderSlot(e.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-884ba127"]]),ns=J(r.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},label:{default:""},sublabel:{default:""}},setup(t){const e=t;return(n,o)=>{const i=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createBlock(e.tag,{class:r.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":n.disabled,"cursor-pointer hover:bg-fm-color-opacity-sm":n.clickable&&!n.disabled,"cursor-not-allowed":n.clickable&&n.disabled}),onClick:o[0]||(o[0]=r.withModifiers(()=>{},["prevent"]))},{default:r.withCtx(()=>[r.renderSlot(n.$slots,"prepend",{},void 0,!0),r.renderSlot(n.$slots,"default",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-typo-body-lg-400 line-clamp-1 break-all ${n.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"}`)},r.toDisplayString(n.label),3),n.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-md-400 line-clamp-2 break-all ${n.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"}`)},r.toDisplayString(n.sublabel),3)):r.createCommentVNode("",!0)])],!0),n.$slots.append?(r.openBlock(),r.createBlock($t,{key:0})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"append",{},void 0,!0)]),_:3},8,["class"])),[[i,n.clickable&&!n.disabled]])}}}),[["__scopeId","data-v-90312222"]]);function K4(t){for(;t;){if(Z4(t))return t;t=t.parentElement}return document.scrollingElement}function Z4(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 J4{constructor(e,n){T(this,"onScroll");T(this,"scrollParent");this.onScroll=n,this.scrollParent=K4(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Q4={class:"fm-menu__wrapper"},ew=J(r.defineComponent({__name:"FmMenuDeprecated",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=r.ref(!1),s=r.ref(null),l=r.ref(null),{floatingStyles:a}=Jn(s,l,{middleware:[Gn(4),Zn()],placement:o.placement,whileElementsMounted:Kn});let d;const c=n;e({show:()=>{i.value||(i.value=!0,c("dropdown-changed",i.value))},hide:()=>{i.value&&(i.value=!1,c("dropdown-changed",i.value))}});const u=m=>{m.preventDefault(),m.stopPropagation(),!o.disabled&&(i.value=!i.value,c("dropdown-changed",i.value))},f=m=>{if(!i.value)return;const p=m.path||m.composedPath();for(const g of p)if(g==s.value||g==l.value)return;i.value=!1,c("dropdown-changed",i.value)},h=()=>{c("dropdown-changed",!1)};return r.watch(()=>o.showMenu,m=>i.value=m),r.onMounted(()=>{i.value=o.showMenu,window.addEventListener("click",f),d=new J4(s.value,h),d.bindScroll()}),r.onUnmounted(()=>{window.removeEventListener("click",f),d.unbindScroll()}),(m,p)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:s,class:"fm-menu",onClick:u},[r.renderSlot(m.$slots,"menu-button",{},void 0,!0)],512),i.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuEl",ref:l,class:r.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":i.value}),style:r.normalizeStyle(r.unref(a))},[r.renderSlot(m.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",Q4,[r.renderSlot(m.$slots,"menu-content",{},void 0,!0)])],!0)],6)):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-5b19ece2"]]),tw={class:"fm-typo-body-lg-700 mx-8 p-8 text-fm-color-typo-primary"},nw=r.defineComponent({__name:"FmMenuHeader",props:{label:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(e.label),1))}}),ow=t=>(r.pushScopeId("data-v-c5236366"),t=t(),r.popScopeId(),t),rw={class:"relative"},iw={class:"fm-progress-linear fm-typo-body-sm-400 h-4 overflow-hidden relative rounded-lg w-auto"},sw=ow(()=>r.createElementVNode("span",{class:"bg-fm-color-neutral-gray-100",style:{width:"100%"}},null,-1)),lw=J(r.defineComponent({__name:"FmLinearProgress",props:{color:{default:"primary"}},setup(t){const e=t,n=r.computed(()=>{const o=new Array,i={};return e.color?(mn(e.color)?i["background-color"]=e.color:o.push(`bg-fm-color-${e.color}`),{class:o.join(" "),style:i}):{class:o.join(" "),style:i}});return(o,i)=>(r.openBlock(),r.createElementBlock("div",rw,[r.createElementVNode("div",iw,[sw,r.createElementVNode("span",{class:r.normalizeClass(["dash-1",n.value.class]),style:r.normalizeStyle(n.value.style)},null,6),r.createElementVNode("span",{class:r.normalizeClass(["dash-2",n.value.class]),style:r.normalizeStyle(n.value.style)},null,6)])]))}}),[["__scopeId","data-v-c5236366"]]),aw={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},dw={key:0},cw={class:"h-full overflow-y-auto"},uw={class:"pt-24"},fw=J(r.defineComponent({__name:"FmSideSheet",props:{header:{default:""},modelValue:{type:Boolean,default:!1},dismissAway:{type:Boolean,default:!1},closeButton:{type:Boolean,default:!0},maxWidth:{default:void 0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=q(e,"modelValue");return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{onClick:i[0]||(i[0]=s=>n.value=!0)},[r.renderSlot(o.$slots,"side-sheet-button",{},void 0,!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.unref(n)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":e.dismissAway,"z-index":e.zIndex,onClose:i[2]||(i[2]=s=>n.value=!1)},{default:r.withCtx(()=>[r.createVNode(r.Transition,{appear:"",name:"slide"},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([!o.maxWidth&&"max-w-[400px]","fm-side-sheet"]),style:r.normalizeStyle({maxWidth:`${o.maxWidth}px`})},[r.createElementVNode("div",aw,[r.renderSlot(o.$slots,"side-sheet-header",{},()=>[o.header?(r.openBlock(),r.createElementBlock("div",dw,r.toDisplayString(o.header),1)):r.createCommentVNode("",!0)],!0),o.closeButton?(r.openBlock(),r.createBlock(H,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:i[1]||(i[1]=s=>n.value=!1)})):r.createCommentVNode("",!0)]),r.createElementVNode("div",cw,[r.renderSlot(o.$slots,"default",{},void 0,!0)]),r.createElementVNode("div",uw,[r.renderSlot(o.$slots,"side-sheet-footer",{},void 0,!0)])],6)]),_:3})]),_:3},8,["dismiss-away","z-index"])):r.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-add0e238"]]),hw={class:"flex"},mw={key:0,class:"mt-8"},Bc=J(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(t,{emit:e}){const n=t,o=e,i=r.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=r.computed(()=>n.title?{text:n.title,classes:"fm-typo-body-lg-700"}:{text:n.description,classes:""}),l=r.computed(()=>n.bgColor?mn(n.bgColor)?{style:{backgroundColor:n.bgColor}}:{class:`bg-fm-color-${n.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=r.computed(()=>n.color?mn(n.color)?{style:{color:n.color}}:{class:`text-fm-color-${n.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(d,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(l.value,{class:"fm-corner-radius-lg fm-shadow-light-400 fm-snackbar px-24 py-16"}),[r.createElementVNode("div",hw,[i.value.icon?(r.openBlock(),r.createBlock(H,{key:0,name:i.value.icon.name,color:n.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(`${s.value.classes} grow ellipsis`)},r.toDisplayString(s.value.text),3),n.dismissable?(r.openBlock(),r.createBlock(H,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:c[0]||(c[0]=()=>o("onDismiss"))})):r.createCommentVNode("",!0)]),n.title&&n.description?(r.openBlock(),r.createElementBlock("div",mw,r.toDisplayString(n.description),1)):r.createCommentVNode("",!0),r.renderSlot(d.$slots,"actions",{},()=>[n.action?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[r.createElementVNode("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=()=>o("onAction"))},r.toDisplayString(n.action),1)],16)):r.createCommentVNode("",!0)],!0)],16))}}),[["__scopeId","data-v-e2ff7141"]]),pw={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},os=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(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex flex-col",t.disabled?"text-fm-color-typo-disabled":""])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-step-title line-clamp-2",t.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},r.toDisplayString(t.title),3),t.description?(r.openBlock(),r.createElementBlock("div",pw,r.toDisplayString(t.description),1)):r.createCommentVNode("",!0)],2))}}),gw=["data-title","data-description","data-disabled"],bw={class:"flex fm-step-container gap-12 grow"},yw=J(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(t){const e=t,{currentStep:n,goToStep:o}=r.inject(Os);function i(){s.value||o(e.value)}const s=r.computed(()=>e.disabled?e.disabled():!1),l=r.computed(()=>e.error?e.error():!1),a=r.computed(()=>n()===e.value),d=r.computed(()=>e.complete()),c=r.computed(()=>a.value||d.value||n()>e.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),u=r.computed(()=>a.value?{className:"bg-fm-color-primary"}:l.value?{config:{name:"warning",color:"system-error-300"}}:s.value?{className:"border-2 border-fm-color-neutral-gray-200"}:d.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,h)=>{const m=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{"data-title":t.title,"data-description":t.description,"data-disabled":s.value,class:r.normalizeClass(`fm-step gap-4 grow ${s.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:r.withModifiers(i,["stop"])},[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-step-indicator ${c.value}`)},null,2)]),r.createElementVNode("div",bw,[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]",u.value.className])},[u.value.config?(r.openBlock(),r.createBlock(H,{key:0,name:u.value.config.name,color:u.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):r.createCommentVNode("",!0)],2),r.createVNode(os,{title:t.title,description:t.description,disabled:s.value,class:"grow"},null,8,["title","description","disabled"])])],10,gw)),[[m,!s.value]])}}}),[["__scopeId","data-v-ee172cad"]]),$w={class:"hidden items-center xs:flex"},ww={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},_w=r.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=u=>{o("update:model-value",u)};r.provide(Os,{currentStep:()=>n.modelValue,goToStep:i});const s=r.ref(),l=r.ref([]),a=r.computed(()=>l.value[n.modelValue-1]),d=r.computed(()=>`${n.modelValue} of ${l.value.length}`),c=()=>{var f;const u=Array.from(((f=s.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);l.value=u.map(h=>({title:h.dataset.title??"",description:h.dataset.description,disabled:h.dataset.disabled=="true"}))};return r.onMounted(()=>{c()}),(u,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(`fm-stepper fm-stepper__${t.orientation}`)},[r.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:r.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${t.orientation==="vertical"?"flex-col":""}`)},[r.renderSlot(u.$slots,"default")],2),r.createElementVNode("div",$w,[r.createVNode(Zt,{"current-step":t.modelValue,"total-steps":l.value.length,class:"mr-12"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(d.value),1)]),_:1},8,["current-step","total-steps"]),a.value?(r.openBlock(),r.createBlock(os,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):r.createCommentVNode("",!0)]),u.$slots.contents?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${t.orientation==="vertical"?"w-2/3":""}`)},[r.renderSlot(u.$slots,"contents"),r.createElementVNode("div",ww,[r.renderSlot(u.$slots,"actions")])],2)):r.createCommentVNode("",!0)],2))}});let kw=0;function Cw(){return kw++}const xw=t=>(r.pushScopeId("data-v-57d43f79"),t=t(),r.popScopeId(),t),Sw=["disabled"],vw=[xw(()=>r.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Ec=J(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:()=>Cw()},children:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.ref(!1),o=t,i=e,s=r.ref(!1);function l(f){n.value=f}const a=()=>{o.disabled||o.children.length>0||i("update:modelValue",o.value)},d=f=>{o.children.length!==0&&(s.value=f)},c=r.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,h)=>(r.openBlock(),r.createBlock(Ze,{"show-menu":s.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",onMenuChanged:d},{"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":c.value}]),disabled:f.disabled,type:"button",onMousedown:h[0]||(h[0]=()=>l(!0)),onMouseup:h[1]||(h[1]=()=>l(!1)),onMouseleave:h[2]||(h[2]=()=>l(!1)),onClick:a},[r.renderSlot(f.$slots,"prepend",{},void 0,!0),f.icon?(r.openBlock(),r.createBlock(H,{key:0,name:f.icon,outline:!n.value&&!c.value,color:f.disabled?"neutral-gray-200":c.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 row-start-1 text-left",c.value?"visible":"invisible",f.icon||f.$slots.append?"col-start-2":"col-start-1"])},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 row-start-1 text-left",f.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!c.value||f.disabled?"visible":"invisible",f.icon||f.$slots.append?"col-start-2":"col-start-1"])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0),f.badge?(r.openBlock(),r.createBlock(Ft,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),f.children.length>0?(r.openBlock(),r.createBlock(H,{key:4,size:"md",name:s.value?"expand_less":"expand_more"},null,8,["name"])):r.createCommentVNode("",!0),r.renderSlot(f.$slots,"append",{},void 0,!0),c.value?(r.openBlock(),r.createElementBlock("div",{key:5,class:r.normalizeClass([`fm-tab__indicator__wrapper--${f.vertical?"vertical":"horizontal"}`])},vw,2)):r.createCommentVNode("",!0)],42,Sw)]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,m=>(r.openBlock(),r.createBlock(we,{key:m.value,"model-value":o.modelValue===m.value,label:m.label,icon:m.icon,disabled:m.disabled,onClick:p=>u(m.value)},{append:r.withCtx(()=>[m.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:m.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"]))),128))]),_:3},8,["show-menu","disabled","class","placement"]))}}),[["__scopeId","data-v-57d43f79"]]),Dw={class:"flex gap-8 h-48 items-center justify-end transition-all w-full xs:flex-wrap-reverse"},Mw={class:"flex flex-1 gap-8"},Vw=r.defineComponent({__name:"FmTableToolbar",props:{searchModel:{default:""},searchable:{type:Boolean},filterable:{type:Boolean},chips:{default:()=>[]},actions:{default:()=>[]},zIndexForBottomSheet:{default:void 0}},emits:["update:search-model","click:remove-chip"],setup(t){const e=t,{breakpoints:n}=yt(),o=r.computed(()=>{const a=[];e.searchable&&a.push({label:"Search",icon:"search",key:"search"}),e.filterable&&a.push({label:"Filter",icon:"filter_alt",key:"filter"});const d=a.concat(e.actions);if(n.value.xs){const[p,g,b,...y]=d;return y.length===0?{actionButtons:[p,g,b].filter(k=>k),collapse:y}:{actionButtons:[p,g].filter(k=>k),collapse:[b,...y]}}const[c,u,f,h,...m]=d;return m.length===0?{actionButtons:[c,u,f,h].filter(p=>p),collapse:m}:{actionButtons:[c,u,f].filter(p=>p),collapse:[h,...m]}}),i=r.ref(!1);function s(a){if(n.value.xs){a.stopPropagation(),i.value=!0;return}}const l=q(e,"searchModel");return(a,d)=>(r.openBlock(),r.createElementBlock("div",Dw,[r.renderSlot(a.$slots,"chips",{},()=>[a.chips.length?(r.openBlock(),r.createBlock(Pr,{key:0,class:"min-w-0 mr-auto",items:a.chips,removable:"",onChipClosed:d[0]||(d[0]=c=>a.$emit("click:remove-chip",c))},null,8,["items"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Mw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value.actionButtons,c=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:c.key},[c.key==="search"?r.renderSlot(a.$slots,"action-search",{key:0},()=>[r.createVNode(Zi,{"model-value":r.unref(l),"onUpdate:modelValue":d[1]||(d[1]=u=>r.isRef(l)?l.value=u:null),class:"w-full",collapsible:""},null,8,["model-value"])]):r.renderSlot(a.$slots,`action-${c.key}`,{key:1},()=>[r.createVNode(U,{"prepend-icon":c.icon,variant:"tertiary",onClick:u=>a.$emit(`click:action-${c.key}`)},null,8,["prepend-icon","onClick"])])],64))),128)),o.value.collapse.length?(r.openBlock(),r.createBlock(Ze,{key:0},{"menu-button":r.withCtx(()=>[r.createVNode(U,{"prepend-icon":"more_vert",variant:"tertiary",onClick:s})]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value.collapse,c=>(r.openBlock(),r.createBlock(we,{key:c.key,label:c.label,icon:c.icon,onClick:u=>{a.$emit(`click:action-${c.key}`),i.value=!1}},null,8,["label","icon","onClick"]))),128))]),_:1})):r.createCommentVNode("",!0),a.$slots.append?r.renderSlot(a.$slots,"append",{key:1}):r.createCommentVNode("",!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(Vr,{modelValue:i.value,"onUpdate:modelValue":d[2]||(d[2]=c=>i.value=c),"dismiss-away":"","z-index":e.zIndexForBottomSheet},{default:r.withCtx(()=>[r.createVNode(ts,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value.collapse,c=>(r.openBlock(),r.createBlock(ns,{key:c.key,label:c.label,class:"hover:bg-fm-color-neutral-gray-100",onClick:u=>{a.$emit(`click:action-${c.key}`),i.value=!1}},null,8,["label","onClick"]))),128))]),_:1})]),_:1},8,["modelValue","z-index"])]))]))}});/**
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C3(t,e){if(t){if(typeof t=="string")return Cc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cc(t,e)}}function Cc(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function x3(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o=[],i=!0,s=!1,l,a;try{for(n=n.call(t);!(i=(l=n.next()).done)&&(o.push(l.value),!(e&&o.length===e));i=!0);}catch(d){s=!0,a=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return o}}function S3(t){if(Array.isArray(t))return t}function v3(t){var e=Array.prototype.slice.call(t),n=_3(e,4),o=n[0],i=n[1],s=n[2],l=n[3],a,d,c;if(typeof o=="string")a=o;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")l?(d=s,c=l):(d=void 0,c=s),i&&(d=$3({defaultCountry:i},d));else if(tr(i))s?(d=i,c=s):c=i;else throw new Error("Invalid second argument: ".concat(i));return{text:a,options:d,metadata:c}}function xc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function Sc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xc(Object(n),!0).forEach(function(o){D3(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function D3(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M3(t,e,n){e&&e.defaultCountry&&!Ky(e.defaultCountry,n)&&(e=Sc(Sc({},e),{},{defaultCountry:void 0}));try{return y3(t,e,n)}catch(o){if(!(o instanceof ft))throw o}}function V3(){var t=v3(arguments),e=t.text,n=t.options,o=t.metadata;return M3(e,n,o)}function Xi(){return Wd(V3,arguments)}function B3(){return Wd(rr,arguments)}const E3=["disabled","inputMode","maxlength","minlength","placeholder","readOnly","type","value"],Ki=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:""},showValidBorder:{type:Boolean,default:!1},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},invalid:{type:Boolean},modelValue:{},label:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue","focus-changed"],setup(t,{expose:e,emit:n}){const o=t,i=r.inject(ye),s=r.computed(()=>o.disabled??(i==null?void 0:i.getDisabled())??!1),l=n,a=r.ref(null),d=q(o,"modelValue"),{isFocused:c,focus:u,blur:f}=bn(),h=m=>{d.value=m.target.value};return e({focus:u}),(m,p)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(d),"onUpdate:modelValue":p[2]||(p[2]=g=>r.isRef(d)?d.value=g:null),disabled:s.value,focused:r.unref(c),"helper-state":m.helperState,"helper-text":m.helperText,info:m.labelInfo,label:m.label,optional:m.labelMark==="optional",required:m.labelMark==="required",rules:m.rules},r.createSlots({default:r.withCtx(({invalid:g})=>[r.createVNode(le,{"append-icon":m.appendIcon,focused:r.unref(c),invalid:m.invalid||g,"prepend-icon":m.prependIcon,"show-valid-border":m.showValidBorder,class:"cursor-text"},{prepend:r.withCtx(()=>[r.renderSlot(m.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(m.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:a,class:r.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!s.value,"text-fm-color-typo-disabled":s.value}),disabled:s.value,inputMode:m.inputmode,maxlength:m.maxLength,minlength:m.minLength,placeholder:m.placeholder,readOnly:m.readonly,type:m.inputmode,value:r.unref(d),onBlur:p[0]||(p[0]=()=>{r.unref(f)(),l("focus-changed",!1)}),onFocus:p[1]||(p[1]=()=>{r.unref(u)(),l("focus-changed",!0)}),onInput:h},null,42,E3)]),_:2},1032,["append-icon","focused","invalid","prepend-icon","show-valid-border"])]),_:2},[m.label||m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label")]),key:"0"}:void 0,m.helperText||m.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"helper-text")]),key:"1"}:void 0,m.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([s.value?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(m.maxLength?`${r.unref(d).length} / ${m.maxLength}`:""),3)]),key:"2"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),P3="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-my'%20viewBox='0%200%20640%20480'%3e%3cg%20clip-path='url(%23my-a)'%3e%3cpath%20fill='%23C00'%20d='M0%200h640v480H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%200h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%2034.3h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%2068.6h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20102.9h640V137H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20137.1h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20171.4h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20205.7h640V240H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20240h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20274.3h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20308.6h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20342.9h640V377H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20377.1h640v34.3H0z'/%3e%3cpath%20fill='%23C00'%20d='M0%20411.4h640v34.3H0z'/%3e%3cpath%20fill='%23fff'%20d='M0%20445.7h640V480H0z'/%3e%3cpath%20fill='%23006'%20d='M0%20.5h320v274.3H0z'/%3e%3cpath%20fill='%23FC0'%20d='m207.5%2073.8%206%2040.7%2023-34-12.4%2039.2%2035.5-20.8-28.1%2030%2041-3.2-38.3%2014.8%2038.3%2014.8-41-3.2%2028.1%2030-35.5-20.8%2012.3%2039.3-23-34.1-6%2040.7-5.9-40.7-23%2034%2012.4-39.2-35.5%2020.8%2028-30-41%203.2%2038.4-14.8-38.3-14.8%2041%203.2-28.1-30%2035.5%2020.8-12.4-39.3%2023%2034.1zm-33.3%201.7a71.1%2071.1%200%200%200-100%2065%2071.1%2071.1%200%200%200%20100%2065%2080%2080%200%200%201-83.2%206.2%2080%2080%200%200%201-43.4-71.2%2080%2080%200%200%201%20126.6-65'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='my-a'%3e%3cpath%20fill='%23fff'%20d='M0%200h640v480H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",N3="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='flag-icons-sg'%20viewBox='0%200%20640%20480'%3e%3cdefs%3e%3cclipPath%20id='sg-a'%3e%3cpath%20fill-opacity='.7'%20d='M0%200h640v480H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20fill-rule='evenodd'%20clip-path='url(%23sg-a)'%3e%3cpath%20fill='%23fff'%20d='M-20%200h720v480H-20z'/%3e%3cpath%20fill='%23df0000'%20d='M-20%200h720v240H-20z'/%3e%3cpath%20fill='%23fff'%20d='M146%2040.2a84.4%2084.4%200%200%200%20.8%20165.2%2086%2086%200%200%201-106.6-59%2086%2086%200%200%201%2059-106c16-4.6%2030.8-4.7%2046.9-.2z'/%3e%3cpath%20fill='%23fff'%20d='m133%20110%204.9%2015-13-9.2-12.8%209.4%204.7-15.2-12.8-9.3%2015.9-.2%205-15%205%2015h15.8zm17.5%2052%205%2015.1-13-9.2-12.9%209.3%204.8-15.1-12.8-9.4%2015.9-.1%204.9-15.1%205%2015h16zm58.5-.4%204.9%2015.2-13-9.3-12.8%209.3%204.7-15.1-12.8-9.3%2015.9-.2%205-15%205%2015h15.8zm17.4-51.6%204.9%2015.1-13-9.2-12.8%209.3%204.8-15.1-12.9-9.4%2016-.1%204.8-15.1%205%2015h16zm-46.3-34.3%205%2015.2-13-9.3-12.9%209.4%204.8-15.2-12.8-9.4%2015.8-.1%205-15.1%205%2015h16z'/%3e%3c/g%3e%3c/svg%3e",F3={class:"flex gap-4"},R3=["alt","src"],A3=["alt","src"],O3=r.defineComponent({__name:"FmPhoneNumber",props:{modelValue:{},defaultCountry:{default:"MY"},placeholder:{default:""},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=r.inject(ye),i=e,s=q(n,"modelValue"),l=r.computed(()=>n.disabled??(o==null?void 0:o.getDisabled())??!1),a=["MY","SG"],d=a.reduce((C,v)=>(C[v]=`+${B3(v)}`,C),{}),c=a.map(C=>({label:"",value:C}));function u(C){var v;return C?((v=Object.entries(d).find(([,_])=>C.startsWith(_)))==null?void 0:v[0])??null:n.defaultCountry}const f=r.computed(()=>u(n.modelValue)),h=r.computed(()=>!f.value||!n.modelValue?d[n.defaultCountry]:n.modelValue),m=r.computed({get(){const C=Xi(h.value);return C?C.formatInternational().replace(d[f.value],"").trim():h.value.replace(d[f.value],"").trim()},set(C){const v=`${d[f.value]}${C}`,_=Xi(v);if(!_){s.value=v;return}s.value=_.formatInternational()}}),p=r.computed({get(){return f.value??n.defaultCountry},set(C){if(!f.value){i("update:modelValue",d[n.defaultCountry]);return}const _=d[f.value],x=d[C];s.value=h.value.replace(_,x)}}),g=r.ref({dropdown:!1,textField:!1});function b(C){const v=f.value;if(!C.replace(d[v],"").trim().length)return!0;const x=Xi(s.value,v);return!x||!x.isValid()?"Invalid phone number":!0}const y={MY:P3,SG:N3};return(C,v)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(s),"onUpdate:modelValue":v[4]||(v[4]=_=>r.isRef(s)?s.value=_:null),disabled:l.value,focused:g.value.dropdown||g.value.textField,"helper-state":C.helperState,"helper-text":C.helperText,info:C.labelInfo,label:C.label,optional:C.labelMark==="optional",required:C.labelMark==="required",rules:[...C.rules,b],class:"flex gap-4"},r.createSlots({default:r.withCtx(({invalid:_})=>[r.createElementVNode("div",F3,[r.createVNode(dn,{"model-value":p.value,"onUpdate:modelValue":v[0]||(v[0]=x=>p.value=x),disabled:l.value,items:r.unref(c),onDropdownChanged:v[1]||(v[1]=x=>g.value.dropdown=x)},{default:r.withCtx(()=>[r.createElementVNode("img",{alt:p.value,src:y[p.value],class:"h-auto w-[20px]"},null,8,R3)]),"menu-wrapper":r.withCtx(({handleItemChange:x})=>[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(a,N=>r.createVNode(we,{key:N,"model-value":p.value===N,"onUpdate:modelValue":E=>x(E,r.unref(c).find(R=>R.value===N))},{label:r.withCtx(()=>[r.createElementVNode("img",{alt:N,src:y[N],class:"h-auto w-[20px]"},null,8,A3)]),_:2},1032,["model-value","onUpdate:modelValue"])),64))]),_:1},8,["model-value","disabled","items"]),r.createVNode(Ki,{"model-value":m.value,"onUpdate:modelValue":v[2]||(v[2]=x=>m.value=x),disabled:l.value,invalid:_,class:"flex-1",inputmode:"tel",onFocusChanged:v[3]||(v[3]=x=>g.value.textField=x)},{prepend:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass([l.value?"text-fm-color-typo-disabled":""])},"("+r.toDisplayString(r.unref(d)[f.value])+")",3)]),_:2},1032,["model-value","disabled","invalid"])])]),_:2},[C.label||C.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(C.$slots,"label")]),key:"0"}:void 0,C.helperText||C.$slots["helper-text"]?{name:"helper-text",fn:r.withCtx(()=>[r.renderSlot(C.$slots,"helper-text")]),key:"1"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),I3={class:"flex gap-8 items-center"},T3=["onInput","onKeydown"],z3=J(r.defineComponent({__name:"FmPinField",props:{modelValue:{default:()=>[]},length:{default:6},type:{default:"number"}},emits:["update:modelValue","complete"],setup(t,{emit:e}){const n=e,o=t,i=q(o,"modelValue"),s=r.ref([]),l=(f,h)=>{const m=f.target;if(o.type==="number"&&!/^[0-9]$/g.test(m.value)){m.value="";return}m.value=m.value.slice(-1),c(m.value,h),s.value[h+1]?s.value[h+1].focus():s.value[h].blur()},a=(f,h)=>{f.preventDefault();const m=f.target;m.value="",c(null,h),s.value[h-1]?s.value[h-1].focus():s.value[h].focus()},d=(f,h)=>{f.preventDefault(),f.key==="ArrowLeft"&&(s.value[h-1]?s.value[h-1].focus():s.value[h].focus()),f.key==="ArrowRight"&&(s.value[h+1]?s.value[h+1].focus():s.value[h].focus())},c=(f,h)=>{i.value=i.value.toSpliced(h,1,f)},u=(f,h)=>{s.value[h]=f};return r.onMounted(()=>{i.value=Array.from(Array(o.length).fill(null))}),r.watch(()=>i.value,()=>{i.value.every(f=>f!==null)&&n("complete",i.value.join(""))}),(f,h)=>(r.openBlock(),r.createElementBlock("div",I3,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.length,(m,p)=>(r.openBlock(),r.createElementBlock("input",{key:m,ref_for:!0,ref:g=>u(g,p),class:r.normalizeClass(["fm-pin-field",{"fm-pin-field--populated":r.unref(i)[p]!==null}]),type:"text",onInput:g=>l(g,p),onKeydown:[r.withKeys(g=>a(g,p),["backspace"]),r.withKeys(g=>d(g,p),["arrow-left","arrow-right"])]},null,42,T3))),128))]))}}),[["__scopeId","data-v-45a53bf7"]]),L3={class:"fm-radio-btn"},H3={class:"fm-radio-btn__input--container"},Y3=["checked","disabled","value"],j3={class:"py-8"},W3={class:"fm-typo-body-lg-400"},U3={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},G3=J(r.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=q(e,"modelValue"),o=r.ref(),i=r.inject(As,null),s=r.inject(ye),l=()=>{a.value||(i?i.updateValue(e.value):n.value=e.value)},a=r.computed(()=>e.disabled??(i==null?void 0:i.getDisabled())??(s==null?void 0:s.getDisabled())??!1),d=r.computed(()=>i?e.value===i.groupValue.value:n.value===e.value);return(c,u)=>{const f=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",L3,[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:l},[r.withDirectives((r.openBlock(),r.createElementBlock("div",H3,[r.createElementVNode("input",{ref_key:"inputEl",ref:o,checked:d.value,disabled:a.value,value:c.value,class:"fm-radio-btn__input--btn",type:"radio"},null,8,Y3)])),[[f,!a.value]]),r.createElementVNode("div",j3,[r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",W3,r.toDisplayString(c.label),1),c.sublabel?(r.openBlock(),r.createElementBlock("div",U3,r.toDisplayString(c.sublabel),1)):r.createCommentVNode("",!0)],!0)])],2)])}}}),[["__scopeId","data-v-5d4cbf27"]]),q3=r.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},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=q(e,"modelValue"),o=r.inject(ye);r.provide(As,{groupValue:n,getDisabled:()=>i.value,updateValue(s){n.value=s}});const i=r.computed(()=>e.disabled??(o==null?void 0:o.getDisabled())??!1);return(s,l)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(n),"onUpdate:modelValue":l[0]||(l[0]=a=>r.isRef(n)?n.value=a:null),disabled:i.value,"helper-state":s.helperState,"helper-text":s.helperText,info:s.labelInfo,label:s.label,optional:s.labelMark==="optional",required:s.labelMark==="required",rules:s.rules},{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","disabled","helper-state","helper-text","info","label","optional","required","rules"]))}}),Zi=r.defineComponent({__name:"FmSearch",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!1},maxWidth:{default:void 0},modelValue:{},label:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>{const{modelValue:h,disabled:m,...p}=e;return p}),i=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),s=q(e,"modelValue"),l=r.ref(!1),a=r.ref(),d=r.ref(e.collapsible),c=r.ref(e.collapsible);function u(){d.value=!1,r.nextTick(()=>{var h,m,p,g;(g=(p=(m=(h=a.value)==null?void 0:h.querySelector)==null?void 0:m.call(h,"input"))==null?void 0:p.focus)==null||g.call(p)})}function f(h){if(l.value=h,!!e.collapsible){if(h){c.value=!1;return}d.value=s.value.length===0,d.value&&setTimeout(()=>{c.value=!0},250)}}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"componentRoot",ref:a,class:"flex items-center justify-end min-w-48 relative"},[r.createVNode(Ki,r.mergeProps({modelValue:r.unref(s),"onUpdate:modelValue":m[1]||(m[1]=p=>r.isRef(s)?s.value=p:null),class:["transition-all",{"opacity-100":!h.collapsible||!d.value,"opacity-0 pointer-events-none":h.collapsible&&d.value}],disabled:i.value||h.collapsible&&d.value,style:{width:h.collapsible&&d.value?"24px":"100%"}},o.value,{onFocusChanged:f}),r.createSlots({_:2},[l.value?void 0:{name:"prepend",fn:r.withCtx(()=>[r.createVNode(H,{name:"search"})]),key:"0"},r.unref(s).length?{name:"append",fn:r.withCtx(()=>[r.createVNode(H,{class:"cursor-pointer text-fm-color-neutral-gray-300",name:"close",onClick:m[0]||(m[0]=p=>s.value="")})]),key:"1"}:void 0]),1040,["modelValue","class","disabled","style"]),h.collapsible?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["absolute top-0 right-0",d.value?"opacity-100":"opacity-0 pointer-events-none"]),style:r.normalizeStyle({transition:"opacity 150ms",transitionTimingFunction:d.value?"cubic-bezier(.95,-0.01,.82,.6)":"ease-out"})},[r.createVNode(U,{icon:"search",variant:"tertiary",onClick:u})],6)):r.createCommentVNode("",!0)],512))}}),X3={key:0,class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},K3={key:0},Z3={class:"overflow-y-auto"},J3={key:1,class:"flex gap-8 items-center"},vc=J(r.defineComponent({__name:"FmTopSheet",props:{header:{default:""},modelValue:{type:Boolean,default:!1},dismissAway:{type:Boolean,default:!1},fullscreenSize:{default:void 0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=q(e,"modelValue");return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{onClick:i[0]||(i[0]=s=>n.value=!0)},[r.renderSlot(o.$slots,"top-sheet-button",{},void 0,!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.unref(n)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":e.dismissAway,"z-index":e.zIndex,onClose:i[1]||(i[1]=s=>n.value=!1)},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:o.fullscreenSize?`slide-${o.fullscreenSize}`:"slide",appear:""},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-top-sheet",`fm-top-sheet--fullscreen-${o.fullscreenSize}`])},[o.header||o.$slots["top-sheet-header"]?(r.openBlock(),r.createElementBlock("div",X3,[r.renderSlot(o.$slots,"top-sheet-header",{},()=>[o.header?(r.openBlock(),r.createElementBlock("div",K3,r.toDisplayString(o.header),1)):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Z3,[r.renderSlot(o.$slots,"default",{},void 0,!0)]),o.$slots["top-sheet-footer"]?(r.openBlock(),r.createElementBlock("div",J3,[r.renderSlot(o.$slots,"top-sheet-footer",{},void 0,!0)])):r.createCommentVNode("",!0)],2)]),_:3},8,["name"])]),_:3},8,["dismiss-away","z-index"])):r.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-e0521072"]]);var Ji={exports:{}};function Dc(t,e=100,n={}){if(typeof t!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:o}=typeof n=="boolean"?{immediate:n}:n;let i,s,l,a,d;function c(){const f=Date.now()-a;if(f<e&&f>=0)l=setTimeout(c,e-f);else if(l=void 0,!o){const h=i,m=s;i=void 0,s=void 0,d=t.apply(h,m)}}const u=function(...f){if(i&&this!==i)throw new Error("Debounced method called with different contexts.");i=this,s=f,a=Date.now();const h=o&&!l;if(l||(l=setTimeout(c,e)),h){const m=i,p=s;i=void 0,s=void 0,d=t.apply(m,p)}return d};return u.clear=()=>{l&&(clearTimeout(l),l=void 0)},u.flush=()=>{if(!l)return;const f=i,h=s;i=void 0,s=void 0,d=t.apply(f,h),clearTimeout(l),l=void 0},u}Ji.exports.debounce=Dc,Ji.exports=Dc;var Q3=Ji.exports;const Qi=xi(Q3);var Mc={exports:{}};(function(t,e){(function(){var n={};t.exports=n,n.simpleFilter=function(o,i){return i.filter(function(s){return n.test(o,s)})},n.test=function(o,i){return n.match(o,i)!==null},n.match=function(o,i,s){s=s||{};var l=0,a=[],d=i.length,c=0,u=0,f=s.pre||"",h=s.post||"",m=s.caseSensitive&&i||i.toLowerCase(),p;o=s.caseSensitive&&o||o.toLowerCase();for(var g=0;g<d;g++)p=i[g],m[g]===o[l]?(p=f+p+h,l+=1,u+=1+u):u=0,c+=u,a[a.length]=p;return l===o.length?(c=m===o?1/0:c,{rendered:a.join(""),score:c}):null},n.filter=function(o,i,s){return!i||i.length===0?[]:typeof o!="string"?i:(s=s||{},i.reduce(function(l,a,d,c){var u=a;s.extract&&(u=s.extract(a));var f=n.match(o,u,s);return f!=null&&(l[l.length]={string:f.rendered,score:f.score,index:d,original:a}),l},[]).sort(function(l,a){var d=a.score-l.score;return d||l.index-a.index}))}})()})(Mc);var e4=Mc.exports;const t4=xi(e4);function sr(t,e){const[n]=t4.filter(t.toLocaleLowerCase(),[e],{pre:"|",post:"|",extract(i){return i.toLocaleLowerCase()}});if(!n)return{label:e,segments:[{segment:e,isMatch:!1}],matched:!1};const o=n.string.toString().replace(/\|\|/g,"").split("|").reduce((i,s,l)=>(i.push({segment:s,isMatch:l%2!==0}),i),new Array);return{label:e,segments:o,matched:!0}}const n4={class:"flex flex-col gap-4"},o4={class:"bg-white flex gap-4 px-24 py-8 sticky top-0"},r4={class:"hidden sm:inline xs:inline"},i4={key:0},s4={key:0,class:"flex flex-col"},l4={class:"flex flex-col"},a4={class:"flex items-center px-24 py-12"},d4=r.createElementVNode("div",{class:"fm-typo-body-md-400 text-fm-color-typo-secondary"}," Recent search ",-1),c4=r.createElementVNode("div",{class:"py-4"},[r.createElementVNode("hr",{class:"border-fm-color-neutral-gray-100"})],-1),u4=["onClick"],f4={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},h4={class:"fm-typo-body-lg-400 px-24 py-12 text-center text-fm-color-primary"},m4={class:"fm-typo-body-lg-400 px-24 py-12 text-center text-fm-color-typo-secondary"},p4={key:3,class:"flex flex-col"},g4=["onClick"],b4={class:"flex flex-col gap-4"},y4={key:0,class:"text-fm-color-typo-secondary"},$4={class:"px-16 py-4"},w4=5,_4=r.defineComponent({__name:"FmGlobalSearch",props:{show:{type:Boolean,default:!1},modelValue:{default:""},suggestions:{default:void 0},onSearch:{type:Function,default:void 0},placeholder:{default:""},hintPlaceholder:{default:""},notFoundPlaceholder:{default:""},recentSearchKey:{default:""}},emits:["dismiss","submit","update:show","update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function i(){if(!n.recentSearchKey)return;const k=n.recentSearchKey;localStorage.removeItem(k),a.value=[]}function s(){if(!n.recentSearchKey)return;const k=n.recentSearchKey,S=localStorage.getItem(k);if(!S)return[];try{return JSON.parse(S)}catch{return new Array}}const l=Qi(function(S){if(!n.recentSearchKey)return;const w=n.recentSearchKey,$=S().trim();if(!w||!$)return;const B=s()??[],M=[...new Set([$,...B])].slice(0,w4),P=JSON.stringify(M);return localStorage.setItem(w,P),a.value=M,M},800),a=r.ref(s()),d=q(n,"show");r.watch([()=>n.show],()=>{n.show?(f.value=null,n.suggestions&&C()):o("dismiss")});const c=q(n,"modelValue"),u=r.ref(n.modelValue);r.watch([()=>u.value],()=>{_()});const f=r.ref(null),h=r.ref(!0),m=r.computed(()=>{var k;return h.value?(k=f.value)==null?void 0:k.slice(0,5):f.value});r.watch([()=>f.value],([])=>{h.value=!0});const p=r.computed(()=>f.value===null),g=r.ref(!1),b=r.ref(""),y=()=>u.value;async function C(){if(!d.value)return;const k=y();if(!k)return;const S=Math.random().toString();if(b.value=S,n.suggestions){f.value=n.suggestions.map(w=>({label:sr(k,w.label),sublabel:w.sublabel?sr(k,w.sublabel):null})).filter(w=>{var $;return w.label.matched||(($=w.sublabel)==null?void 0:$.matched)}),l(y);return}if(n.onSearch)try{g.value=!0;const w=await n.onSearch(k);S===b.value&&(f.value=w.map($=>({label:sr(k,$.label),sublabel:$.sublabel?sr(k,$.sublabel):null})))}catch{S===b.value&&(f.value=[])}finally{S===b.value&&(g.value=!1,l(y))}}function v(k){d.value=!1,o("dismiss"),c.value=k}const _=Qi(C),x=r.computed(()=>a.value&&a.value.length===0),N=r.computed(()=>(!u.value||p.value)&&!x.value),E=r.computed(()=>(!u.value||p.value)&&x.value),R=r.computed(()=>u.value&&f.value&&f.value.length===0);return(k,S)=>(r.openBlock(),r.createBlock(vc,{"model-value":r.unref(d),"onUpdate:modelValue":S[4]||(S[4]=w=>r.isRef(d)?d.value=w:null),"fullscreen-size":"sm","dismiss-away":""},{default:r.withCtx(()=>{var w,$;return[r.createElementVNode("div",n4,[r.createElementVNode("div",o4,[r.createElementVNode("div",r4,[r.createVNode(U,{"prepend-icon":"arrow_back",variant:"tertiary",onClick:S[0]||(S[0]=B=>d.value=!1)})]),r.createVNode(Zi,{"model-value":u.value,"onUpdate:modelValue":S[1]||(S[1]=B=>u.value=B),class:"flex-1",placeholder:k.placeholder},null,8,["model-value","placeholder"])]),g.value?(r.openBlock(),r.createElementBlock("div",i4,[r.createVNode(Zt,{size:"xl"})])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[N.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[k.recentSearchKey&&((w=a.value)!=null&&w.length)?(r.openBlock(),r.createElementBlock("div",s4,[r.createElementVNode("div",l4,[r.createElementVNode("div",a4,[d4,r.createVNode($t),r.createVNode(U,{label:"Clear history",variant:"plain",size:"md",onClick:S[2]||(S[2]=B=>i())})]),c4]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(B,M)=>(r.openBlock(),r.createElementBlock("div",{key:M,class:"cursor-pointer flex gap-8 hover:bg-fm-color-neutral-gray-100 items-center px-24 py-12",onClick:P=>u.value=B},[r.createVNode(H,{size:"lg",name:"history"}),r.createElementVNode("div",f4,r.toDisplayString(B),1)],8,u4))),128))])])):r.createCommentVNode("",!0)],64)):E.value?r.renderSlot(k.$slots,"hint-placeholder",{key:1},()=>[r.createElementVNode("div",h4,r.toDisplayString(k.hintPlaceholder),1)]):R.value?r.renderSlot(k.$slots,"not-found-placeholder",{key:2},()=>[r.createElementVNode("div",m4,r.toDisplayString(k.notFoundPlaceholder||`No result found for “${u.value}”`),1)]):(r.openBlock(),r.createElementBlock("div",p4,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(B,M)=>r.renderSlot(k.$slots,"search-result-item",r.mergeProps({key:M},{result:B}),()=>[r.createElementVNode("div",{class:"cursor-pointer flex gap-16 hover:bg-fm-color-neutral-gray-100 items-center px-24 py-12 w-full",onClick:P=>v(B.label.label)},[r.createVNode(H,{size:"lg",name:"arrow_forward"}),r.createElementVNode("div",b4,[r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.label.segments,(P,V)=>(r.openBlock(),r.createElementBlock("span",{key:V,class:r.normalizeClass({"fm-typo-body-lg-400":!P.isMatch,"fm-typo-body-lg-700":P.isMatch})},r.toDisplayString(P.segment),3))),128))]),B.sublabel?(r.openBlock(),r.createElementBlock("div",y4,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.sublabel.segments,(P,V)=>(r.openBlock(),r.createElementBlock("span",{key:V,class:r.normalizeClass({"fm-typo-body-md-400":!P.isMatch,"fm-typo-body-md-700":P.isMatch})},r.toDisplayString(P.segment),3))),128))])):r.createCommentVNode("",!0)])],8,g4)])),128)),r.createElementVNode("div",$4,[h.value&&((($=f.value)==null?void 0:$.length)??0)>5?(r.openBlock(),r.createBlock(U,{key:0,label:`show ${f.value.length-5} more results`,variant:"plain",onClick:S[3]||(S[3]=B=>h.value=!1)},null,8,["label"])):r.createCommentVNode("",!0)])]))],64))])]}),_:3},8,["model-value"]))}}),k4=["inputMode","placeholder","readOnly","value","disabled"],C4={key:0},x4=["disabled"],S4=["disabled"],v4=J(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:""},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},useGrouping:{type:Boolean,default:!0},minFractionDigits:{default:0},maxFractionDigits:{default:2},label:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),{isFocused:s,blur:l,focus:a}=bn(),d=r.ref(null);let c;const u=_=>{if(_!==""){const x=+_.replace(/,/g,"");return isNaN(x)?null:x}return null},f=_=>c.format(_),h=_=>{if(typeof i.value!="number"){i.value=+i.value;return}if(_>0&&y.value||_<0&&C.value)return;let x=v(i.value)?i.value+_:0;x=m(x),i.value=x},m=_=>e.max!==void 0&&_>e.max?e.max:e.min!==void 0&&_<e.min?e.min:_,p=()=>{var _;i.value=u(((_=d.value)==null?void 0:_.value)??"")},g=_=>{if(![...Array(10).keys()].map(x=>x.toString()).includes(_.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(_.key)){_.preventDefault();return}},b=r.computed(()=>i.value!=null?f(i.value):""),y=r.computed(()=>{let _=!1;return e.max!==void 0&&(_=i.value>=e.max),e.min!==void 0&&(_=i.value<e.min),_}),C=r.computed(()=>{let _=!1;return e.max!==void 0&&(_=i.value>e.max),e.min!==void 0&&(_=i.value<=e.min),_});r.onBeforeMount(()=>{c=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping,minimumFractionDigits:e.minFractionDigits,maximumFractionDigits:e.maxFractionDigits,roundingMode:"trunc"})});function v(_){return typeof _=="number"&&isFinite(_)}return(_,x)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":x[8]||(x[8]=N=>r.isRef(i)?i.value=N:null),disabled:o.value,focused:r.unref(s),"helper-state":_.helperState,"helper-text":_.helperText,info:_.labelInfo,label:_.label,optional:_.labelMark==="optional",required:_.labelMark==="required",rules:_.rules},{label:r.withCtx(()=>[r.renderSlot(_.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:N})=>[r.createVNode(le,{"append-icon":_.appendIcon,focused:r.unref(s),invalid:N,"prepend-icon":_.prependIcon,"show-valid-border":_.showValidBorder,class:"cursor-text"},{prepend:r.withCtx(()=>[r.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(_.$slots,"append",{},()=>[r.createElementVNode("div",{class:r.normalizeClass([{"mr-32":_.showSteppers},"flex items-center justify-center"])},[_.appendText?(r.openBlock(),r.createElementBlock("div",C4,r.toDisplayString(_.appendText),1)):r.createCommentVNode("",!0),_.appendIcon?(r.openBlock(),r.createBlock(H,{key:1,color:o.value?"#C7C7CC":"#1C1C1E",name:_.appendIcon,size:"md"},null,8,["color","name"])):r.createCommentVNode("",!0)],2)],!0),_.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",type:"button",disabled:o.value||y.value,onBlur:x[2]||(x[2]=(...E)=>r.unref(l)&&r.unref(l)(...E)),onFocus:x[3]||(x[3]=(...E)=>r.unref(a)&&r.unref(a)(...E)),onMousedown:x[4]||(x[4]=()=>h(_.step))},[r.createVNode(H,{color:o.value||y.value?"#C7C7CC":"#1C1C1E",name:"expand_less",size:"md"},null,8,["color"])],40,x4),r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",type:"button",disabled:o.value||C.value,onBlur:x[5]||(x[5]=(...E)=>r.unref(l)&&r.unref(l)(...E)),onFocus:x[6]||(x[6]=(...E)=>r.unref(a)&&r.unref(a)(...E)),onMousedown:x[7]||(x[7]=()=>h(-_.step))},[r.createVNode(H,{color:o.value||C.value?"#C7C7CC":"#1C1C1E",name:"expand_more",size:"md"},null,8,["color"])],40,S4)],2)):r.createCommentVNode("",!0)]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:d,inputMode:_.inputmode,placeholder:_.placeholder,readOnly:_.readonly,value:b.value,class:"fm-stepper-field--input",type:"text",disabled:o.value,onBlur:x[0]||(x[0]=(...E)=>r.unref(l)&&r.unref(l)(...E)),onFocus:x[1]||(x[1]=(...E)=>r.unref(a)&&r.unref(a)(...E)),onInput:p,onKeydown:g},null,40,k4)]),_:2},1032,["append-icon","focused","invalid","prepend-icon","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(_.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),[["__scopeId","data-v-44c0f492"]]),D4=["disabled","maxlength","minlength","placeholder","readOnly","value"],M4=J(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:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),{isFocused:s,focus:l,blur:a}=bn(),d=c=>{i.value=c.target.value};return(c,u)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":u[2]||(u[2]=f=>r.isRef(i)?i.value=f:null),disabled:o.value,focused:r.unref(s),"helper-state":c.helperState,"helper-text":c.helperText,info:c.labelInfo,label:c.label,optional:c.labelMark==="optional",required:c.labelMark==="required",rules:c.rules},r.createSlots({label:r.withCtx(()=>[r.renderSlot(c.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:f})=>[r.createElementVNode("div",{class:r.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":r.unref(s),"fm-textarea__container--invalid":!!r.unref(i)&&f,"fm-textarea__container--valid":c.showValidBorder&&c.showSuccess&&!!r.unref(i)&&!f,"fm-textarea__container--disabled":o.value})},[r.createElementVNode("textarea",{class:r.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!o.value,"fm-color-typo-disabled":o.value}),disabled:o.value,maxlength:c.maxLength,minlength:c.minLength,placeholder:c.placeholder,readOnly:c.readonly,value:r.unref(i),onBlur:u[0]||(u[0]=(...h)=>r.unref(a)&&r.unref(a)(...h)),onFocus:u[1]||(u[1]=(...h)=>r.unref(l)&&r.unref(l)(...h)),onInput:d},null,42,D4)],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text",{},void 0,!0)]),_:2},[c.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([o.value?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(c.maxLength?`${r.unref(i).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),[["__scopeId","data-v-8e783d76"]]),V4={class:"flex flex-col fm-time-input items-center"},B4=["value"],Vc=J(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(t,{emit:e}){const n=t,o=e,i=r.ref();function s(u){i.value&&(i.value.value=u)}r.watch(()=>n.modelValue,s);function l(){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 d(){var u;(u=i.value)==null||u.focus(),o("update:model-value",a(n.modelValue)+1)}function c(){var u;(u=i.value)==null||u.focus(),o("update:model-value",a(n.modelValue)-1)}return(u,f)=>(r.openBlock(),r.createElementBlock("div",V4,[r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[r.createVNode(H,{name:"expand_less",size:"lg"})]),r.createElementVNode("input",{ref_key:"inputRef",ref:i,value:n.modelValue,onInput:l},null,40,B4),r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[r.createVNode(H,{name:"expand_more",size:"lg"})])]))}}),[["__scopeId","data-v-4a0644ef"]]);var Je=(t=>(t.AM="AM",t.PM="PM",t))(Je||{});function Qe(t){return t.toString().padStart(2,"0")}function E4(t){const[e,n]=t.split(":"),o=Number(e),i=Number(n),s=o>11?"PM":"AM";let l=o;return l===0?l=12:l>12&&(l-=12),`${Qe(l)}:${Qe(i)}:${s}`}function Be(t){const[e,n,o]=E4(t).split(":");return{hours:Number(e),minutes:Number(n),period:o}}function es({hours:t,minutes:e,period:n}){let o=t;return n==="PM"?o=t===12?t:t+12:t===12&&(o=0),`${Qe(o)}:${Qe(e)}`}const P4={class:"flex fm-time-input gap-16 items-center"},N4=r.createElementVNode("div",{class:"fm-typo-title-sm-700"},":",-1),F4={class:"fm-time-input-periods"},R4=["onClick"],lr=r.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 l={hours:s.hours??n.modelValue.hours,minutes:s.minutes??n.modelValue.minutes,period:s.period??n.modelValue.period},a=n.modelValue.hours;(a===12&&l.hours===11||a===11&&l.hours===12)&&(l.period=n.modelValue.period===Je.AM?Je.PM:Je.AM),l.hours>12?l.hours=1:l.hours<1&&(l.hours=12),l.minutes>59?l.minutes=0:l.minutes<0&&(l.minutes=59),o("update:model-value",l)}return(s,l)=>(r.openBlock(),r.createElementBlock("div",P4,[r.createVNode(Vc,{"model-value":r.unref(Qe)(t.modelValue.hours),min:1,max:12,"onUpdate:modelValue":l[0]||(l[0]=a=>i({hours:a}))},null,8,["model-value"]),N4,r.createVNode(Vc,{"model-value":r.unref(Qe)(t.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":l[1]||(l[1]=a=>i({minutes:a}))},null,8,["model-value"]),r.createElementVNode("div",F4,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Je),a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:r.normalizeClass([{"fm-time-input-period__selected":a===t.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},r.toDisplayString(a),11,R4))),128))])]))}}),A4={class:"flex gap-8"},O4={class:"bg-fm-color-neutral-white flex flex-col px-24 py-16 rounded-lg shadow-light-300 w-[343px]"},I4=r.createElementVNode("div",{class:"fm-typo-title-sm-700 mb-8"},"Enter time",-1),T4={class:"flex items-center justify-center py-16 w-full"},z4={class:"flex justify-end"},L4=r.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},placeholder:{default:"HH:MM"},zIndex:{default:void 0},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=r.ref(null),l=r.computed(()=>{if(!i.value)return null;const{hours:c,minutes:u,period:f}=Be(i.value);return`${Qe(c)}:${Qe(u)} ${f}`});function a(){if(!s.value){i.value=null;return}const c=es(s.value);i.value=c,d.value=!1}r.onMounted(()=>{i.value&&(s.value=Be(i.value))}),r.watch(()=>i.value,c=>{c&&(s.value=Be(c))});const d=r.ref(!1);return r.watchEffect(()=>{o.value||(d.value?s.value=Be(i.value??"00:00"):s.value=i.value?Be(i.value):null)}),(c,u)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":u[3]||(u[3]=f=>r.isRef(i)?i.value=f:null),disabled:o.value,"disable-auto-focus":"",focused:d.value,"helper-state":c.helperState,"helper-text":c.helperText,info:c.labelInfo,label:c.label,optional:c.labelMark==="optional",required:c.labelMark==="required",rules:c.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(c.$slots,"label")]),default:r.withCtx(({invalid:f})=>[r.createVNode(Vt,{disabled:c.disabled,"show-popover":d.value,"z-index":c.zIndex,onPopoverChanged:u[2]||(u[2]=h=>d.value=h)},{"popover-button":r.withCtx(()=>[c.$slots["trigger-button"]?r.renderSlot(c.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:f,dropdownShowed:d.value,showValidBorder:c.showValidBorder,shouldDisable:o.value}))):(r.openBlock(),r.createBlock(le,{key:1,class:r.normalizeClass(o.value?"cursor-not-allowed":"cursor-pointer"),focused:d.value,invalid:f,"show-valid-border":c.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",A4,[r.createVNode(H,{outline:!d.value,name:"schedule"},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass([{"text-fm-color-typo-disabled":!l.value},"grow"])},r.toDisplayString(l.value??c.placeholder??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",O4,[I4,r.createElementVNode("div",T4,[r.createVNode(lr,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Je).AM},"onUpdate:modelValue":u[0]||(u[0]=h=>s.value=h)},null,8,["model-value"])]),r.createElementVNode("div",z4,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u[1]||(u[1]=h=>d.value=!1)}),r.createVNode(U,{label:"Apply",size:"md",variant:"primary",onClick:a})])])]),_:2},1032,["disabled","show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),H4={class:"flex gap-8"},Y4={class:"bg-fm-color-neutral-white flex flex-col px-24 py-16 rounded-lg shadow-light-300"},j4=r.createElementVNode("div",{class:"fm-typo-title-sm-700 mb-8"},"Enter time",-1),W4={class:"flex flex-col gap-16 items-center justify-center py-16 w-full"},U4=r.createElementVNode("div",{class:"fm-typo-body-lg-700 text-left w-full"}," Starting Time ",-1),G4=r.createElementVNode("div",{class:"fm-typo-body-lg-700 text-left w-full"}," Ending Time ",-1),q4={class:"flex gap-8 items-center justify-end"},X4=r.defineComponent({__name:"FmTimeRangePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},placeholder:{default:"HH:MM"},zIndex:{default:void 0},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:void 0},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=r.inject(ye),o=r.computed(()=>e.disabled??(n==null?void 0:n.getDisabled())??!1),i=q(e,"modelValue"),s=r.ref(null),l=r.ref(null),a=r.computed(()=>{const g=Array.isArray(i.value);return!i.value||!g||g&&i.value.every(b=>!m(b))?null:i.value.map(b=>{const{hours:y,minutes:C,period:v}=Be(b);return`${Qe(y)}:${Qe(C)} ${v}`}).join(" - ")});function d(){if(!s.value||!l.value){i.value=null;return}let g=!1;const b=s.value,y=l.value;(b.period===Je.PM&&y.period===Je.AM||b.period===y.period&&(b.hours<y.hours||b.minutes<y.minutes))&&(g=!0);const C=es(s.value),v=es(l.value);i.value=g?[v,C]:[C,v],u()}r.onMounted(()=>{Array.isArray(i.value)&&i.value.every(g=>!!g)&&(s.value=Be(i.value[0]),l.value=Be(i.value[1]))}),r.watch(()=>i.value,g=>{const b=Array.isArray(g);g&&b&&g.every(y=>m(y))&&(s.value=Be(g[0]),l.value=Be(g[1]))});const c=r.ref();function u(){var g;(g=c.value)==null||g.hide()}const f=r.ref(!1);function h(g){var b,y,C,v;g?(s.value=Be(((C=i.value)==null?void 0:C[0])??"00:00"),l.value=Be(((v=i.value)==null?void 0:v[1])??"23:59")):(s.value=(b=i.value)!=null&&b[0]?Be(i.value[0]):null,l.value=(y=i.value)!=null&&y[1]?Be(i.value[1]):null),f.value=g}const m=g=>/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(g),p=r.computed(()=>Se(s.value,l.value));return(g,b)=>(r.openBlock(),r.createBlock(_e,{modelValue:r.unref(i),"onUpdate:modelValue":b[2]||(b[2]=y=>r.isRef(i)?i.value=y:null),disabled:o.value,focused:f.value,"helper-state":g.helperState,"helper-text":g.helperText,info:g.labelInfo,label:g.label,optional:g.labelMark==="optional",required:g.labelMark==="required",rules:g.rules,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(g.$slots,"label")]),default:r.withCtx(({invalid:y})=>[r.createVNode(Vt,{ref_key:"dropdownRef",ref:c,width:343,"show-popover":f.value,"z-index":e.zIndex,onPopoverChanged:h},{"popover-button":r.withCtx(()=>[g.$slots["trigger-button"]?r.renderSlot(g.$slots,"trigger-button",r.normalizeProps(r.mergeProps({key:0},{invalid:y,dropdownShowed:f.value,showValidBorder:g.showValidBorder,shouldDisable:o.value}))):(r.openBlock(),r.createBlock(le,{key:1,class:r.normalizeClass(o.value?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:y,"show-valid-border":g.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",H4,[r.createVNode(H,{outline:!f.value,name:"schedule"},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass([{"text-fm-color-typo-disabled":!a.value},"grow"])},r.toDisplayString(a.value??g.placeholder??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"]))]),default:r.withCtx(()=>[r.createElementVNode("div",Y4,[j4,r.createElementVNode("div",W4,[r.createElementVNode("div",null,[U4,r.createVNode(lr,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Je).AM},"onUpdate:modelValue":b[0]||(b[0]=C=>s.value=C)},null,8,["model-value"])]),r.createElementVNode("div",null,[G4,r.createVNode(lr,{"model-value":l.value??{hours:0,minutes:0,period:r.unref(Je).AM},"onUpdate:modelValue":b[1]||(b[1]=C=>l.value=C)},null,8,["model-value"])])]),r.createElementVNode("div",q4,[r.createVNode(U,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),r.createVNode(U,{disabled:p.value,label:"Apply",size:"md",variant:"primary",onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-popover","z-index"])]),"helper-text":r.withCtx(()=>[r.renderSlot(g.$slots,"helper-text")]),_:3},8,["modelValue","disabled","focused","helper-state","helper-text","info","label","optional","required","rules"]))}}),ts=J(r.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass({"fm-list--separator":e.separator,activeClass:e.activeClass})},[r.renderSlot(e.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-884ba127"]]),ns=J(r.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},label:{default:""},sublabel:{default:""}},setup(t){const e=t;return(n,o)=>{const i=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createBlock(e.tag,{class:r.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":n.disabled,"cursor-pointer hover:bg-fm-color-opacity-sm":n.clickable&&!n.disabled,"cursor-not-allowed":n.clickable&&n.disabled}),onClick:o[0]||(o[0]=r.withModifiers(()=>{},["prevent"]))},{default:r.withCtx(()=>[r.renderSlot(n.$slots,"prepend",{},void 0,!0),r.renderSlot(n.$slots,"default",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-typo-body-lg-400 line-clamp-1 break-all ${n.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"}`)},r.toDisplayString(n.label),3),n.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-md-400 line-clamp-2 break-all ${n.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"}`)},r.toDisplayString(n.sublabel),3)):r.createCommentVNode("",!0)])],!0),n.$slots.append?(r.openBlock(),r.createBlock($t,{key:0})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"append",{},void 0,!0)]),_:3},8,["class"])),[[i,n.clickable&&!n.disabled]])}}}),[["__scopeId","data-v-90312222"]]);function K4(t){for(;t;){if(Z4(t))return t;t=t.parentElement}return document.scrollingElement}function Z4(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 J4{constructor(e,n){T(this,"onScroll");T(this,"scrollParent");this.onScroll=n,this.scrollParent=K4(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Q4={class:"fm-menu__wrapper"},ew=J(r.defineComponent({__name:"FmMenuDeprecated",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=r.ref(!1),s=r.ref(null),l=r.ref(null),{floatingStyles:a}=Jn(s,l,{middleware:[Gn(4),Zn()],placement:o.placement,whileElementsMounted:Kn});let d;const c=n;e({show:()=>{i.value||(i.value=!0,c("dropdown-changed",i.value))},hide:()=>{i.value&&(i.value=!1,c("dropdown-changed",i.value))}});const u=m=>{m.preventDefault(),m.stopPropagation(),!o.disabled&&(i.value=!i.value,c("dropdown-changed",i.value))},f=m=>{if(!i.value)return;const p=m.path||m.composedPath();for(const g of p)if(g==s.value||g==l.value)return;i.value=!1,c("dropdown-changed",i.value)},h=()=>{c("dropdown-changed",!1)};return r.watch(()=>o.showMenu,m=>i.value=m),r.onMounted(()=>{i.value=o.showMenu,window.addEventListener("click",f),d=new J4(s.value,h),d.bindScroll()}),r.onUnmounted(()=>{window.removeEventListener("click",f),d.unbindScroll()}),(m,p)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:s,class:"fm-menu",onClick:u},[r.renderSlot(m.$slots,"menu-button",{},void 0,!0)],512),i.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuEl",ref:l,class:r.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":i.value}),style:r.normalizeStyle(r.unref(a))},[r.renderSlot(m.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",Q4,[r.renderSlot(m.$slots,"menu-content",{},void 0,!0)])],!0)],6)):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-5b19ece2"]]),tw={class:"fm-typo-body-lg-700 mx-8 p-8 text-fm-color-typo-primary"},nw=r.defineComponent({__name:"FmMenuHeader",props:{label:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(e.label),1))}}),ow=t=>(r.pushScopeId("data-v-c5236366"),t=t(),r.popScopeId(),t),rw={class:"relative"},iw={class:"fm-progress-linear fm-typo-body-sm-400 h-4 overflow-hidden relative rounded-lg w-auto"},sw=ow(()=>r.createElementVNode("span",{class:"bg-fm-color-neutral-gray-100",style:{width:"100%"}},null,-1)),lw=J(r.defineComponent({__name:"FmLinearProgress",props:{color:{default:"primary"}},setup(t){const e=t,n=r.computed(()=>{const o=new Array,i={};return e.color?(mn(e.color)?i["background-color"]=e.color:o.push(`bg-fm-color-${e.color}`),{class:o.join(" "),style:i}):{class:o.join(" "),style:i}});return(o,i)=>(r.openBlock(),r.createElementBlock("div",rw,[r.createElementVNode("div",iw,[sw,r.createElementVNode("span",{class:r.normalizeClass(["dash-1",n.value.class]),style:r.normalizeStyle(n.value.style)},null,6),r.createElementVNode("span",{class:r.normalizeClass(["dash-2",n.value.class]),style:r.normalizeStyle(n.value.style)},null,6)])]))}}),[["__scopeId","data-v-c5236366"]]),aw={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},dw={key:0},cw={class:"h-full overflow-y-auto"},uw={class:"pt-24"},fw=J(r.defineComponent({__name:"FmSideSheet",props:{header:{default:""},modelValue:{type:Boolean,default:!1},dismissAway:{type:Boolean,default:!1},closeButton:{type:Boolean,default:!0},maxWidth:{default:void 0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(t){const e=t,n=q(e,"modelValue");return(o,i)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{onClick:i[0]||(i[0]=s=>n.value=!0)},[r.renderSlot(o.$slots,"side-sheet-button",{},void 0,!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.unref(n)?(r.openBlock(),r.createBlock(gn,{key:0,"dismiss-away":e.dismissAway,"z-index":e.zIndex,onClose:i[2]||(i[2]=s=>n.value=!1)},{default:r.withCtx(()=>[r.createVNode(r.Transition,{appear:"",name:"slide"},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([!o.maxWidth&&"max-w-[400px]","fm-side-sheet"]),style:r.normalizeStyle({maxWidth:`${o.maxWidth}px`})},[r.createElementVNode("div",aw,[r.renderSlot(o.$slots,"side-sheet-header",{},()=>[o.header?(r.openBlock(),r.createElementBlock("div",dw,r.toDisplayString(o.header),1)):r.createCommentVNode("",!0)],!0),o.closeButton?(r.openBlock(),r.createBlock(H,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:i[1]||(i[1]=s=>n.value=!1)})):r.createCommentVNode("",!0)]),r.createElementVNode("div",cw,[r.renderSlot(o.$slots,"default",{},void 0,!0)]),r.createElementVNode("div",uw,[r.renderSlot(o.$slots,"side-sheet-footer",{},void 0,!0)])],6)]),_:3})]),_:3},8,["dismiss-away","z-index"])):r.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-add0e238"]]),hw={class:"flex"},mw={key:0,class:"mt-8"},Bc=J(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(t,{emit:e}){const n=t,o=e,i=r.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=r.computed(()=>n.title?{text:n.title,classes:"fm-typo-body-lg-700"}:{text:n.description,classes:""}),l=r.computed(()=>n.bgColor?mn(n.bgColor)?{style:{backgroundColor:n.bgColor}}:{class:`bg-fm-color-${n.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=r.computed(()=>n.color?mn(n.color)?{style:{color:n.color}}:{class:`text-fm-color-${n.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(d,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(l.value,{class:"fm-corner-radius-lg fm-shadow-light-400 fm-snackbar px-24 py-16"}),[r.createElementVNode("div",hw,[i.value.icon?(r.openBlock(),r.createBlock(H,{key:0,name:i.value.icon.name,color:n.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(`${s.value.classes} grow ellipsis`)},r.toDisplayString(s.value.text),3),n.dismissable?(r.openBlock(),r.createBlock(H,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:c[0]||(c[0]=()=>o("onDismiss"))})):r.createCommentVNode("",!0)]),n.title&&n.description?(r.openBlock(),r.createElementBlock("div",mw,r.toDisplayString(n.description),1)):r.createCommentVNode("",!0),r.renderSlot(d.$slots,"actions",{},()=>[n.action?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[r.createElementVNode("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=()=>o("onAction"))},r.toDisplayString(n.action),1)],16)):r.createCommentVNode("",!0)],!0)],16))}}),[["__scopeId","data-v-e2ff7141"]]),pw={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},os=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(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex flex-col",t.disabled?"text-fm-color-typo-disabled":""])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-step-title line-clamp-2",t.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},r.toDisplayString(t.title),3),t.description?(r.openBlock(),r.createElementBlock("div",pw,r.toDisplayString(t.description),1)):r.createCommentVNode("",!0)],2))}}),gw=["data-title","data-description","data-disabled"],bw={class:"flex fm-step-container gap-12 grow"},yw=J(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(t){const e=t,{currentStep:n,goToStep:o}=r.inject(Os);function i(){s.value||o(e.value)}const s=r.computed(()=>e.disabled?e.disabled():!1),l=r.computed(()=>e.error?e.error():!1),a=r.computed(()=>n()===e.value),d=r.computed(()=>e.complete()),c=r.computed(()=>a.value||d.value||n()>e.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),u=r.computed(()=>a.value?{className:"bg-fm-color-primary"}:l.value?{config:{name:"warning",color:"system-error-300"}}:s.value?{className:"border-2 border-fm-color-neutral-gray-200"}:d.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,h)=>{const m=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{"data-title":t.title,"data-description":t.description,"data-disabled":s.value,class:r.normalizeClass(`fm-step gap-4 grow ${s.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:r.withModifiers(i,["stop"])},[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-step-indicator ${c.value}`)},null,2)]),r.createElementVNode("div",bw,[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]",u.value.className])},[u.value.config?(r.openBlock(),r.createBlock(H,{key:0,name:u.value.config.name,color:u.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):r.createCommentVNode("",!0)],2),r.createVNode(os,{title:t.title,description:t.description,disabled:s.value,class:"grow"},null,8,["title","description","disabled"])])],10,gw)),[[m,!s.value]])}}}),[["__scopeId","data-v-ee172cad"]]),$w={class:"hidden items-center xs:flex"},ww={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},_w=r.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=u=>{o("update:model-value",u)};r.provide(Os,{currentStep:()=>n.modelValue,goToStep:i});const s=r.ref(),l=r.ref([]),a=r.computed(()=>l.value[n.modelValue-1]),d=r.computed(()=>`${n.modelValue} of ${l.value.length}`),c=()=>{var f;const u=Array.from(((f=s.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);l.value=u.map(h=>({title:h.dataset.title??"",description:h.dataset.description,disabled:h.dataset.disabled=="true"}))};return r.onMounted(()=>{c()}),(u,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(`fm-stepper fm-stepper__${t.orientation}`)},[r.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:r.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${t.orientation==="vertical"?"flex-col":""}`)},[r.renderSlot(u.$slots,"default")],2),r.createElementVNode("div",$w,[r.createVNode(Zt,{"current-step":t.modelValue,"total-steps":l.value.length,class:"mr-12"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(d.value),1)]),_:1},8,["current-step","total-steps"]),a.value?(r.openBlock(),r.createBlock(os,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):r.createCommentVNode("",!0)]),u.$slots.contents?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${t.orientation==="vertical"?"w-2/3":""}`)},[r.renderSlot(u.$slots,"contents"),r.createElementVNode("div",ww,[r.renderSlot(u.$slots,"actions")])],2)):r.createCommentVNode("",!0)],2))}});let kw=0;function Cw(){return kw++}const xw=t=>(r.pushScopeId("data-v-57d43f79"),t=t(),r.popScopeId(),t),Sw=["disabled"],vw=[xw(()=>r.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Ec=J(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:()=>Cw()},children:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.ref(!1),o=t,i=e,s=r.ref(!1);function l(f){n.value=f}const a=()=>{o.disabled||o.children.length>0||i("update:modelValue",o.value)},d=f=>{o.children.length!==0&&(s.value=f)},c=r.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,h)=>(r.openBlock(),r.createBlock(Ze,{"show-menu":s.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",onMenuChanged:d},{"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":c.value}]),disabled:f.disabled,type:"button",onMousedown:h[0]||(h[0]=()=>l(!0)),onMouseup:h[1]||(h[1]=()=>l(!1)),onMouseleave:h[2]||(h[2]=()=>l(!1)),onClick:a},[r.renderSlot(f.$slots,"prepend",{},void 0,!0),f.icon?(r.openBlock(),r.createBlock(H,{key:0,name:f.icon,outline:!n.value&&!c.value,color:f.disabled?"neutral-gray-200":c.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 row-start-1 text-left",c.value?"visible":"invisible",f.icon||f.$slots.append?"col-start-2":"col-start-1"])},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 row-start-1 text-left",f.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!c.value||f.disabled?"visible":"invisible",f.icon||f.$slots.append?"col-start-2":"col-start-1"])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0),f.badge?(r.openBlock(),r.createBlock(Ft,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),f.children.length>0?(r.openBlock(),r.createBlock(H,{key:4,size:"md",name:s.value?"expand_less":"expand_more"},null,8,["name"])):r.createCommentVNode("",!0),r.renderSlot(f.$slots,"append",{},void 0,!0),c.value?(r.openBlock(),r.createElementBlock("div",{key:5,class:r.normalizeClass([`fm-tab__indicator__wrapper--${f.vertical?"vertical":"horizontal"}`])},vw,2)):r.createCommentVNode("",!0)],42,Sw)]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,m=>(r.openBlock(),r.createBlock(we,{key:m.value,"model-value":o.modelValue===m.value,label:m.label,icon:m.icon,disabled:m.disabled,onClick:p=>u(m.value)},{append:r.withCtx(()=>[m.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:m.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"]))),128))]),_:3},8,["show-menu","disabled","class","placement"]))}}),[["__scopeId","data-v-57d43f79"]]),Dw={class:"flex gap-8 h-48 items-center justify-end transition-all w-full xs:flex-wrap-reverse"},Mw={class:"flex flex-1 gap-8"},Vw=r.defineComponent({__name:"FmTableToolbar",props:{searchModel:{default:""},searchable:{type:Boolean},filterable:{type:Boolean},chips:{default:()=>[]},actions:{default:()=>[]},zIndexForBottomSheet:{default:void 0}},emits:["update:search-model","click:remove-chip"],setup(t){const e=t,{breakpoints:n}=yt(),o=r.computed(()=>{const a=[];e.searchable&&a.push({label:"Search",icon:"search",key:"search"}),e.filterable&&a.push({label:"Filter",icon:"filter_alt",key:"filter"});const d=a.concat(e.actions);if(n.value.xs){const[p,g,b,...y]=d;return y.length===0?{actionButtons:[p,g,b].filter(C=>C),collapse:y}:{actionButtons:[p,g].filter(C=>C),collapse:[b,...y]}}const[c,u,f,h,...m]=d;return m.length===0?{actionButtons:[c,u,f,h].filter(p=>p),collapse:m}:{actionButtons:[c,u,f].filter(p=>p),collapse:[h,...m]}}),i=r.ref(!1);function s(a){if(n.value.xs){a.stopPropagation(),i.value=!0;return}}const l=q(e,"searchModel");return(a,d)=>(r.openBlock(),r.createElementBlock("div",Dw,[r.renderSlot(a.$slots,"chips",{},()=>[a.chips.length?(r.openBlock(),r.createBlock(Pr,{key:0,class:"min-w-0 mr-auto",items:a.chips,removable:"",onChipClosed:d[0]||(d[0]=c=>a.$emit("click:remove-chip",c))},null,8,["items"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Mw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value.actionButtons,c=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:c.key},[c.key==="search"?r.renderSlot(a.$slots,"action-search",{key:0},()=>[r.createVNode(Zi,{"model-value":r.unref(l),"onUpdate:modelValue":d[1]||(d[1]=u=>r.isRef(l)?l.value=u:null),class:"w-full",collapsible:""},null,8,["model-value"])]):r.renderSlot(a.$slots,`action-${c.key}`,{key:1},()=>[r.createVNode(U,{"prepend-icon":c.icon,variant:"tertiary",onClick:u=>a.$emit(`click:action-${c.key}`)},null,8,["prepend-icon","onClick"])])],64))),128)),o.value.collapse.length?(r.openBlock(),r.createBlock(Ze,{key:0},{"menu-button":r.withCtx(()=>[r.createVNode(U,{"prepend-icon":"more_vert",variant:"tertiary",onClick:s})]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value.collapse,c=>(r.openBlock(),r.createBlock(we,{key:c.key,label:c.label,icon:c.icon,onClick:u=>{a.$emit(`click:action-${c.key}`),i.value=!1}},null,8,["label","icon","onClick"]))),128))]),_:1})):r.createCommentVNode("",!0),a.$slots.append?r.renderSlot(a.$slots,"append",{key:1}):r.createCommentVNode("",!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(Vr,{modelValue:i.value,"onUpdate:modelValue":d[2]||(d[2]=c=>i.value=c),"dismiss-away":"","z-index":e.zIndexForBottomSheet},{default:r.withCtx(()=>[r.createVNode(ts,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value.collapse,c=>(r.openBlock(),r.createBlock(ns,{key:c.key,label:c.label,class:"hover:bg-fm-color-neutral-gray-100",onClick:u=>{a.$emit(`click:action-${c.key}`),i.value=!1}},null,8,["label","onClick"]))),128))]),_:1})]),_:1},8,["modelValue","z-index"])]))]))}});/**
34
34
  * table-core
35
35
  *
36
36
  * Copyright (c) TanStack
@@ -42,7 +42,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
42
42
  */function Bt(t,e){return typeof t=="function"?t(e):t}function Re(t,e){return n=>{e.setState(o=>({...o,[t]:Bt(n,o[t])}))}}function ar(t){return t instanceof Function}function Bw(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Ew(t,e){const n=[],o=i=>{i.forEach(s=>{n.push(s);const l=e(s);l!=null&&l.length&&o(l)})};return o(t),n}function Y(t,e,n){let o=[],i;return s=>{let l;n.key&&n.debug&&(l=Date.now());const a=t(s);if(!(a.length!==o.length||a.some((u,f)=>o[f]!==u)))return i;o=a;let c;if(n.key&&n.debug&&(c=Date.now()),i=e(...a),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-l)*100)/100,f=Math.round((Date.now()-c)*100)/100,h=f/16,m=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${m(f,5)} /${m(u,5)} ms`,`
43
43
  font-size: .6rem;
44
44
  font-weight: bold;
45
- color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function j(t,e,n,o){return{debug:()=>{var i;return(i=t==null?void 0:t.debugAll)!=null?i:t[e]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function Pw(t,e,n,o){const i=()=>{var l;return(l=s.getValue())!=null?l:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:i,getContext:Y(()=>[t,n,e,s],(l,a,d,c)=>({table:l,column:a,row:d,cell:c,getValue:c.getValue,renderValue:c.renderValue}),j(t.options,"debugCells","cell.getContext"))};return t._features.forEach(l=>{l.createCell==null||l.createCell(s,n,e,t)},{}),s}function Nw(t,e,n,o){var i,s;const a={...t._getDefaultColumnDef(),...e},d=a.accessorKey;let c=(i=(s=a.id)!=null?s:d?d.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:d&&(d.includes(".")?u=h=>{let m=h;for(const g of d.split(".")){var p;m=(p=m)==null?void 0:p[g],process.env.NODE_ENV!=="production"&&m===void 0&&console.warn(`"${g}" in deeply nested key "${d}" returned undefined.`)}return m}:u=h=>h[a.accessorKey]),!c)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(c)}`,accessorFn:u,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:Y(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(m=>m.getFlatColumns())]},j(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[t._getOrderColumnsFn()],h=>{var m;if((m=f.columns)!=null&&m.length){let p=f.columns.flatMap(g=>g.getLeafColumns());return h(p)}return[f]},j(t.options,"debugColumns","column.getLeafColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(f,t);return f}const ve="debugHeaders";function Pc(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 l=[],a=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(a),l.push(d)};return a(s),l},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(l=>{l.createHeader==null||l.createHeader(s,t)}),s}const Fw={createTable:t=>{t.getHeaderGroups=Y(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,i)=>{var s,l;const a=(s=o==null?void 0:o.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?s:[],d=(l=i==null?void 0:i.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?l:[],c=n.filter(f=>!(o!=null&&o.includes(f.id))&&!(i!=null&&i.includes(f.id)));return dr(e,[...a,...c,...d],t)},j(t.options,ve,"getHeaderGroups")),t.getCenterHeaderGroups=Y(()=>[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))),dr(e,n,t,"center")),j(t.options,ve,"getCenterHeaderGroups")),t.getLeftHeaderGroups=Y(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return dr(e,s,t,"left")},j(t.options,ve,"getLeftHeaderGroups")),t.getRightHeaderGroups=Y(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return dr(e,s,t,"right")},j(t.options,ve,"getRightHeaderGroups")),t.getFooterGroups=Y(()=>[t.getHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getFooterGroups")),t.getLeftFooterGroups=Y(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getLeftFooterGroups")),t.getCenterFooterGroups=Y(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getCenterFooterGroups")),t.getRightFooterGroups=Y(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getRightFooterGroups")),t.getFlatHeaders=Y(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getFlatHeaders")),t.getLeftFlatHeaders=Y(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getLeftFlatHeaders")),t.getCenterFlatHeaders=Y(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getCenterFlatHeaders")),t.getRightFlatHeaders=Y(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getRightFlatHeaders")),t.getCenterLeafHeaders=Y(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),j(t.options,ve,"getCenterLeafHeaders")),t.getLeftLeafHeaders=Y(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),j(t.options,ve,"getLeftLeafHeaders")),t.getRightLeafHeaders=Y(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),j(t.options,ve,"getRightLeafHeaders")),t.getLeafHeaders=Y(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var i,s,l,a,d,c;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(d=(c=o[0])==null?void 0:c.headers)!=null?d:[]].map(u=>u.getLeafHeaders()).flat()},j(t.options,ve,"getLeafHeaders"))}};function dr(t,e,n,o){var i,s;let l=0;const a=function(h,m){m===void 0&&(m=1),l=Math.max(l,m),h.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,m+1)},0)};a(t);let d=[];const c=(h,m)=>{const p={depth:m,id:[o,`${m}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(b=>{const y=[...g].reverse()[0],k=b.column.depth===p.depth;let M,w=!1;if(k&&b.column.parent?M=b.column.parent:(M=b.column,w=!0),y&&(y==null?void 0:y.column)===M)y.subHeaders.push(b);else{const _=Pc(n,M,{id:[o,m,M.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:w,placeholderId:w?`${g.filter(F=>F.column===M).length}`:void 0,depth:m,index:g.length});_.subHeaders.push(b),g.push(_)}p.headers.push(b),b.headerGroup=p}),d.push(p),m>0&&c(g,m-1)},u=e.map((h,m)=>Pc(n,h,{depth:l,index:m}));c(u,l-1),d.reverse();const f=h=>h.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,b=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],f(p.subHeaders).forEach(M=>{let{colSpan:w,rowSpan:_}=M;g+=w,y.push(_)})):g=1;const k=Math.min(...y);return b=b+k,p.colSpan=g,p.rowSpan=b,{colSpan:g,rowSpan:b}});return f((i=(s=d[0])==null?void 0:s.headers)!=null?i:[]),d}const rs=(t,e,n,o,i,s,l)=>{let a={id:e,index:o,original:n,depth:i,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(a._valuesCache.hasOwnProperty(d))return a._valuesCache[d];const c=t.getColumn(d);if(c!=null&&c.accessorFn)return a._valuesCache[d]=c.accessorFn(a.original,o),a._valuesCache[d]},getUniqueValues:d=>{if(a._uniqueValuesCache.hasOwnProperty(d))return a._uniqueValuesCache[d];const c=t.getColumn(d);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[d]=c.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[d]):(a._uniqueValuesCache[d]=[a.getValue(d)],a._uniqueValuesCache[d])},renderValue:d=>{var c;return(c=a.getValue(d))!=null?c:t.options.renderFallbackValue},subRows:s??[],getLeafRows:()=>Ew(a.subRows,d=>d.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let d=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;d.push(u),c=u}return d.reverse()},getAllCells:Y(()=>[t.getAllLeafColumns()],d=>d.map(c=>Pw(t,a,c,c.id)),j(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],d=>d.reduce((c,u)=>(c[u.column.id]=u,c),{}),j(t.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<t._features.length;d++){const c=t._features[d];c==null||c.createRow==null||c.createRow(a,t)}return a},Rw={createColumn:(t,e)=>{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()}}},Nc=(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))};Nc.autoRemove=t=>We(t);const Fc=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};Fc.autoRemove=t=>We(t);const Rc=(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())};Rc.autoRemove=t=>We(t);const Ac=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};Ac.autoRemove=t=>We(t)||!(t!=null&&t.length);const Oc=(t,e,n)=>!n.some(o=>{var i;return!((i=t.getValue(e))!=null&&i.includes(o))});Oc.autoRemove=t=>We(t)||!(t!=null&&t.length);const Ic=(t,e,n)=>n.some(o=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(o)});Ic.autoRemove=t=>We(t)||!(t!=null&&t.length);const Tc=(t,e,n)=>t.getValue(e)===n;Tc.autoRemove=t=>We(t);const zc=(t,e,n)=>t.getValue(e)==n;zc.autoRemove=t=>We(t);const is=(t,e,n)=>{let[o,i]=n;const s=t.getValue(e);return s>=o&&s<=i};is.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,l=n===null||Number.isNaN(i)?1/0:i;if(s>l){const a=s;s=l,l=a}return[s,l]},is.autoRemove=t=>We(t)||We(t[0])&&We(t[1]);const mt={includesString:Nc,includesStringSensitive:Fc,equalsString:Rc,arrIncludes:Ac,arrIncludesAll:Oc,arrIncludesSome:Ic,equals:Tc,weakEquals:zc,inNumberRange:is};function We(t){return t==null||t===""}const Aw={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Re("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);return typeof o=="string"?mt.includesString:typeof o=="number"?mt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?mt.equals:Array.isArray(o)?mt.arrIncludes:mt.weakEquals},t.getFilterFn=()=>{var n,o;return ar(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:mt[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.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),l=Bt(n,s?s.value:void 0);if(Lc(i,l,t)){var a;return(a=o==null?void 0:o.filter(u=>u.id!==t.id))!=null?a:[]}const d={id:t.id,value:l};if(s){var c;return(c=o==null?void 0:o.map(u=>u.id===t.id?d:u))!=null?c:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=i=>{var s;return(s=Bt(e,i))==null?void 0:s.filter(l=>{const a=n.find(d=>d.id===l.id);if(a){const d=a.getFilterFn();if(Lc(d,l.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},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())}};function Lc(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const ss={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 l=s.getValue(t);l!=null&&(o===void 0?l>=l&&(o=i=l):(o>l&&(o=l),i<l&&(i=l)))}),[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(!Bw(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),i=n.sort((s,l)=>s-l);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},Ow={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:Re("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;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((o=e.options.enableGrouping)!=null?o:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},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 ss.sum;if(Object.prototype.toString.call(o)==="[object Date]")return ss.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return ar(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:ss[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 Iw(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(l=>l.id===s)).filter(Boolean),...o]}const Tw={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Re("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Y(n=>[no(e,n)],n=>n.findIndex(o=>o.id===t.id),j(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var o;return((o=no(e,n)[0])==null?void 0:o.id)===t.id},t.getIsLastColumn=n=>{var o;const i=no(e,n);return((o=i[i.length-1])==null?void 0:o.id)===t.id}},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=Y(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const l=[...e],a=[...i];for(;a.length&&l.length;){const d=l.shift(),c=a.findIndex(u=>u.id===d);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Iw(s,n,o)},j(t.options,"debugTable","_getOrderColumnsFn"))}},ls=()=>({left:[],right:[]}),zw={getInitialState:t=>({columnPinning:ls(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Re("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,l;if(n==="right"){var a,d;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((d=i==null?void 0:i.right)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(n==="left"){var c,u;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).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:((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(o!=null&&o.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var i,s,l;return((i=o.columnDef.enablePinning)!=null?i:!0)&&((s=(l=e.options.enableColumnPinning)!=null?l: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)),l=n.some(a=>i==null?void 0:i.includes(a));return s?"left":l?"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.getCenterVisibleCells=Y(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,i)=>{const s=[...o??[],...i??[]];return n.filter(l=>!s.includes(l.column.id))},j(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=Y(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,o)=>(o??[]).map(s=>n.find(l=>l.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),j(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=Y(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(l=>l.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),j(e.options,"debugRows","getRightVisibleCells"))},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?ls():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:ls())},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=Y(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),j(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=Y(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),j(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=Y(()=>[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))},j(t.options,"debugColumns","getCenterLeafColumns"))}},cr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},as=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Lw={getDefaultColumnDef:()=>cr,getInitialState:t=>({columnSizing:{},columnSizingInfo:as(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Re("columnSizing",t),onColumnSizingInfoChange:Re("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:cr.minSize,(o=s??t.columnDef.size)!=null?o:cr.size),(i=t.columnDef.maxSize)!=null?i:cr.maxSize)},t.getStart=Y(n=>[n,no(e,n),e.getState().columnSizing],(n,o)=>o.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),j(e.options,"debugColumns","getStart")),t.getAfter=Y(n=>[n,no(e,n),e.getState().columnSizing],(n,o)=>o.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),j(e.options,"debugColumns","getAfter")),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=n=>{const o=e.getColumn(t.column.id),i=o==null?void 0:o.getCanResize();return s=>{if(!o||!i||(s.persist==null||s.persist(),ds(s)&&s.touches&&s.touches.length>1))return;const l=t.getSize(),a=t?t.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],d=ds(s)?Math.round(s.touches[0].clientX):s.clientX,c={},u=(y,k)=>{typeof k=="number"&&(e.setColumnSizingInfo(M=>{var w,_;const F=e.options.columnResizeDirection==="rtl"?-1:1,$=(k-((w=M==null?void 0:M.startOffset)!=null?w:0))*F,S=Math.max($/((_=M==null?void 0:M.startSize)!=null?_:0),-.999999);return M.columnSizingStart.forEach(D=>{let[v,x]=D;c[v]=Math.round(Math.max(x+x*S,0)*100)/100}),{...M,deltaOffset:$,deltaPercentage:S}}),(e.options.columnResizeMode==="onChange"||y==="end")&&e.setColumnSizing(M=>({...M,...c})))},f=y=>u("move",y),h=y=>{u("end",y),e.setColumnSizingInfo(k=>({...k,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=n||typeof document<"u"?document:null,p={moveHandler:y=>f(y.clientX),upHandler:y=>{m==null||m.removeEventListener("mousemove",p.moveHandler),m==null||m.removeEventListener("mouseup",p.upHandler),h(y.clientX)}},g={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),f(y.touches[0].clientX),!1),upHandler:y=>{var k;m==null||m.removeEventListener("touchmove",g.moveHandler),m==null||m.removeEventListener("touchend",g.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((k=y.touches[0])==null?void 0:k.clientX)}},b=Hw()?{passive:!1}:!1;ds(s)?(m==null||m.addEventListener("touchmove",g.moveHandler,b),m==null||m.addEventListener("touchend",g.upHandler,b)):(m==null||m.addEventListener("mousemove",p.moveHandler,b),m==null||m.addEventListener("mouseup",p.upHandler,b)),e.setColumnSizingInfo(y=>({...y,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:o.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?as():(n=t.initialState.columnSizingInfo)!=null?n:as())},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 ur=null;function Hw(){if(typeof ur=="boolean")return ur;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 ur=t,ur}function ds(t){return t.type==="touchstart"}const Yw={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Re("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(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=Y(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),j(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=Y(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,i)=>[...n,...o,...i],j(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,o)=>Y(()=>[o(),o().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),j(t.options,"debugColumns",n));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)}}};function no(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const jw={createTable:t=>{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()}}},Ww={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Re("globalFilter",t),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.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}},createTable:t=>{t.getGlobalAutoFilterFn=()=>mt.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return ar(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:mt[o]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Uw={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Re("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 l=s.split(".");o=Math.max(o,l.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 l={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=o,n=(i=n)!=null?i:!s,!s&&n)return{...l,[t.id]:!0};if(s&&!n){const{[t.id]:a,...d}=l;return d}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()}}}},cs=0,us=10,fs=()=>({pageIndex:cs,pageSize:us}),Gw={getInitialState:t=>({...t,pagination:{...fs(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Re("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=>Bt(o,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=o=>{var i;t.setPagination(o?fs():(i=t.initialState.pagination)!=null?i:fs())},t.setPageIndex=o=>{t.setPagination(i=>{let s=Bt(o,i.pageIndex);const l=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,l)),{...i,pageIndex:s}})},t.resetPageIndex=o=>{var i,s;t.setPageIndex(o?cs:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:cs)},t.resetPageSize=o=>{var i,s;t.setPageSize(o?us:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:us)},t.setPageSize=o=>{t.setPagination(i=>{const s=Math.max(1,Bt(o,i.pageSize)),l=i.pageSize*i.pageIndex,a=Math.floor(l/s);return{...i,pageIndex:a,pageSize:s}})},t.setPageCount=o=>t.setPagination(i=>{var s;let l=Bt(o,(s=t.options.pageCount)!=null?s:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...i,pageCount:l}}),t.getPageOptions=Y(()=>[t.getPageCount()],o=>{let i=[];return o&&o>0&&(i=[...new Array(o)].fill(null).map((s,l)=>l)),i},j(t.options,"debugTable","getPageOptions")),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.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-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.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var o;return(o=t.options.rowCount)!=null?o:t.getPrePaginationRowModel().rows.length}}},hs=()=>({top:[],bottom:[]}),qw={getInitialState:t=>({rowPinning:hs(),...t}),getDefaultOptions:t=>({onRowPinningChange:Re("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,o,i)=>{const s=o?t.getLeafRows().map(d=>{let{id:c}=d;return c}):[],l=i?t.getParentRows().map(d=>{let{id:c}=d;return c}):[],a=new Set([...l,t.id,...s]);e.setRowPinning(d=>{var c,u;if(n==="bottom"){var f,h;return{top:((f=d==null?void 0:d.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((h=d==null?void 0:d.bottom)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var m,p;return{top:[...((m=d==null?void 0:d.top)!=null?m:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=d==null?void 0:d.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=d==null?void 0:d.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},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)),l=n.some(a=>i==null?void 0:i.includes(a));return s?"top":l?"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(l=>{let{id:a}=l;return a});return(o=s==null?void 0:s.indexOf(t.id))!=null?o:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?hs():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:hs())},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=Y(e=>[t.getRowModel().rows,t.getState().rowPinning[e],e],(e,n,o)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(l=>{const a=t.getRow(l,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(l=>e.find(a=>a.id===l))).filter(Boolean).map(l=>({...l,position:o}))},j(t.options,"debugRows","_getPinnedRows")),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=Y(()=>[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))},j(t.options,"debugRows","getCenterRows"))}},Xw={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Re("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=>{ms(i,s.id,o,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Y(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?ps(t,n):{rows:[],flatRows:[],rowsById:{}},j(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=Y(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?ps(t,n):{rows:[],flatRows:[],rowsById:{}},j(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=Y(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?ps(t,n):{rows:[],flatRows:[],rowsById:{}},j(t.options,"debugTable","getGroupedSelectedRowModel")),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 l;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const a={...s};return ms(a,t.id,n,(l=o==null?void 0:o.selectChildren)!=null?l:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return gs(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return bs(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return bs(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)}}}},ms=(t,e,n,o,i)=>{var s;const l=i.getRow(e,!0);n?(l.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),l.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(s=l.subRows)!=null&&s.length&&l.getCanSelectSubRows()&&l.subRows.forEach(a=>ms(t,a.id,n,o,i))};function ps(t,e){const n=t.getState().rowSelection,o=[],i={},s=function(l,a){return l.map(d=>{var c;const u=gs(d,n);if(u&&(o.push(d),i[d.id]=d),(c=d.subRows)!=null&&c.length&&(d={...d,subRows:s(d.subRows)}),u)return d}).filter(Boolean)};return{rows:s(e.rows),flatRows:o,rowsById:i}}function gs(t,e){var n;return(n=e[t.id])!=null?n:!1}function bs(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let i=!0,s=!1;return t.subRows.forEach(l=>{if(!(s&&!i)&&(l.getCanSelect()&&(gs(l,e)?s=!0:i=!1),l.subRows&&l.subRows.length)){const a=bs(l,e);a==="all"?s=!0:(a==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const ys=/([0-9]+)/gm,Kw=(t,e,n)=>Hc(Et(t.getValue(n)).toLowerCase(),Et(e.getValue(n)).toLowerCase()),Zw=(t,e,n)=>Hc(Et(t.getValue(n)),Et(e.getValue(n))),Jw=(t,e,n)=>$s(Et(t.getValue(n)).toLowerCase(),Et(e.getValue(n)).toLowerCase()),Qw=(t,e,n)=>$s(Et(t.getValue(n)),Et(e.getValue(n))),e_=(t,e,n)=>{const o=t.getValue(n),i=e.getValue(n);return o>i?1:o<i?-1:0},t_=(t,e,n)=>$s(t.getValue(n),e.getValue(n));function $s(t,e){return t===e?0:t>e?1:-1}function Et(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function Hc(t,e){const n=t.split(ys).filter(Boolean),o=e.split(ys).filter(Boolean);for(;n.length&&o.length;){const i=n.shift(),s=o.shift(),l=parseInt(i,10),a=parseInt(s,10),d=[l,a].sort();if(isNaN(d[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(d[1]))return isNaN(l)?-1:1;if(l>a)return 1;if(a>l)return-1}return n.length-o.length}const oo={alphanumeric:Kw,alphanumericCaseSensitive:Zw,text:Jw,textCaseSensitive:Qw,datetime:e_,basic:t_},n_=[Fw,Yw,Tw,zw,Rw,Aw,jw,Ww,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Re("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 oo.datetime;if(typeof s=="string"&&(o=!0,s.split(ys).length>1))return oo.alphanumeric}return o?oo.text:oo.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 ar(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:oo[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(l=>{const a=l==null?void 0:l.find(m=>m.id===t.id),d=l==null?void 0:l.findIndex(m=>m.id===t.id);let c=[],u,f=s?n:i==="desc";if(l!=null&&l.length&&t.getCanMultiSort()&&o?a?u="toggle":u="add":l!=null&&l.length&&d!==l.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(s||i||(u="remove")),u==="add"){var h;c=[...l,{id:t.id,desc:f}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=l.map(m=>m.id===t.id?{...m,desc:f}:m):u==="remove"?c=l.filter(m=>m.id!==t.id):c=[{id:t.id,desc:f}];return c})},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(),l=t.getIsSorted();return l?l!==s&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:l==="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())}},Ow,Uw,Gw,qw,Xw,Lw];function o_(t){var e,n;process.env.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const o=[...n_,...(e=t._features)!=null?e:[]];let i={_features:o};const s=i._features.reduce((h,m)=>Object.assign(h,m.getDefaultOptions==null?void 0:m.getDefaultOptions(i)),{}),l=h=>i.options.mergeOptions?i.options.mergeOptions(s,h):{...s,...h};let d={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(h=>{var m;d=(m=h.getInitialState==null?void 0:h.getInitialState(d))!=null?m:d});const c=[];let u=!1;const f={_features:o,options:{...s,...t},initialState:d,_queue:h=>{c.push(h),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const m=Bt(h,i.options);i.options=l(m)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,m,p)=>{var g;return(g=i.options.getRowId==null?void 0:i.options.getRowId(h,m,p))!=null?g:`${p?[p.id,m].join("."):m}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,m)=>{let p=(m?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!p&&(p=i.getCoreRowModel().rowsById[h],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return p},_getDefaultColumnDef:Y(()=>[i.options.defaultColumn],h=>{var m;return h=(m=h)!=null?m:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,b;return(g=(b=p.renderValue())==null||b.toString==null?void 0:b.toString())!=null?g:null},...i._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},j(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:Y(()=>[i._getColumnDefs()],h=>{const m=function(p,g,b){return b===void 0&&(b=0),p.map(y=>{const k=Nw(i,y,b,g),M=y;return k.columns=M.columns?m(M.columns,k,b+1):[],k})};return m(h)},j(t,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[i.getAllColumns()],h=>h.flatMap(m=>m.getFlatColumns()),j(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[i.getAllFlatColumns()],h=>h.reduce((m,p)=>(m[p.id]=p,m),{}),j(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,m)=>{let p=h.flatMap(g=>g.getLeafColumns());return m(p)},j(t,"debugColumns","getAllLeafColumns")),getColumn:h=>{const m=i._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!m&&console.error(`[Table] Column with id '${h}' does not exist.`),m}};Object.assign(i,f);for(let h=0;h<i._features.length;h++){const m=i._features[h];m==null||m.createTable==null||m.createTable(i)}return i}function r_(){return t=>Y(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(i,s,l){s===void 0&&(s=0);const a=[];for(let c=0;c<i.length;c++){const u=rs(t,t._getRowId(i[c],c,l),i[c],c,s,void 0,l==null?void 0:l.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var d;u.originalSubRows=t.options.getSubRows(i[c],c),(d=u.originalSubRows)!=null&&d.length&&(u.subRows=o(u.originalSubRows,s+1,u))}}return a};return n.rows=o(e),n},j(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function i_(){return t=>Y(()=>[t.getState().expanded,t.getPreExpandedRowModel(),t.options.paginateExpandedRows],(e,n,o)=>!n.rows.length||e!==!0&&!Object.keys(e??{}).length||!o?n:Yc(n),j(t.options,"debugTable","getExpandedRowModel"))}function Yc(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 s_(t,e,n){return n.options.filterFromLeafRows?l_(t,e,n):a_(t,e,n)}function l_(t,e,n){var o;const i=[],s={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,c){c===void 0&&(c=0);const u=[];for(let h=0;h<d.length;h++){var f;let m=d[h];const p=rs(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(p.columnFilters=m.columnFilters,(f=m.subRows)!=null&&f.length&&c<l){if(p.subRows=a(m.subRows,c+1),m=p,e(m)&&!p.subRows.length){u.push(m),s[m.id]=m,i.push(m);continue}if(e(m)||p.subRows.length){u.push(m),s[m.id]=m,i.push(m);continue}}else m=p,e(m)&&(u.push(m),s[m.id]=m,i.push(m))}return u};return{rows:a(t),flatRows:i,rowsById:s}}function a_(t,e,n){var o;const i=[],s={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,c){c===void 0&&(c=0);const u=[];for(let h=0;h<d.length;h++){let m=d[h];if(e(m)){var f;if((f=m.subRows)!=null&&f.length&&c<l){const g=rs(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);g.subRows=a(m.subRows,c+1),m=g}u.push(m),i.push(m),s[m.id]=m}}return u};return{rows:a(t),flatRows:i,rowsById:s}}function d_(){return t=>Y(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const i=[],s=[];(n??[]).forEach(h=>{var m;const p=t.getColumn(h.id);if(!p)return;const g=p.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}i.push({id:h.id,filterFn:g,resolvedValue:(m=g.resolveFilterValue==null?void 0:g.resolveFilterValue(h.value))!=null?m:h.value})});const l=n.map(h=>h.id),a=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());o&&a&&d.length&&(l.push("__global__"),d.forEach(h=>{var m;s.push({id:h.id,filterFn:a,resolvedValue:(m=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?m:o})}));let c,u;for(let h=0;h<e.flatRows.length;h++){const m=e.flatRows[h];if(m.columnFilters={},i.length)for(let p=0;p<i.length;p++){c=i[p];const g=c.id;m.columnFilters[g]=c.filterFn(m,g,c.resolvedValue,b=>{m.columnFiltersMeta[g]=b})}if(s.length){for(let p=0;p<s.length;p++){u=s[p];const g=u.id;if(u.filterFn(m,g,u.resolvedValue,b=>{m.columnFiltersMeta[g]=b})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const f=h=>{for(let m=0;m<l.length;m++)if(h.columnFilters[l[m]]===!1)return!1;return!0};return s_(e.rows,f,t)},j(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function c_(t){return e=>Y(()=>[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:l,flatRows:a,rowsById:d}=o;const c=i*s,u=c+i;l=l.slice(c,u);let f;e.options.paginateExpandedRows?f={rows:l,flatRows:a,rowsById:d}:f=Yc({rows:l,flatRows:a,rowsById:d}),f.flatRows=[];const h=m=>{f.flatRows.push(m),m.subRows.length&&m.subRows.forEach(h)};return f.rows.forEach(h),f},j(e.options,"debugTable","getPaginationRowModel"))}function u_(){return t=>Y(()=>[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(d=>{var c;return(c=t.getColumn(d.id))==null?void 0:c.getCanSort()}),l={};s.forEach(d=>{const c=t.getColumn(d.id);c&&(l[d.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=d=>{const c=d.map(u=>({...u}));return c.sort((u,f)=>{for(let m=0;m<s.length;m+=1){var h;const p=s[m],g=l[p.id],b=g.sortUndefined,y=(h=p==null?void 0:p.desc)!=null?h:!1;let k=0;if(b){const M=u.getValue(p.id),w=f.getValue(p.id),_=M===void 0,F=w===void 0;if(_||F){if(b==="first")return _?-1:1;if(b==="last")return _?1:-1;k=_&&F?0:_?b:-b}}if(k===0&&(k=g.sortingFn(u,f,p.id)),k!==0)return y&&(k*=-1),g.invertSorting&&(k*=-1),k}return u.index-f.index}),c.forEach(u=>{var f;i.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},j(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/**
45
+ color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function j(t,e,n,o){return{debug:()=>{var i;return(i=t==null?void 0:t.debugAll)!=null?i:t[e]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function Pw(t,e,n,o){const i=()=>{var l;return(l=s.getValue())!=null?l:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:i,getContext:Y(()=>[t,n,e,s],(l,a,d,c)=>({table:l,column:a,row:d,cell:c,getValue:c.getValue,renderValue:c.renderValue}),j(t.options,"debugCells","cell.getContext"))};return t._features.forEach(l=>{l.createCell==null||l.createCell(s,n,e,t)},{}),s}function Nw(t,e,n,o){var i,s;const a={...t._getDefaultColumnDef(),...e},d=a.accessorKey;let c=(i=(s=a.id)!=null?s:d?d.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:d&&(d.includes(".")?u=h=>{let m=h;for(const g of d.split(".")){var p;m=(p=m)==null?void 0:p[g],process.env.NODE_ENV!=="production"&&m===void 0&&console.warn(`"${g}" in deeply nested key "${d}" returned undefined.`)}return m}:u=h=>h[a.accessorKey]),!c)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(c)}`,accessorFn:u,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:Y(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(m=>m.getFlatColumns())]},j(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[t._getOrderColumnsFn()],h=>{var m;if((m=f.columns)!=null&&m.length){let p=f.columns.flatMap(g=>g.getLeafColumns());return h(p)}return[f]},j(t.options,"debugColumns","column.getLeafColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(f,t);return f}const ve="debugHeaders";function Pc(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 l=[],a=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(a),l.push(d)};return a(s),l},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(l=>{l.createHeader==null||l.createHeader(s,t)}),s}const Fw={createTable:t=>{t.getHeaderGroups=Y(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,i)=>{var s,l;const a=(s=o==null?void 0:o.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?s:[],d=(l=i==null?void 0:i.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?l:[],c=n.filter(f=>!(o!=null&&o.includes(f.id))&&!(i!=null&&i.includes(f.id)));return dr(e,[...a,...c,...d],t)},j(t.options,ve,"getHeaderGroups")),t.getCenterHeaderGroups=Y(()=>[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))),dr(e,n,t,"center")),j(t.options,ve,"getCenterHeaderGroups")),t.getLeftHeaderGroups=Y(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return dr(e,s,t,"left")},j(t.options,ve,"getLeftHeaderGroups")),t.getRightHeaderGroups=Y(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return dr(e,s,t,"right")},j(t.options,ve,"getRightHeaderGroups")),t.getFooterGroups=Y(()=>[t.getHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getFooterGroups")),t.getLeftFooterGroups=Y(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getLeftFooterGroups")),t.getCenterFooterGroups=Y(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getCenterFooterGroups")),t.getRightFooterGroups=Y(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),j(t.options,ve,"getRightFooterGroups")),t.getFlatHeaders=Y(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getFlatHeaders")),t.getLeftFlatHeaders=Y(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getLeftFlatHeaders")),t.getCenterFlatHeaders=Y(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getCenterFlatHeaders")),t.getRightFlatHeaders=Y(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),j(t.options,ve,"getRightFlatHeaders")),t.getCenterLeafHeaders=Y(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),j(t.options,ve,"getCenterLeafHeaders")),t.getLeftLeafHeaders=Y(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),j(t.options,ve,"getLeftLeafHeaders")),t.getRightLeafHeaders=Y(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),j(t.options,ve,"getRightLeafHeaders")),t.getLeafHeaders=Y(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var i,s,l,a,d,c;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(d=(c=o[0])==null?void 0:c.headers)!=null?d:[]].map(u=>u.getLeafHeaders()).flat()},j(t.options,ve,"getLeafHeaders"))}};function dr(t,e,n,o){var i,s;let l=0;const a=function(h,m){m===void 0&&(m=1),l=Math.max(l,m),h.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,m+1)},0)};a(t);let d=[];const c=(h,m)=>{const p={depth:m,id:[o,`${m}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(b=>{const y=[...g].reverse()[0],C=b.column.depth===p.depth;let v,_=!1;if(C&&b.column.parent?v=b.column.parent:(v=b.column,_=!0),y&&(y==null?void 0:y.column)===v)y.subHeaders.push(b);else{const x=Pc(n,v,{id:[o,m,v.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${g.filter(N=>N.column===v).length}`:void 0,depth:m,index:g.length});x.subHeaders.push(b),g.push(x)}p.headers.push(b),b.headerGroup=p}),d.push(p),m>0&&c(g,m-1)},u=e.map((h,m)=>Pc(n,h,{depth:l,index:m}));c(u,l-1),d.reverse();const f=h=>h.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,b=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],f(p.subHeaders).forEach(v=>{let{colSpan:_,rowSpan:x}=v;g+=_,y.push(x)})):g=1;const C=Math.min(...y);return b=b+C,p.colSpan=g,p.rowSpan=b,{colSpan:g,rowSpan:b}});return f((i=(s=d[0])==null?void 0:s.headers)!=null?i:[]),d}const rs=(t,e,n,o,i,s,l)=>{let a={id:e,index:o,original:n,depth:i,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(a._valuesCache.hasOwnProperty(d))return a._valuesCache[d];const c=t.getColumn(d);if(c!=null&&c.accessorFn)return a._valuesCache[d]=c.accessorFn(a.original,o),a._valuesCache[d]},getUniqueValues:d=>{if(a._uniqueValuesCache.hasOwnProperty(d))return a._uniqueValuesCache[d];const c=t.getColumn(d);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[d]=c.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[d]):(a._uniqueValuesCache[d]=[a.getValue(d)],a._uniqueValuesCache[d])},renderValue:d=>{var c;return(c=a.getValue(d))!=null?c:t.options.renderFallbackValue},subRows:s??[],getLeafRows:()=>Ew(a.subRows,d=>d.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let d=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;d.push(u),c=u}return d.reverse()},getAllCells:Y(()=>[t.getAllLeafColumns()],d=>d.map(c=>Pw(t,a,c,c.id)),j(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],d=>d.reduce((c,u)=>(c[u.column.id]=u,c),{}),j(t.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<t._features.length;d++){const c=t._features[d];c==null||c.createRow==null||c.createRow(a,t)}return a},Rw={createColumn:(t,e)=>{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()}}},Nc=(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))};Nc.autoRemove=t=>We(t);const Fc=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};Fc.autoRemove=t=>We(t);const Rc=(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())};Rc.autoRemove=t=>We(t);const Ac=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};Ac.autoRemove=t=>We(t)||!(t!=null&&t.length);const Oc=(t,e,n)=>!n.some(o=>{var i;return!((i=t.getValue(e))!=null&&i.includes(o))});Oc.autoRemove=t=>We(t)||!(t!=null&&t.length);const Ic=(t,e,n)=>n.some(o=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(o)});Ic.autoRemove=t=>We(t)||!(t!=null&&t.length);const Tc=(t,e,n)=>t.getValue(e)===n;Tc.autoRemove=t=>We(t);const zc=(t,e,n)=>t.getValue(e)==n;zc.autoRemove=t=>We(t);const is=(t,e,n)=>{let[o,i]=n;const s=t.getValue(e);return s>=o&&s<=i};is.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,l=n===null||Number.isNaN(i)?1/0:i;if(s>l){const a=s;s=l,l=a}return[s,l]},is.autoRemove=t=>We(t)||We(t[0])&&We(t[1]);const mt={includesString:Nc,includesStringSensitive:Fc,equalsString:Rc,arrIncludes:Ac,arrIncludesAll:Oc,arrIncludesSome:Ic,equals:Tc,weakEquals:zc,inNumberRange:is};function We(t){return t==null||t===""}const Aw={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Re("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);return typeof o=="string"?mt.includesString:typeof o=="number"?mt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?mt.equals:Array.isArray(o)?mt.arrIncludes:mt.weakEquals},t.getFilterFn=()=>{var n,o;return ar(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:mt[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.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),l=Bt(n,s?s.value:void 0);if(Lc(i,l,t)){var a;return(a=o==null?void 0:o.filter(u=>u.id!==t.id))!=null?a:[]}const d={id:t.id,value:l};if(s){var c;return(c=o==null?void 0:o.map(u=>u.id===t.id?d:u))!=null?c:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=i=>{var s;return(s=Bt(e,i))==null?void 0:s.filter(l=>{const a=n.find(d=>d.id===l.id);if(a){const d=a.getFilterFn();if(Lc(d,l.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},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())}};function Lc(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const ss={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 l=s.getValue(t);l!=null&&(o===void 0?l>=l&&(o=i=l):(o>l&&(o=l),i<l&&(i=l)))}),[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(!Bw(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),i=n.sort((s,l)=>s-l);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},Ow={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:Re("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;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((o=e.options.enableGrouping)!=null?o:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},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 ss.sum;if(Object.prototype.toString.call(o)==="[object Date]")return ss.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return ar(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:ss[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 Iw(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(l=>l.id===s)).filter(Boolean),...o]}const Tw={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Re("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Y(n=>[no(e,n)],n=>n.findIndex(o=>o.id===t.id),j(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var o;return((o=no(e,n)[0])==null?void 0:o.id)===t.id},t.getIsLastColumn=n=>{var o;const i=no(e,n);return((o=i[i.length-1])==null?void 0:o.id)===t.id}},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=Y(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const l=[...e],a=[...i];for(;a.length&&l.length;){const d=l.shift(),c=a.findIndex(u=>u.id===d);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Iw(s,n,o)},j(t.options,"debugTable","_getOrderColumnsFn"))}},ls=()=>({left:[],right:[]}),zw={getInitialState:t=>({columnPinning:ls(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Re("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,l;if(n==="right"){var a,d;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((d=i==null?void 0:i.right)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(n==="left"){var c,u;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).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:((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(o!=null&&o.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var i,s,l;return((i=o.columnDef.enablePinning)!=null?i:!0)&&((s=(l=e.options.enableColumnPinning)!=null?l: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)),l=n.some(a=>i==null?void 0:i.includes(a));return s?"left":l?"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.getCenterVisibleCells=Y(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,i)=>{const s=[...o??[],...i??[]];return n.filter(l=>!s.includes(l.column.id))},j(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=Y(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,o)=>(o??[]).map(s=>n.find(l=>l.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),j(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=Y(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(l=>l.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),j(e.options,"debugRows","getRightVisibleCells"))},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?ls():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:ls())},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=Y(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),j(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=Y(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),j(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=Y(()=>[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))},j(t.options,"debugColumns","getCenterLeafColumns"))}},cr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},as=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Lw={getDefaultColumnDef:()=>cr,getInitialState:t=>({columnSizing:{},columnSizingInfo:as(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Re("columnSizing",t),onColumnSizingInfoChange:Re("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:cr.minSize,(o=s??t.columnDef.size)!=null?o:cr.size),(i=t.columnDef.maxSize)!=null?i:cr.maxSize)},t.getStart=Y(n=>[n,no(e,n),e.getState().columnSizing],(n,o)=>o.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),j(e.options,"debugColumns","getStart")),t.getAfter=Y(n=>[n,no(e,n),e.getState().columnSizing],(n,o)=>o.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),j(e.options,"debugColumns","getAfter")),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=n=>{const o=e.getColumn(t.column.id),i=o==null?void 0:o.getCanResize();return s=>{if(!o||!i||(s.persist==null||s.persist(),ds(s)&&s.touches&&s.touches.length>1))return;const l=t.getSize(),a=t?t.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],d=ds(s)?Math.round(s.touches[0].clientX):s.clientX,c={},u=(y,C)=>{typeof C=="number"&&(e.setColumnSizingInfo(v=>{var _,x;const N=e.options.columnResizeDirection==="rtl"?-1:1,E=(C-((_=v==null?void 0:v.startOffset)!=null?_:0))*N,R=Math.max(E/((x=v==null?void 0:v.startSize)!=null?x:0),-.999999);return v.columnSizingStart.forEach(k=>{let[S,w]=k;c[S]=Math.round(Math.max(w+w*R,0)*100)/100}),{...v,deltaOffset:E,deltaPercentage:R}}),(e.options.columnResizeMode==="onChange"||y==="end")&&e.setColumnSizing(v=>({...v,...c})))},f=y=>u("move",y),h=y=>{u("end",y),e.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=n||typeof document<"u"?document:null,p={moveHandler:y=>f(y.clientX),upHandler:y=>{m==null||m.removeEventListener("mousemove",p.moveHandler),m==null||m.removeEventListener("mouseup",p.upHandler),h(y.clientX)}},g={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),f(y.touches[0].clientX),!1),upHandler:y=>{var C;m==null||m.removeEventListener("touchmove",g.moveHandler),m==null||m.removeEventListener("touchend",g.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((C=y.touches[0])==null?void 0:C.clientX)}},b=Hw()?{passive:!1}:!1;ds(s)?(m==null||m.addEventListener("touchmove",g.moveHandler,b),m==null||m.addEventListener("touchend",g.upHandler,b)):(m==null||m.addEventListener("mousemove",p.moveHandler,b),m==null||m.addEventListener("mouseup",p.upHandler,b)),e.setColumnSizingInfo(y=>({...y,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:o.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?as():(n=t.initialState.columnSizingInfo)!=null?n:as())},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 ur=null;function Hw(){if(typeof ur=="boolean")return ur;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 ur=t,ur}function ds(t){return t.type==="touchstart"}const Yw={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Re("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(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=Y(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),j(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=Y(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,i)=>[...n,...o,...i],j(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,o)=>Y(()=>[o(),o().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),j(t.options,"debugColumns",n));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)}}};function no(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const jw={createTable:t=>{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()}}},Ww={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Re("globalFilter",t),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.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}},createTable:t=>{t.getGlobalAutoFilterFn=()=>mt.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return ar(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:mt[o]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Uw={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Re("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 l=s.split(".");o=Math.max(o,l.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 l={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=o,n=(i=n)!=null?i:!s,!s&&n)return{...l,[t.id]:!0};if(s&&!n){const{[t.id]:a,...d}=l;return d}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()}}}},cs=0,us=10,fs=()=>({pageIndex:cs,pageSize:us}),Gw={getInitialState:t=>({...t,pagination:{...fs(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Re("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=>Bt(o,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=o=>{var i;t.setPagination(o?fs():(i=t.initialState.pagination)!=null?i:fs())},t.setPageIndex=o=>{t.setPagination(i=>{let s=Bt(o,i.pageIndex);const l=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,l)),{...i,pageIndex:s}})},t.resetPageIndex=o=>{var i,s;t.setPageIndex(o?cs:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:cs)},t.resetPageSize=o=>{var i,s;t.setPageSize(o?us:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:us)},t.setPageSize=o=>{t.setPagination(i=>{const s=Math.max(1,Bt(o,i.pageSize)),l=i.pageSize*i.pageIndex,a=Math.floor(l/s);return{...i,pageIndex:a,pageSize:s}})},t.setPageCount=o=>t.setPagination(i=>{var s;let l=Bt(o,(s=t.options.pageCount)!=null?s:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...i,pageCount:l}}),t.getPageOptions=Y(()=>[t.getPageCount()],o=>{let i=[];return o&&o>0&&(i=[...new Array(o)].fill(null).map((s,l)=>l)),i},j(t.options,"debugTable","getPageOptions")),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.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-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.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var o;return(o=t.options.rowCount)!=null?o:t.getPrePaginationRowModel().rows.length}}},hs=()=>({top:[],bottom:[]}),qw={getInitialState:t=>({rowPinning:hs(),...t}),getDefaultOptions:t=>({onRowPinningChange:Re("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,o,i)=>{const s=o?t.getLeafRows().map(d=>{let{id:c}=d;return c}):[],l=i?t.getParentRows().map(d=>{let{id:c}=d;return c}):[],a=new Set([...l,t.id,...s]);e.setRowPinning(d=>{var c,u;if(n==="bottom"){var f,h;return{top:((f=d==null?void 0:d.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((h=d==null?void 0:d.bottom)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var m,p;return{top:[...((m=d==null?void 0:d.top)!=null?m:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=d==null?void 0:d.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=d==null?void 0:d.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},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)),l=n.some(a=>i==null?void 0:i.includes(a));return s?"top":l?"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(l=>{let{id:a}=l;return a});return(o=s==null?void 0:s.indexOf(t.id))!=null?o:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?hs():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:hs())},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=Y(e=>[t.getRowModel().rows,t.getState().rowPinning[e],e],(e,n,o)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(l=>{const a=t.getRow(l,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(l=>e.find(a=>a.id===l))).filter(Boolean).map(l=>({...l,position:o}))},j(t.options,"debugRows","_getPinnedRows")),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=Y(()=>[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))},j(t.options,"debugRows","getCenterRows"))}},Xw={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Re("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=>{ms(i,s.id,o,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Y(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?ps(t,n):{rows:[],flatRows:[],rowsById:{}},j(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=Y(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?ps(t,n):{rows:[],flatRows:[],rowsById:{}},j(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=Y(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?ps(t,n):{rows:[],flatRows:[],rowsById:{}},j(t.options,"debugTable","getGroupedSelectedRowModel")),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 l;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const a={...s};return ms(a,t.id,n,(l=o==null?void 0:o.selectChildren)!=null?l:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return gs(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return bs(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return bs(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)}}}},ms=(t,e,n,o,i)=>{var s;const l=i.getRow(e,!0);n?(l.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),l.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(s=l.subRows)!=null&&s.length&&l.getCanSelectSubRows()&&l.subRows.forEach(a=>ms(t,a.id,n,o,i))};function ps(t,e){const n=t.getState().rowSelection,o=[],i={},s=function(l,a){return l.map(d=>{var c;const u=gs(d,n);if(u&&(o.push(d),i[d.id]=d),(c=d.subRows)!=null&&c.length&&(d={...d,subRows:s(d.subRows)}),u)return d}).filter(Boolean)};return{rows:s(e.rows),flatRows:o,rowsById:i}}function gs(t,e){var n;return(n=e[t.id])!=null?n:!1}function bs(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let i=!0,s=!1;return t.subRows.forEach(l=>{if(!(s&&!i)&&(l.getCanSelect()&&(gs(l,e)?s=!0:i=!1),l.subRows&&l.subRows.length)){const a=bs(l,e);a==="all"?s=!0:(a==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const ys=/([0-9]+)/gm,Kw=(t,e,n)=>Hc(Et(t.getValue(n)).toLowerCase(),Et(e.getValue(n)).toLowerCase()),Zw=(t,e,n)=>Hc(Et(t.getValue(n)),Et(e.getValue(n))),Jw=(t,e,n)=>$s(Et(t.getValue(n)).toLowerCase(),Et(e.getValue(n)).toLowerCase()),Qw=(t,e,n)=>$s(Et(t.getValue(n)),Et(e.getValue(n))),e_=(t,e,n)=>{const o=t.getValue(n),i=e.getValue(n);return o>i?1:o<i?-1:0},t_=(t,e,n)=>$s(t.getValue(n),e.getValue(n));function $s(t,e){return t===e?0:t>e?1:-1}function Et(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function Hc(t,e){const n=t.split(ys).filter(Boolean),o=e.split(ys).filter(Boolean);for(;n.length&&o.length;){const i=n.shift(),s=o.shift(),l=parseInt(i,10),a=parseInt(s,10),d=[l,a].sort();if(isNaN(d[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(d[1]))return isNaN(l)?-1:1;if(l>a)return 1;if(a>l)return-1}return n.length-o.length}const oo={alphanumeric:Kw,alphanumericCaseSensitive:Zw,text:Jw,textCaseSensitive:Qw,datetime:e_,basic:t_},n_=[Fw,Yw,Tw,zw,Rw,Aw,jw,Ww,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Re("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 oo.datetime;if(typeof s=="string"&&(o=!0,s.split(ys).length>1))return oo.alphanumeric}return o?oo.text:oo.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 ar(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:oo[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(l=>{const a=l==null?void 0:l.find(m=>m.id===t.id),d=l==null?void 0:l.findIndex(m=>m.id===t.id);let c=[],u,f=s?n:i==="desc";if(l!=null&&l.length&&t.getCanMultiSort()&&o?a?u="toggle":u="add":l!=null&&l.length&&d!==l.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(s||i||(u="remove")),u==="add"){var h;c=[...l,{id:t.id,desc:f}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=l.map(m=>m.id===t.id?{...m,desc:f}:m):u==="remove"?c=l.filter(m=>m.id!==t.id):c=[{id:t.id,desc:f}];return c})},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(),l=t.getIsSorted();return l?l!==s&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:l==="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())}},Ow,Uw,Gw,qw,Xw,Lw];function o_(t){var e,n;process.env.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const o=[...n_,...(e=t._features)!=null?e:[]];let i={_features:o};const s=i._features.reduce((h,m)=>Object.assign(h,m.getDefaultOptions==null?void 0:m.getDefaultOptions(i)),{}),l=h=>i.options.mergeOptions?i.options.mergeOptions(s,h):{...s,...h};let d={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(h=>{var m;d=(m=h.getInitialState==null?void 0:h.getInitialState(d))!=null?m:d});const c=[];let u=!1;const f={_features:o,options:{...s,...t},initialState:d,_queue:h=>{c.push(h),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const m=Bt(h,i.options);i.options=l(m)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,m,p)=>{var g;return(g=i.options.getRowId==null?void 0:i.options.getRowId(h,m,p))!=null?g:`${p?[p.id,m].join("."):m}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,m)=>{let p=(m?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!p&&(p=i.getCoreRowModel().rowsById[h],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return p},_getDefaultColumnDef:Y(()=>[i.options.defaultColumn],h=>{var m;return h=(m=h)!=null?m:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,b;return(g=(b=p.renderValue())==null||b.toString==null?void 0:b.toString())!=null?g:null},...i._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},j(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:Y(()=>[i._getColumnDefs()],h=>{const m=function(p,g,b){return b===void 0&&(b=0),p.map(y=>{const C=Nw(i,y,b,g),v=y;return C.columns=v.columns?m(v.columns,C,b+1):[],C})};return m(h)},j(t,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[i.getAllColumns()],h=>h.flatMap(m=>m.getFlatColumns()),j(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[i.getAllFlatColumns()],h=>h.reduce((m,p)=>(m[p.id]=p,m),{}),j(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,m)=>{let p=h.flatMap(g=>g.getLeafColumns());return m(p)},j(t,"debugColumns","getAllLeafColumns")),getColumn:h=>{const m=i._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!m&&console.error(`[Table] Column with id '${h}' does not exist.`),m}};Object.assign(i,f);for(let h=0;h<i._features.length;h++){const m=i._features[h];m==null||m.createTable==null||m.createTable(i)}return i}function r_(){return t=>Y(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(i,s,l){s===void 0&&(s=0);const a=[];for(let c=0;c<i.length;c++){const u=rs(t,t._getRowId(i[c],c,l),i[c],c,s,void 0,l==null?void 0:l.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var d;u.originalSubRows=t.options.getSubRows(i[c],c),(d=u.originalSubRows)!=null&&d.length&&(u.subRows=o(u.originalSubRows,s+1,u))}}return a};return n.rows=o(e),n},j(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function i_(){return t=>Y(()=>[t.getState().expanded,t.getPreExpandedRowModel(),t.options.paginateExpandedRows],(e,n,o)=>!n.rows.length||e!==!0&&!Object.keys(e??{}).length||!o?n:Yc(n),j(t.options,"debugTable","getExpandedRowModel"))}function Yc(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 s_(t,e,n){return n.options.filterFromLeafRows?l_(t,e,n):a_(t,e,n)}function l_(t,e,n){var o;const i=[],s={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,c){c===void 0&&(c=0);const u=[];for(let h=0;h<d.length;h++){var f;let m=d[h];const p=rs(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(p.columnFilters=m.columnFilters,(f=m.subRows)!=null&&f.length&&c<l){if(p.subRows=a(m.subRows,c+1),m=p,e(m)&&!p.subRows.length){u.push(m),s[m.id]=m,i.push(m);continue}if(e(m)||p.subRows.length){u.push(m),s[m.id]=m,i.push(m);continue}}else m=p,e(m)&&(u.push(m),s[m.id]=m,i.push(m))}return u};return{rows:a(t),flatRows:i,rowsById:s}}function a_(t,e,n){var o;const i=[],s={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,c){c===void 0&&(c=0);const u=[];for(let h=0;h<d.length;h++){let m=d[h];if(e(m)){var f;if((f=m.subRows)!=null&&f.length&&c<l){const g=rs(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);g.subRows=a(m.subRows,c+1),m=g}u.push(m),i.push(m),s[m.id]=m}}return u};return{rows:a(t),flatRows:i,rowsById:s}}function d_(){return t=>Y(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const i=[],s=[];(n??[]).forEach(h=>{var m;const p=t.getColumn(h.id);if(!p)return;const g=p.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}i.push({id:h.id,filterFn:g,resolvedValue:(m=g.resolveFilterValue==null?void 0:g.resolveFilterValue(h.value))!=null?m:h.value})});const l=n.map(h=>h.id),a=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());o&&a&&d.length&&(l.push("__global__"),d.forEach(h=>{var m;s.push({id:h.id,filterFn:a,resolvedValue:(m=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?m:o})}));let c,u;for(let h=0;h<e.flatRows.length;h++){const m=e.flatRows[h];if(m.columnFilters={},i.length)for(let p=0;p<i.length;p++){c=i[p];const g=c.id;m.columnFilters[g]=c.filterFn(m,g,c.resolvedValue,b=>{m.columnFiltersMeta[g]=b})}if(s.length){for(let p=0;p<s.length;p++){u=s[p];const g=u.id;if(u.filterFn(m,g,u.resolvedValue,b=>{m.columnFiltersMeta[g]=b})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const f=h=>{for(let m=0;m<l.length;m++)if(h.columnFilters[l[m]]===!1)return!1;return!0};return s_(e.rows,f,t)},j(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function c_(t){return e=>Y(()=>[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:l,flatRows:a,rowsById:d}=o;const c=i*s,u=c+i;l=l.slice(c,u);let f;e.options.paginateExpandedRows?f={rows:l,flatRows:a,rowsById:d}:f=Yc({rows:l,flatRows:a,rowsById:d}),f.flatRows=[];const h=m=>{f.flatRows.push(m),m.subRows.length&&m.subRows.forEach(h)};return f.rows.forEach(h),f},j(e.options,"debugTable","getPaginationRowModel"))}function u_(){return t=>Y(()=>[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(d=>{var c;return(c=t.getColumn(d.id))==null?void 0:c.getCanSort()}),l={};s.forEach(d=>{const c=t.getColumn(d.id);c&&(l[d.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=d=>{const c=d.map(u=>({...u}));return c.sort((u,f)=>{for(let m=0;m<s.length;m+=1){var h;const p=s[m],g=l[p.id],b=g.sortUndefined,y=(h=p==null?void 0:p.desc)!=null?h:!1;let C=0;if(b){const v=u.getValue(p.id),_=f.getValue(p.id),x=v===void 0,N=_===void 0;if(x||N){if(b==="first")return x?-1:1;if(b==="last")return x?1:-1;C=x&&N?0:x?b:-b}}if(C===0&&(C=g.sortingFn(u,f,p.id)),C!==0)return y&&(C*=-1),g.invertSorting&&(C*=-1),C}return u.index-f.index}),c.forEach(u=>{var f;i.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},j(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/**
46
46
  * vue-table
47
47
  *
48
48
  * Copyright (c) TanStack
@@ -51,5 +51,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51
51
  * LICENSE.md file in the root directory of this source tree.
52
52
  *
53
53
  * @license MIT
54
- */function fr(){return!0}const f_=Symbol("merge-proxy"),h_={get(t,e,n){return e===f_?n:t.get(e)},has(t,e){return t.has(e)},set:fr,deleteProperty:fr,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:fr,deleteProperty:fr}},ownKeys(t){return t.keys()}};function ws(t){return"value"in t?t.value:t}function hr(){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=ws(e[i])[o];if(s!==void 0)return s}},has(o){for(let i=e.length-1;i>=0;i--)if(o in ws(e[i]))return!0;return!1},keys(){const o=[];for(let i=0;i<e.length;i++)o.push(...Object.keys(ws(e[i])));return[...Array.from(new Set(o))]}},h_)}const mr=r.defineComponent({props:["render","props"],setup:t=>()=>typeof t.render=="function"||typeof t.render=="object"?r.h(t.render,t.props):t.render});function m_(t){const e=hr({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(i,s){return hr(i,s)}},t),n=o_(e),o=r.ref(n.initialState);return r.watchEffect(()=>{n.setOptions(i=>{var s;const l=new Proxy({},{get:(a,d)=>o.value[d]});return hr(i,t,{state:hr(l,(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 p_=["checked","disabled","indeterminate"],jc=J(r.defineComponent({__name:"FmTableCheckbox",props:{checked:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean},onChange:{type:Function}},setup(t){const e=t,n=r.computed(()=>e.indeterminate&&!e.checked?"remove":e.checked?"check_small":"");return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"fm-checkbox__input--container",onClick:i[0]||(i[0]=r.withModifiers((...s)=>o.onChange&&o.onChange(...s),["stop"]))},[r.createElementVNode("input",{checked:o.checked,class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.checked}),disabled:o.disabled,indeterminate:o.indeterminate,type:"checkbox"},null,10,p_),o.indeterminate||o.checked?(r.openBlock(),r.createBlock(H,{key:0,name:n.value,class:"fm-checkbox__input--checkmark",color:"#FFFFFF",size:"md"},null,8,["name"])):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-dbf1ded4"]]),g_={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]"},Wc=r.defineComponent({__name:"FmTableSelection",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(t){const n=q(t,"modelValue"),o=r.ref(!1);return(i,s)=>(r.openBlock(),r.createBlock(Ze,{onMenuChanged:s[0]||(s[0]=l=>o.value=l)},{"menu-button":r.withCtx(()=>{var l;return[r.createVNode(U,{variant:"tertiary",label:(l=i.items.find(a=>a.value===i.modelValue))==null?void 0:l.label,size:"md",icon:o.value?"expand_less":"expand_more","icon-position":"append"},null,8,["label","icon"])]}),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",g_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.items,l=>(r.openBlock(),r.createBlock(we,{key:l.value,"model-value":l.value===r.unref(n),label:l.label,value:l.value,"onUpdate:modelValue":a=>n.value=l.value},null,8,["model-value","label","value","onUpdate:modelValue"]))),128))])]),_:1}))}}),b_={class:"overflow-y-auto"},y_={class:"-translate-x-1/2 -translate-y-1/2 absolute flex flex-col gap-16 left-1/2 top-1/2"},$_=r.createElementVNode("span",{class:"text-fm-color-typo-secondary"},"Loading data...",-1),w_=["onClick"],__={key:0},k_={class:"fm-typo-body-md-400 line-clamp-2 w-full"},C_={key:1,class:"w-full"},x_={class:"-translate-x-1/2 -translate-y-1/2 absolute flex flex-col gap-16 left-1/2 top-1/2"},S_=r.createElementVNode("span",{class:"text-fm-color-typo-secondary"},"Loading data...",-1),v_=["onClick"],D_={class:"fm-typo-body-md-400 line-clamp-2 w-full"},M_={class:"flex gap-8 items-center"},V_=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),B_={class:"flex gap-8"},E_=r.defineComponent({__name:"FmTable",props:{modelValue:{default:{}},selection:{default:void 0},rowData:{default:()=>[]},columnDefs:{default:()=>[]},columnFilter:{default:void 0},searchValue:{default:""},pageCount:{default:0},rowCount:{default:void 0},fetchFn:{type:Function,default:void 0},pageSize:{default:10},loading:{type:Boolean,default:void 0},pinHeaderRow:{type:Boolean,default:!0},rowClassName:{},onRowClick:{type:Function,default:void 0},autoResetPageIndex:{type:Boolean},shrinkAt:{type:[String,Number,Boolean],default:"sm"},hideFooter:{type:Boolean},forceMobileFooter:{type:Boolean}},setup(t){const e=t,n=q(e,"modelValue"),o=q(e,"searchValue"),i=r.ref(e.rowData),s=()=>{let w=e.columnDefs;return e.selection&&(w=[{id:"row-selection",header:({table:_})=>r.createVNode(jc,{checked:_.getIsAllPageRowsSelected(),indeterminate:_.getIsSomePageRowsSelected(),onChange:_.getToggleAllPageRowsSelectedHandler()},null),cell:({row:_})=>r.createVNode(jc,{checked:_.getIsSelected(),disabled:!_.getCanSelect(),onChange:_.getToggleSelectedHandler()},null),enableResizing:!1,meta:{headerClass:"py-4 pl-4 pr-16",cellClass:"pl-4 pr-16",width:"60px"}},...w]),w},l=r.ref([]);r.watch(()=>e.rowData,w=>{i.value=[...w]},{deep:!0});const a=r.ref({pageIndex:0,pageSize:e.pageSize}),d=m_({enableRowSelection:!!e.selection,enableMultiRowSelection:e.selection==="multiple",columns:s(),get data(){return i.value},state:{get pagination(){return typeof e.fetchFn=="function"?a.value:void 0},get globalFilter(){return o.value},get rowSelection(){return n.value},get sorting(){return l.value}},getCoreRowModel:r_(),getSortedRowModel:u_(),getFilteredRowModel:d_(),getPaginationRowModel:c_(),onRowSelectionChange:w=>{if(!h.value)return n.value=typeof w=="function"?w(n.value):w},onSortingChange:w=>{l.value=typeof w=="function"?w(l.value):w},onGlobalFilterChange:w=>{o.value=typeof w=="function"?w(o.value):w},autoResetPageIndex:e.autoResetPageIndex,manualPagination:typeof e.fetchFn=="function",...typeof e.fetchFn=="function"&&{onPaginationChange:w=>a.value=typeof w=="function"?w(a.value):w},pageCount:typeof e.fetchFn=="function"?e.pageCount:void 0,getSubRows:w=>w.subRows,getExpandedRowModel:i_()});r.watch(()=>a.value,w=>{f(w)});const c=r.ref(""),u=r.ref(!1);async function f(w){if(!e.fetchFn)return;u.value=!0;const _=`${Math.random()}`;c.value=_;try{await e.fetchFn(w)}catch{}finally{c.value===_&&(u.value=!1)}}const h=r.computed(()=>{const w=u.value;return typeof e.loading=="boolean"?e.loading:w});r.watch(()=>e.rowData,()=>{d.setOptions(w=>({...w,data:e.rowData}))}),r.watch([()=>e.pageCount,()=>e.rowCount],()=>{d.setOptions(w=>({...w,pageCount:e.pageCount,rowCount:e.rowCount}))}),r.watch(()=>e.pageSize,()=>{d.setPageSize(e.pageSize)}),r.watch([()=>e.columnFilter],([w])=>{d.setColumnFilters(()=>w??[])}),r.watch(()=>e.columnDefs,()=>{d.setOptions(w=>({...w,columns:s()}))}),r.onMounted(()=>{e.fetchFn&&e.fetchFn(d.getState().pagination),d.setPageSize(e.pageSize)});const m=r.ref(380);function p(w){var F;const _=((F=w.el)==null?void 0:F.scrollHeight)??0;m.value=Math.max(100,_)}const g=yt(),b=r.ref(),y=r.ref(typeof e.shrinkAt=="boolean"&&!e.shrinkAt?!1:g.isBreakpointKeyword(e.shrinkAt)&&g.isAtMost(e.shrinkAt));function k(w){const _=w.el;if(!_||typeof e.shrinkAt>"u"||typeof e.shrinkAt=="boolean"&&!e.shrinkAt)return;const F=Qi(function(){if(b.value=_.clientWidth,g.isBreakpointKeyword(e.shrinkAt)){y.value=g.isAtMost(e.shrinkAt);return}const $=Number(e.shrinkAt);if(isNaN($)){y.value=!1;return}y.value=_.scrollWidth>=$},200);_.resizeTable??(_.resizeTable=function(){y.value=g.isBreakpointKeyword(e.shrinkAt)&&g.isAtMost(e.shrinkAt),F()}),window.addEventListener("resize",_.resizeTable),_.resizeTable()}function M(w){const _=w.el;!_||typeof e.shrinkAt>"u"||typeof e.shrinkAt=="boolean"&&!e.shrinkAt||_.resizeTable&&window.removeEventListener("resize",_.resizeTable)}return(w,_)=>{const F=r.resolveComponent("FmListItem"),$=r.resolveComponent("FmList"),S=r.resolveComponent("FmTableHeader");return r.openBlock(),r.createElementBlock("div",{class:"flex flex-col h-full relative",onVnodeMounted:k,onVnodeUnmounted:M},[r.createElementVNode("div",b_,[y.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[h.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pointer-events-none",style:r.normalizeStyle({height:`${m.value}px`})},[r.createElementVNode("div",y_,[r.createVNode($t),r.createVNode(Zt,{size:"xl"}),r.createElementVNode("div",null,[r.renderSlot(w.$slots,"loading-text",{},()=>[$_])]),r.createVNode($t)])],4)):(r.openBlock(),r.createBlock($,{key:1,onVnodeMounted:p},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).getRowModel().rows,D=>r.renderSlot(w.$slots,"list-row",r.normalizeProps(r.mergeProps({key:D.id},D)),()=>[r.createVNode(F,{style:{padding:"0"},class:r.normalizeClass([{"bg-fm-color-neutral-gray-100":D.getIsSelected(),"cursor-pointer":typeof w.onRowClick=="function"}]),tag:"label"},{prepend:r.withCtx(()=>{var v,x,C,N,E;return[r.createVNode(r.unref(mr),{render:(C=(x=(v=D.getVisibleCells().find(P=>P.column.id==="row-selection"))==null?void 0:v.column)==null?void 0:x.columnDef)==null?void 0:C.cell,props:(E=(N=D.getVisibleCells().find(P=>P.column.id==="row-selection"))==null?void 0:N.getContext)==null?void 0:E.call(N)},null,8,["render","props"])]}),default:r.withCtx(()=>[r.createElementVNode("div",{class:"flex flex-col gap-4 grow p-8",onClick:v=>{var x;return(x=w.onRowClick)==null?void 0:x.call(w,D)}},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.getVisibleCells(),v=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:v.id},[v.column.id!=="row-selection"?(r.openBlock(),r.createElementBlock("div",__,[r.createElementVNode("span",k_,[r.createVNode(r.unref(mr),{render:v.column.columnDef.cell,props:v.getContext()},null,8,["render","props"])])])):r.createCommentVNode("",!0)],64))),128))],8,w_)]),_:2},1032,["class"])])),128))]),_:3},512))],64)):(r.openBlock(),r.createElementBlock("table",C_,[w.pinHeaderRow?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(S,{key:0,table:r.unref(d)},null,8,["table"])),r.renderSlot(w.$slots,"pin-top"),r.createElementVNode("tbody",{onVnodeMounted:p},[h.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pointer-events-none",style:r.normalizeStyle({height:`${m.value}px`})},[r.createElementVNode("div",x_,[r.createVNode($t),r.createVNode(Zt,{size:"xl"}),r.createElementVNode("div",null,[r.renderSlot(w.$slots,"loading-text",{},()=>[S_])]),r.createVNode($t)])],4)):(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(r.unref(d).getRowModel().rows,D=>r.renderSlot(w.$slots,"table-row",r.normalizeProps(r.mergeProps({key:D.id},D)),()=>[r.createElementVNode("tr",{class:r.normalizeClass(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",[{"bg-fm-color-neutral-gray-100":D.getIsSelected(),"cursor-pointer":typeof w.onRowClick=="function"},w.rowClassName]]),onClick:v=>{var x;return(x=w.onRowClick)==null?void 0:x.call(w,D)}},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.getVisibleCells(),v=>{var x,C,N,E;return r.openBlock(),r.createElementBlock("td",{key:v.id,class:r.normalizeClass([h.value?"hidden":"","h-[52px] px-16 text-fm-color-typo-primary",((x=v.column.columnDef.meta)==null?void 0:x.cellClass)??"px-16"]),style:r.normalizeStyle({width:(C=v.column.columnDef.meta)==null?void 0:C.width,maxWidth:(N=v.column.columnDef.meta)==null?void 0:N.maxWidth,textAlign:((E=v.column.columnDef.meta)==null?void 0:E.textAlign)??"left"})},[r.createElementVNode("span",D_,[r.createVNode(r.unref(mr),{render:v.column.columnDef.cell,props:v.getContext()},null,8,["render","props"])])],6)}),128))],10,v_)])),128))],512),w.pinHeaderRow?(r.openBlock(),r.createBlock(S,{key:1,class:"bg-fm-color-neutral-gray-100 sticky top-0",table:r.unref(d)},null,8,["table"])):r.createCommentVNode("",!0)]))]),w.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"basis-72 bg-white flex items-center justify-between px-24",style:r.normalizeStyle({maxWidth:b.value?`${b.value}px`:void 0})},[y.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex gap-24 items-center justify-between xs:hidden xs:invisible",{"hidden invisible":w.forceMobileFooter}])},[r.createElementVNode("div",M_,[V_,r.createVNode(Wc,{"model-value":r.unref(d).getState().pagination.pageSize,items:[...Array.from(Array(5),(D,v)=>(v+1)*10).map(D=>({label:D.toString(),value:D})),{label:"All",value:e.rowData.length}],"onUpdate:modelValue":_[0]||(_[0]=D=>r.unref(d).setPageSize(D))},null,8,["model-value","items"])]),r.createElementVNode("span",{class:r.normalizeClass(["fm-typo-body-lg-400 text-fm-color-typo-secondary xs:hidden xs:invisible",{"hidden invisible":w.forceMobileFooter}])},r.toDisplayString(e.rowData.length<r.unref(d).getState().pagination.pageSize?e.rowData.length:r.unref(d).getState().pagination.pageIndex*r.unref(d).getState().pagination.pageSize+1)+" - "+r.toDisplayString((r.unref(d).getState().pagination.pageIndex+1)*r.unref(d).getState().pagination.pageSize)+" of "+r.toDisplayString(e.rowCount??e.rowData.length)+" items ",3)],2)),r.createElementVNode("div",{class:r.normalizeClass(["flex gap-8 items-center",{"w-full justify-between":y.value||w.forceMobileFooter,"xs:w-full xs:justify-between":!y.value}])},[r.createVNode(Wc,{"model-value":r.unref(d).getState().pagination.pageIndex+1,items:Array.from(Array(r.unref(d).getPageCount()),(D,v)=>v+1).map(D=>({label:D.toString(),value:D})),"onUpdate:modelValue":_[1]||(_[1]=D=>r.unref(d).setPageIndex(D?D-1:0))},null,8,["model-value","items"]),r.createElementVNode("span",{class:r.normalizeClass(["fm-typo-body-lg-400 text-fm-color-typo-primary xs:mr-auto",{"mr-auto":y.value||w.forceMobileFooter}])}," of "+r.toDisplayString(r.unref(d).getPageCount())+" pages ",3),r.createElementVNode("div",B_,[r.createVNode(U,{disabled:!r.unref(d).getCanPreviousPage(),icon:"chevron_left",variant:"tertiary","icon-color":"neutral-black",onClick:_[2]||(_[2]=()=>r.unref(d).previousPage())},null,8,["disabled"]),r.createVNode(U,{disabled:!r.unref(d).getCanNextPage(),icon:"chevron_right",variant:"tertiary","icon-color":"neutral-black",onClick:_[3]||(_[3]=()=>r.unref(d).nextPage())},null,8,["disabled"])])],2)],4))],512)}}}),P_=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),N_=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(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>({vertical:n.vertical,disabled:n.disabled})),l=r.computed(()=>{const c=n.items.slice(0,n.showMoreAt-1),u=n.items.find(h=>{var m;return h.value===n.modelValue||((m=h.children)==null?void 0:m.find(p=>p.value===n.modelValue))}),f=c.map(h=>h.value);return u&&f.includes(u.value)?n.items.slice(0,n.showMoreAt):u?[...c,u]:c}),a=r.computed(()=>{const c=l.value.map(u=>u.value);return n.items.filter(u=>!c.includes(u.value))}),d=c=>{i.value=!1,o("update:modelValue",c)};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex",c.vertical?"flex-col":"flex-row items-center"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,f=>r.renderSlot(c.$slots,"default",r.normalizeProps(r.guardReactiveProps({...f,tabsProps:s.value})),()=>[r.createVNode(Ec,r.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?c.disabled:f.disabled,vertical:c.vertical,"onUpdate:modelValue":u[0]||(u[0]=h=>o("update:modelValue",h))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(r.openBlock(),r.createBlock(Ze,{key:0,"show-menu":i.value,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":c.vertical}]),placement:c.vertical?"right-start":"bottom-start",onMenuChanged:u[1]||(u[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",[c.vertical?"h-40":"h-[46px]"]])},[r.createVNode(H,{name:"more_vert"}),P_],2)]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,f=>{var h;return r.openBlock(),r.createElementBlock(r.Fragment,{key:f.value},[(h=f.children)!=null&&h.length?(r.openBlock(),r.createBlock(Ze,{key:0,placement:"right-start"},{"menu-button":r.withCtx(()=>[r.createVNode(we,{"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,expandable:""},{append:r.withCtx(()=>[f.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled"])]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,m=>(r.openBlock(),r.createBlock(we,{key:m.value,"model-value":n.modelValue===m.value,label:m.label,icon:m.icon,disabled:m.disabled,onClick:p=>d(m.value)},{append:r.withCtx(()=>[m.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:m.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"]))),128))]),_:2},1024)):(r.openBlock(),r.createBlock(we,{key:1,"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,onClick:m=>d(f.value)},{append:r.withCtx(()=>[f.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"]))],64)}),128))]),_:1},8,["show-menu","class","placement"])):r.createCommentVNode("",!0)],2))}}),F_=["tabindex"],R_=r.defineComponent({__name:"FmCollapsibleTab",props:{modelValue:{default:void 0},label:{default:""},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:void 0},children:{default:()=>[]},indentation:{default:1},active:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},focusable:{type:Boolean,default:void 0}},setup(t){const e=t,n=q(e,"modelValue"),o=r.computed(()=>e.children.length>0),i=r.ref(!e.expand||e.disabled),s=r.computed(()=>{if(!o.value)return 0;function h(p){return p.children?[p,...p.children.flatMap(h)]:[p]}return 56*(e.children?e.children.flatMap(h):[]).length});function l(){if(!e.disabled){if(o.value){i.value=!i.value;return}n.value=e.value}}const a=r.computed(()=>typeof e.focusable=="boolean"?e.focusable:!e.disabled&&(!i.value||!o.value));function d(h){return h.children&&h.children.length?h.children.some(d):e.modelValue===h.value}const c=r.computed(()=>{const h=d(e);return o.value?h&&i.value:h}),u=r.computed(()=>e.children?e.children.map(({modelValue:h,indentation:m,active:p,focusable:g,...b})=>{const y=d(b);return{...b,expand:y,focusable:!b.disabled&&!i.value}}):[]),f=r.computed(()=>{switch(e.indentation){case 1:return 8;case 2:return 16;case 3:return 24;default:return 32}});return(h,m)=>{const p=r.resolveComponent("FmCollapsibleTab",!0),g=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle({paddingLeft:`${f.value}px`}),class:"flex flex-col px-8"},[r.withDirectives((r.openBlock(),r.createElementBlock("button",{class:r.normalizeClass(["flex fm-corner-radius-md gap-4 items-center px-16 py-8 focus-visible:outline-none",{"cursor-pointer focus-visible:bg-fm-color-opacity-md hover:bg-fm-color-opacity-sm ":!h.disabled,"cursor-not-allowed":h.disabled,"bg-fm-color-system-warning-100":c.value}]),tabindex:a.value?"0":"-1",type:"button",onClick:l},[h.icon?(r.openBlock(),r.createBlock(H,{key:0,class:r.normalizeClass({"text-fm-color-typo-disabled":h.disabled,"text-fm-color-typo-primary":!h.disabled&&!c.value,"text-fm-color-primary":!h.disabled&&c.value}),name:h.icon},null,8,["class","name"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["py-4 fm-typo-body-lg-400 text-left line-clamp-2",{"text-fm-color-typo-secondary":!h.disabled&&!c.value,"text-fm-color-primary":!h.disabled&&c.value,"text-fm-color-typo-disabled":h.disabled}])},r.toDisplayString(h.label),3),h.badge?(r.openBlock(),r.createBlock(Ft,{key:1,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",{key:2,style:r.normalizeStyle({transformOrigin:"center",transform:`rotate(${i.value?"0":"180"}deg)`,transition:"transform ease-out 250ms"}),class:"flex h-24 items-center w-24 ml-auto"},[r.createVNode(H,{class:r.normalizeClass({"text-fm-color-neutral-gray-300":!h.disabled,"text-fm-color-typo-disabled":h.disabled}),name:"expand_more",size:"md"},null,8,["class"])],4)):r.createCommentVNode("",!0)],10,F_)),[[g,!h.disabled]]),o.value?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle({maxHeight:i.value?0:`${s.value}px`,transition:"max-height 250ms",transitionTimingFunction:i.value?"ease-out":"ease-in"}),class:"flex flex-col overflow-hidden"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,(b,y)=>(r.openBlock(),r.createBlock(p,r.mergeProps({key:y,"model-value":r.unref(n),"onUpdate:modelValue":m[0]||(m[0]=k=>r.isRef(n)?n.value=k:null),indentation:h.indentation+1},b),null,16,["model-value","indentation"]))),128))],4)):r.createCommentVNode("",!0)],4)}}}),A_={class:"flex flex-col"},O_=r.defineComponent({__name:"FmCollapsibleTabs",props:{modelValue:{default:void 0},items:{default:()=>[]}},setup(t){const e=t,n=q(e,"modelValue"),o=r.computed(()=>e.items?e.items.map(({modelValue:s,...l})=>l):[]);function i(s){function l(d){return d.children?d.children.flatMap(l):[d.value]}return(s.children?s.children.flatMap(l):[s.value]).includes(e.modelValue)}return(s,l)=>(r.openBlock(),r.createElementBlock("div",A_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(a,d)=>(r.openBlock(),r.createBlock(R_,r.mergeProps({key:d},a,{"model-value":r.unref(n),"onUpdate:modelValue":l[0]||(l[0]=c=>r.isRef(n)?n.value=c:null),active:i(a),expand:i(a)}),null,16,["model-value","active","expand"]))),128))]))}}),I_=r.defineComponent({__name:"FmAvatar",props:{initials:{default:()=>""},name:{default:()=>""},src:{default:void 0},size:{default:()=>"md"}},setup(t){const e=t,n=r.computed(()=>{if(e.initials)return e.initials.slice(0,2);if(e.name){const[o,i]=e.name.split(" ");return i?`${o[0]}${i[0]}`:o.slice(0,2)}return e.src?"":"?"});return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex items-center justify-center rounded-xxxl uppercase",{"w-24 h-24 fm-typo-body-sm-700":o.size==="sm","w-40 h-40 fm-typo-body-md-700":o.size==="md","w-48 h-48 fm-typo-body-lg-700":o.size==="lg","w-56 h-56 fm-typo-body-lg-700":o.size==="xl","bg-fm-color-neutral-gray-100":!e.src}]),style:r.normalizeStyle({background:e.src?`url(${e.src})`:void 0,backgroundSize:e.src?"cover":void 0,backgroundPosition:e.src?"center":void 0,backgroundRepeat:e.src?"no-repeat":void 0})},r.toDisplayString(n.value),7))}}),T_=r.defineComponent({__name:"FmThumbnail",props:{src:{default:void 0},icon:{default:t=>t.src?"":"image"},size:{default:()=>"md"}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex items-center justify-center fm-corner-radius-md border-1 border-fm-color-neutral-gray-300",{"w-24 h-24 fm-typo-body-sm-700":n.size==="sm","w-40 h-40 fm-typo-body-md-700":n.size==="md","w-56 h-56 fm-typo-body-lg-700":n.size==="lg","w-72 h-72 fm-typo-body-lg-700":n.size==="xl","text-fm-color-neutral-gray-300 bg-fm-color-neutral-gray-100":!e.src}]),style:r.normalizeStyle({background:e.src?`url(${e.src})`:void 0,backgroundSize:e.src?"cover":void 0,backgroundPosition:e.src?"center":void 0,backgroundRepeat:e.src?"no-repeat":void 0})},[n.icon?(r.openBlock(),r.createBlock(H,{key:0,name:n.icon},null,8,["name"])):r.createCommentVNode("",!0)],6))}}),z_={class:"bg-white flex fm-corner-radius-md gap-4 items-center px-24 py-16"},L_={class:"flex gap-4 items-center xs:hidden"},H_={key:1,class:"hidden xs:flex"},Y_={class:"absolute bottom-16 hidden right-16 xs:inline"},j_=r.defineComponent({__name:"FmPageHead",props:{title:{default:()=>""},description:{default:()=>""},backButton:{type:Boolean,default:()=>!1},actions:{default:()=>[]},zIndexForBottomSheet:{default:void 0}},emits:["click:back","click:action"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{const l=[...n.actions],a=l.findIndex(h=>h.isPrimary),d=l[a],[c,u,...f]=l.filter((h,m)=>m!==a);return{primaryAction:d,firstSecondaryAction:c,secondSecondaryAction:u,showMoreSecondary:f,bottomSheetActions:l.filter(h=>!h.isPrimary),fabActions:l.filter(h=>h.isPrimary)}}),s=r.ref(!1);return(l,a)=>(r.openBlock(),r.createElementBlock("div",z_,[l.backButton?(r.openBlock(),r.createBlock(U,{key:0,type:"button",size:"md",variant:"tertiary",icon:"arrow_back","icon-color":"black",onClick:a[0]||(a[0]=d=>o("click:back"))})):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"prepend"),r.createVNode(os,{class:"flex-grow",title:l.title,description:l.description,"title-bold":""},null,8,["title","description"]),r.createElementVNode("div",L_,[i.value.firstSecondaryAction?(r.openBlock(),r.createBlock(U,{key:0,label:i.value.firstSecondaryAction.label,"prepend-icon":i.value.firstSecondaryAction.prependIcon,"append-icon":i.value.firstSecondaryAction.appendIcon,type:"button",variant:"tertiary",size:"md",onClick:a[1]||(a[1]=d=>o("click:action",i.value.firstSecondaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0),i.value.secondSecondaryAction?(r.openBlock(),r.createBlock(U,{key:1,label:i.value.secondSecondaryAction.label,"prepend-icon":i.value.secondSecondaryAction.prependIcon,"append-icon":i.value.secondSecondaryAction.appendIcon,type:"button",variant:"tertiary",size:"md",onClick:a[2]||(a[2]=d=>o("click:action",i.value.secondSecondaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0),i.value.showMoreSecondary.length>1?(r.openBlock(),r.createBlock(Ze,{key:2},{"menu-button":r.withCtx(()=>[r.createVNode(U,{label:"More","append-icon":"expand_more","icon-color":"black",type:"button",variant:"tertiary",size:"md"})]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value.showMoreSecondary,d=>(r.openBlock(),r.createBlock(we,{key:d.value,label:d.label,icon:d.prependIcon,onClick:c=>o("click:action",d.value)},null,8,["label","icon","onClick"]))),128))]),_:1})):i.value.showMoreSecondary.length===1?(r.openBlock(),r.createBlock(U,{key:3,label:i.value.showMoreSecondary[0].label,"prepend-icon":i.value.showMoreSecondary[0].prependIcon,"append-icon":i.value.showMoreSecondary[0].appendIcon,type:"button",variant:"tertiary",size:"md",onClick:a[3]||(a[3]=d=>o("click:action",i.value.showMoreSecondary[0].value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0),i.value.primaryAction?(r.openBlock(),r.createBlock(U,{key:4,label:i.value.primaryAction.label,"prepend-icon":i.value.primaryAction.prependIcon,"append-icon":i.value.primaryAction.appendIcon,type:"button",variant:"primary",size:"md",onClick:a[4]||(a[4]=d=>o("click:action",i.value.primaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0)]),i.value.bottomSheetActions.length>0?(r.openBlock(),r.createElementBlock("div",H_,[r.createVNode(U,{type:"button",size:"md",variant:"tertiary",icon:"more_vert","icon-color":"black",onClick:a[5]||(a[5]=d=>s.value=!0)})])):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"append"),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(Vr,{"model-value":s.value,"onUpdate:modelValue":a[6]||(a[6]=d=>s.value=d),"dismiss-away":"","z-index":n.zIndexForBottomSheet},{default:r.withCtx(()=>[r.createVNode(ts,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value.bottomSheetActions,d=>(r.openBlock(),r.createBlock(ns,{key:d.value,class:"hover:bg-fm-color-neutral-gray-100",label:d.label,onClick:c=>{o("click:action",d.value),s.value=!1}},null,8,["label","onClick"]))),128))]),_:1})]),_:1},8,["model-value","z-index"]),r.createElementVNode("div",Y_,[i.value.primaryAction?(r.openBlock(),r.createBlock(U,{key:0,class:"fm-shadow-light-100",label:i.value.primaryAction.label,"prepend-icon":i.value.primaryAction.prependIcon,"append-icon":i.value.primaryAction.appendIcon,type:"button",variant:"fab",size:"md",onClick:a[7]||(a[7]=d=>o("click:action",i.value.primaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0)])]))]))}}),W_=["colSpan","onClick"],U_={class:"flex gap-8 items-center justify-between"},Uc={FmBadge:Ft,FmBottomSheet:Vr,FmBreadcrumb:zu,FmButton:U,FmButtonGroup:Ku,FmCard:Zu,FmCardActionArea:Ju,FmCardActions:ef,FmCardHeader:nf,FmCardMedia:rf,FmCardSection:Er,FmCardSubtitle:Hs,FmCardTitle:Ls,FmChip:Ys,FmChipGroup:Pr,FmDialog:uf,FmDropField:mf,FmDynamicDialog:Gs,FmLineChart:Eg,FmPieChart:Og,FmBarChart:Yg,FmCheckbox:md,FmDatePicker:u2,FmDatePickerMobile:Od,FmDateRangePicker:wb,FmDateRangePickerMobile:Ld,FmSimpleDatePicker:Ub,FmSimpleDatePickerMobile:Yd,FmSimpleDateRangePicker:xy,FmSimpleDateRangePickerMobile:jd,FmField:le,FmForm:Sy,FmFormGroup:_e,FmHelperText:pd,FmLabel:Kt,FmPhoneNumber:O3,FmPinField:z3,FmRadio:G3,FmRadioGroup:q3,FmSearch:Zi,FmGlobalSearch:_4,FmSelect:dn,FmStepperField:v4,FmSwitch:Ri,FmTextField:Ki,FmTextarea:M4,FmTimeInput:lr,FmTimePicker:L4,FmTimeRangePicker:X4,FmIcon:H,FmList:ts,FmListItem:ns,FmMenu:Ze,FmMenuDeprecated:ew,FmMenuDivider:Id,FmMenuHeader:nw,FmMenuItem:we,FmCircularProgress:Zt,FmLinearProgress:lw,FmSideSheet:fw,FmSnackbar:Bc,FmSpacer:$t,FmStep:yw,FmStepper:_w,FmTab:Ec,FmTable:E_,FmTableToolbar:Vw,FmTableHeader:r.defineComponent({__name:"FmTableHeader",props:{table:{}},setup(t){function e(n){return n.column.columnDef.meta}return(n,o)=>{const i=r.resolveComponent("FmIcon");return r.openBlock(),r.createElementBlock("thead",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.table.getHeaderGroups(),s=>(r.openBlock(),r.createElementBlock("tr",{key:s.id},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.headers,l=>{var a,d,c,u;return r.openBlock(),r.createElementBlock("th",{key:l.id,colSpan:l.colSpan,class:r.normalizeClass(["fm-typo-body-md-700 text-fm-color-typo-secondary border-b border-fm-color-neutral-gray-100 h-24 hover:bg-fm-color-opacity-sm",l.column.getCanSort()?"cursor-pointer select-none":"",((a=e(l))==null?void 0:a.headerClass)??"px-16 py-12"]),style:r.normalizeStyle({width:`${(d=e(l))==null?void 0:d.width}`,maxWidth:(c=e(l))==null?void 0:c.maxWidth,textAlign:((u=e(l))==null?void 0:u.textAlign)??"left"}),onClick:f=>{var h;return(h=l.column.getToggleSortingHandler())==null?void 0:h(f)}},[r.createElementVNode("div",U_,[l.isPlaceholder?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(mr),{key:0,render:l.column.columnDef.header,props:l.getContext()},null,8,["render","props"])),l.column.getCanSort()?(r.openBlock(),r.createBlock(i,{key:1,color:"neutral-gray-400",name:{asc:"arrow_upward",desc:"arrow_downward"}[l.column.getIsSorted()]??"unfold_more"},null,8,["name"])):r.createCommentVNode("",!0)])],14,W_)}),128))]))),128))])}}}),FmTabs:N_,FmCollapsibleTabs:O_,FmTooltip:Fd,FmAvatar:I_,FmThumbnail:T_,FmPageHead:j_,FmTopSheet:vc},G_=r.defineComponent({__name:"FmTooltipDirective",props:{reference:{},placement:{default:"top"},content:{default:""},disabled:{type:Boolean,default:!1},hideArrow:{type:Boolean,default:!1}},setup(t){const e=t,n=r.ref(!1),o=r.ref(null),i=r.ref(null),s=r.computed(()=>e.reference());let l;const{floatingStyles:a,middlewareData:d,placement:c}=Jn(s,o,{whileElementsMounted:Kn,placement:e.placement,middleware:[Zn(),Gn({mainAxis:6}),Ed({element:i})]}),u=r.computed(()=>{var p,g,b,y;const m={top:"bottom",right:"left",bottom:"top",left:"right"}[c.value];return{left:((p=d.value.arrow)==null?void 0:p.x)!=null?`${(g=d.value.arrow)==null?void 0:g.x}px`:"",top:((b=d.value.arrow)==null?void 0:b.y)!=null?`${(y=d.value.arrow)==null?void 0:y.y}px`:"",[m]:"-3px"}}),f=()=>{e.disabled||(l&&clearTimeout(l),l=setTimeout(()=>{n.value=!0},250))},h=()=>{e.disabled||(l&&clearTimeout(l),l=setTimeout(()=>{n.value=!1},250))};return r.onMounted(()=>{s.value.addEventListener("pointerdown",f),s.value.addEventListener("pointermove",m=>{m.pointerType!=="touch"&&f()}),s.value.addEventListener("pointerleave",h),s.value.addEventListener("pointerup",h)}),r.onBeforeUnmount(()=>{s.value.removeEventListener("pointerdown",f),s.value.removeEventListener("pointermove",m=>{m.pointerType!=="touch"&&f()}),s.value.removeEventListener("pointerleave",h),s.value.removeEventListener("pointerup",h)}),(m,p)=>n.value&&!m.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"tooltipContent",ref:o,class:"bg-fm-color-neutral-black fm-shadow-light-300 fm-typo-body-sm-400 max-w-[240px] px-16 py-12 rounded-lg text-fm-color-typo-white",style:r.normalizeStyle(r.unref(a))},[r.withDirectives(r.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:"absolute bg-fm-color-neutral-black h-8 rotate-45 rounded-[2px] w-8",style:r.normalizeStyle(u.value)},null,4),[[r.vShow,!m.hideArrow]]),r.createTextVNode(" "+r.toDisplayString(m.content),1)],4)):r.createCommentVNode("",!0)}});let _s;const Pt=r.ref([]);let Gc=0;const q_=()=>{if(_s)return;const t=document.createElement("div");document.body.appendChild(t),_s=r.createApp({render:()=>Pt.value.map(e=>r.h(G_,e))}),_s.mount(t)},pr=t=>{if(t){for(const e of["top","right","bottom","left"])if(t[e])return e}return"top"},qc=(t,e)=>{const{value:n,modifiers:o}=e;q_(),t.$_fmTooltipId=Gc,Gc+=1,typeof n=="string"?Pt.value.push({id:t.$_fmTooltipId,reference:()=>t,content:n.toString(),placement:pr(o),hideArrow:!1}):n&&typeof n=="object"&&Pt.value.push({id:t.$_fmTooltipId,reference:()=>t,content:n.content.toString(),placement:pr(o),disabled:n.disabled??!1,hideArrow:n.hideArrow??!1})},X_={mounted:qc,updated:(t,e)=>{const{value:n,modifiers:o}=e,i=Pt.value.findIndex(s=>s.id===t.$_fmTooltipId);if(i===-1){qc(t,e);return}typeof n=="string"?Pt.value[i]={id:t.$_fmTooltipId,reference:()=>t,content:n.toString(),placement:pr(o),hideArrow:!1}:n&&typeof n=="object"&&(Pt.value[i]={id:t.$_fmTooltipId,reference:()=>t,content:n.content.toString(),disabled:n.disabled??!1,placement:pr(o),hideArrow:n.hideArrow??!1})},beforeUnmount:t=>{const e=Pt.value.findIndex(n=>n.id===t.$_fmTooltipId);e!==-1&&Pt.value.splice(e,1)}},gr=16,K_=r.defineComponent({__name:"FmSnackbarToast",setup(t){const{breakpoints:e}=yt(),n=r.inject(Br),o=r.computed(()=>{var l;return[...((l=n==null?void 0:n.store)==null?void 0:l.snackbars)??[]].reduce(({currentSum:a,tops:d},c)=>{d.push({id:c.id,accumulatedHeight:a});const u=c.mountStage===Nt.EXPIRED?0:gr+c.renderedHeight;return{currentSum:a+u,tops:d}},{currentSum:gr,tops:new Array}).tops}),i=r.computed(()=>{var s,l;return(l=(s=n==null?void 0:n.store)==null?void 0:s.snackbars)==null?void 0:l.map(a=>{var c,u,f,h,m,p;let d=0;switch(a.mountStage){case Nt.PREMOUNT:{d=e.value.xs?0:gr;break}case Nt.MOUNTED:{d=((f=(u=(c=o.value)==null?void 0:c.find)==null?void 0:u.call(c,g=>g.id===a.id))==null?void 0:f.accumulatedHeight)||gr;break}case Nt.EXPIRED:{d=((p=(m=(h=o.value)==null?void 0:h.find)==null?void 0:m.call(h,g=>g.id===a.id))==null?void 0:p.accumulatedHeight)||0,d=Math.max(0,d-a.renderedHeight);break}}return{...a,top:d}})});return(s,l)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,a=>(r.openBlock(),r.createBlock(r.Teleport,{key:a.id,to:"body"},[r.createVNode(Bc,{class:"fixed transition-all z-10",variant:a.type,title:a.title,description:a.message,action:a.action,dismissable:a.dismissable,style:r.normalizeStyle(r.unref(e).xs?{bottom:`${a.top}px`,width:"calc(100vw - 32px)",right:"16px",opacity:a.mountStage===r.unref(Nt).EXPIRED?0:1}:{top:`${a.top}px`,right:a.mountStage===r.unref(Nt).PREMOUNT?"-20px":"16px",opacity:a.mountStage===r.unref(Nt).EXPIRED?0:1}),onVnodeMounted:d=>{var c;return(c=r.unref(n))==null?void 0:c.onSnackbarMounted(a.id,d.el.scrollHeight)},onOnAction:()=>{var d,c;(d=a==null?void 0:a.onAction)==null||d.call(a),(c=r.unref(n))==null||c.close(a.id)},onOnDismiss:()=>{var d;return(d=r.unref(n))==null?void 0:d.close(a.id)}},null,8,["variant","title","description","action","dismissable","style","onVnodeMounted","onOnAction","onOnDismiss"])]))),128))}});var Nt=(t=>(t.PREMOUNT="PREMOUNT",t.MOUNTED="MOUNTED",t.EXPIRED="EXPIRED",t))(Nt||{});class Z_{constructor(){T(this,"store",r.reactive({snackbars:new Array}))}open(e,n){const o=Math.random().toString(16).slice(2),i=[{...e,id:o,mountStage:"PREMOUNT",duration:n===null?null:n??5e3,renderedHeight:0,type:(e==null?void 0:e.type)??"info",dismissable:typeof(e==null?void 0:e.dismissable)=="boolean"?e.dismissable:!0},...this.store.snackbars];return this.store.snackbars=i,o}onSnackbarMounted(e,n){const o=this.store.snackbars.findIndex(s=>s.id===e);if(o===-1)return;const i=this.store.snackbars[o];this.store.snackbars[o]={...i,renderedHeight:n},setTimeout(()=>{const s=this.store.snackbars[o];this.store.snackbars[o]={...s,mountStage:"MOUNTED"}}),typeof i.duration=="number"&&setTimeout(()=>{this.close(e)},i.duration)}close(e){const n=this.store.snackbars.findIndex(i=>i.id===e);if(n===-1)return;const o=this.store.snackbars[n];this.store.snackbars[n]={...o,mountStage:"EXPIRED"},setTimeout(()=>{this.removeSnackbar(e)},500)}removeSnackbar(e){const n=this.store.snackbars.findIndex(o=>o.id===e);n!==-1&&this.store.snackbars.splice(n,1)}}const J_={install(t){t.provide(Br,new Z_);const e=document.body,n=r.createVNode(K_);n.appContext=t._context,r.render(n,e)}};function Q_(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var o=t.indexOf("rv:");return parseInt(t.substring(o+3,t.indexOf(".",o)),10)}var i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}let br;function ks(){ks.init||(ks.init=!0,br=Q_()!==-1)}var yr={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ks(),r.nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",br&&this.$el.appendChild(t),t.data="about:blank",br||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!br&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ek=r.withScopeId("data-v-b329ee4c");r.pushScopeId("data-v-b329ee4c");const tk={class:"resize-observer",tabindex:"-1"};r.popScopeId();const nk=ek((t,e,n,o,i,s)=>(r.openBlock(),r.createBlock("div",tk)));yr.render=nk,yr.__scopeId="data-v-b329ee4c",yr.__file="src/components/ResizeObserver.vue";function $r(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$r=function(e){return typeof e}:$r=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$r(t)}function ok(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xc(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function rk(t,e,n){return e&&Xc(t.prototype,e),n&&Xc(t,n),t}function Kc(t){return ik(t)||sk(t)||lk(t)||ak()}function ik(t){if(Array.isArray(t))return Cs(t)}function sk(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function lk(t,e){if(t){if(typeof t=="string")return Cs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cs(t,e)}}function Cs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function ak(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
55
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dk(t){var e;return typeof t=="function"?e={callback:t}:e=t,e}function ck(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,i,s,l=function(d){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];if(s=u,!(o&&d===i)){var h=n.leading;typeof h=="function"&&(h=h(d,i)),(!o||d!==i)&&h&&t.apply(void 0,[d].concat(Kc(s))),i=d,clearTimeout(o),o=setTimeout(function(){t.apply(void 0,[d].concat(Kc(s))),o=0},e)}};return l._clear=function(){clearTimeout(o),o=null},l}function Zc(t,e){if(t===e)return!0;if($r(t)==="object"){for(var n in t)if(!Zc(t[n],e[n]))return!1;return!0}return!1}var uk=function(){function t(e,n,o){ok(this,t),this.el=e,this.observer=null,this.frozen=!1,this.createObserver(n,o)}return rk(t,[{key:"createObserver",value:function(n,o){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=dk(n),this.callback=function(a,d){i.options.callback(a,d),a&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var s=this.options.throttleOptions||{},l=s.leading;this.callback=ck(this.callback,this.options.throttle,{leading:function(d){return l==="both"||l==="visible"&&d||l==="hidden"&&!d}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(a){var d=a[0];if(a.length>1){var c=a.find(function(f){return f.isIntersecting});c&&(d=c)}if(i.callback){var u=d.isIntersecting&&d.intersectionRatio>=i.threshold;if(u===i.oldResult)return;i.oldResult=u,i.callback(u,d)}},this.options.intersection),r.nextTick(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),t}();function Jc(t,e,n){var o=e.value;if(o)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new uk(t,o,n);t._vue_visibilityState=i}}function fk(t,e,n){var o=e.value,i=e.oldValue;if(!Zc(o,i)){var s=t._vue_visibilityState;if(!o){Qc(t);return}s?s.createObserver(o,n):Jc(t,{value:o},n)}}function Qc(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}var hk={beforeMount:Jc,updated:fk,unmounted:Qc};function mk(t){return{all:t=t||new Map,on:function(e,n){var o=t.get(e);o&&o.push(n)||t.set(e,[n])},off:function(e,n){var o=t.get(e);o&&o.splice(o.indexOf(n)>>>0,1)},emit:function(e,n){(t.get(e)||[]).slice().map(function(o){o(n)}),(t.get("*")||[]).slice().map(function(o){o(e,n)})}}}var eu={itemsLimit:1e3},pk=/(auto|scroll)/;function tu(t,e){return t.parentNode===null?e:tu(t.parentNode,e.concat([t]))}var xs=function(e,n){return getComputedStyle(e,null).getPropertyValue(n)},gk=function(e){return xs(e,"overflow")+xs(e,"overflow-y")+xs(e,"overflow-x")},bk=function(e){return pk.test(gk(e))};function nu(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var e=tu(t.parentNode,[]),n=0;n<e.length;n+=1)if(bk(e[n]))return e[n];return document.scrollingElement||document.documentElement}}function Ss(t){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ss(t)}var ou={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function ru(){return this.items.length&&Ss(this.items[0])!=="object"}var vs=!1;if(typeof window<"u"){vs=!1;try{var yk=Object.defineProperty({},"passive",{get:function(){vs=!0}});window.addEventListener("test",null,yk)}catch{}}let $k=0;var ro={name:"RecycleScroller",components:{ResizeObserver:yr},directives:{ObserveVisibility:hk},props:{...ou,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const t={"-1":{accumulator:0}},e=this.items,n=this.sizeField,o=this.minItemSize;let i=1e4,s=0,l;for(let a=0,d=e.length;a<d;a++)l=e[a][n]||o,l<i&&(i=l),s+=l,t[a]={accumulator:s,size:l};return this.$_computedMinItemSize=i,t}return[]},simpleArray:ru,itemIndexByKey(){const{keyField:t,items:e}=this,n={};for(let o=0,i=e.length;o<i;o++)n[e[o][t]]=o;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const t=this.$_lastUpdateScrollPosition;typeof t=="number"&&this.$nextTick(()=>{this.scrollToPosition(t)})},beforeUnmount(){this.removeListeners()},methods:{addView(t,e,n,o,i){const s=r.markRaw({id:$k++,index:e,used:!0,key:o,type:i}),l=r.shallowReactive({item:n,position:0,nr:s});return t.push(l),l},unuseView(t,e=!1){const n=this.$_unusedViews,o=t.nr.type;let i=n.get(o);i||(i=[],n.set(o,i)),i.push(t),e||(t.nr.used=!1,t.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(t){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const e=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});e(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&e()},this.updateInterval))}},handleVisibilityChange(t,e){this.ready&&(t||e.boundingClientRect.width!==0||e.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(t,e=!1){const n=this.itemSize,o=this.gridItems||1,i=this.itemSecondarySize||n,s=this.$_computedMinItemSize,l=this.typeField,a=this.simpleArray?null:this.keyField,d=this.items,c=d.length,u=this.sizes,f=this.$_views,h=this.$_unusedViews,m=this.pool,p=this.itemIndexByKey;let g,b,y,k,M;if(!c)g=b=k=M=y=0;else if(this.$_prerender)g=k=0,b=M=Math.min(this.prerender,d.length),y=null;else{const v=this.getScroll();if(e){let N=v.start-this.$_lastUpdateScrollPosition;if(N<0&&(N=-N),n===null&&N<s||N<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=v.start;const x=this.buffer;v.start-=x,v.end+=x;let C=0;if(this.$refs.before&&(C=this.$refs.before.scrollHeight,v.start-=C),this.$refs.after){const N=this.$refs.after.scrollHeight;v.end+=N}if(n===null){let N,E=0,P=c-1,B=~~(c/2),R;do R=B,N=u[B].accumulator,N<v.start?E=B:B<c-1&&u[B+1].accumulator>v.start&&(P=B),B=~~((E+P)/2);while(B!==R);for(B<0&&(B=0),g=B,y=u[c-1].accumulator,b=B;b<c&&u[b].accumulator<v.end;b++);for(b===-1?b=d.length-1:(b++,b>c&&(b=c)),k=g;k<c&&C+u[k].accumulator<v.start;k++);for(M=k;M<c&&C+u[M].accumulator<v.end;M++);}else{g=~~(v.start/n*o);const N=g%o;g-=N,b=Math.ceil(v.end/n*o),k=Math.max(0,Math.floor((v.start-C)/n*o)),M=Math.floor((v.end-C)/n*o),g<0&&(g=0),b>c&&(b=c),k<0&&(k=0),M>c&&(M=c),y=Math.ceil(c/o)*n}}b-g>eu.itemsLimit&&this.itemsLimitError(),this.totalSize=y;let w;const _=g<=this.$_endIndex&&b>=this.$_startIndex;if(_)for(let v=0,x=m.length;v<x;v++)w=m[v],w.nr.used&&(t&&(w.nr.index=p[w.item[a]]),(w.nr.index==null||w.nr.index<g||w.nr.index>=b)&&this.unuseView(w));const F=_?null:new Map;let $,S,D;for(let v=g;v<b;v++){$=d[v];const x=a?$[a]:$;if(x==null)throw new Error(`Key is ${x} on item (keyField is '${a}')`);if(w=f.get(x),!n&&!u[v].size){w&&this.unuseView(w);continue}S=$[l];let C=h.get(S),N=!1;if(!w)_?C&&C.length?w=C.pop():w=this.addView(m,v,$,x,S):(D=F.get(S)||0,(!C||D>=C.length)&&(w=this.addView(m,v,$,x,S),this.unuseView(w,!0),C=h.get(S)),w=C[D],F.set(S,D+1)),f.delete(w.nr.key),w.nr.used=!0,w.nr.index=v,w.nr.key=x,w.nr.type=S,f.set(x,w),N=!0;else if(!w.nr.used&&(w.nr.used=!0,N=!0,C)){const E=C.indexOf(w);E!==-1&&C.splice(E,1)}w.item=$,N&&(v===d.length-1&&this.$emit("scroll-end"),v===0&&this.$emit("scroll-start")),n===null?(w.position=u[v-1].accumulator,w.offset=0):(w.position=Math.floor(v/o)*n,w.offset=v%o*i)}return this.$_startIndex=g,this.$_endIndex=b,this.emitUpdate&&this.$emit("update",g,b,k,M),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:_}},getListenerTarget(){let t=nu(this.$el);return window.document&&(t===window.document.documentElement||t===window.document.body)&&(t=window),t},getScroll(){const{$el:t,direction:e}=this,n=e==="vertical";let o;if(this.pageMode){const i=t.getBoundingClientRect(),s=n?i.height:i.width;let l=-(n?i.top:i.left),a=n?window.innerHeight:window.innerWidth;l<0&&(a+=l,l=0),l+a>s&&(a=s-l),o={start:l,end:l+a}}else n?o={start:t.scrollTop,end:t.scrollTop+t.clientHeight}:o={start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return o},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,vs?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(t){let e;const n=this.gridItems||1;this.itemSize===null?e=t>0?this.sizes[t-1].accumulator:0:e=Math.floor(t/n)*this.itemSize,this.scrollToPosition(e)},scrollToPosition(t){const e=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,o,i;if(this.pageMode){const s=nu(this.$el),l=s.tagName==="HTML"?0:s[e.scroll],a=s.getBoundingClientRect(),c=this.$el.getBoundingClientRect()[e.start]-a[e.start];n=s,o=e.scroll,i=t+l+c}else n=this.$el,o=e.scroll,i=t;n[o]=i},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((t,e)=>t.nr.index-e.nr.index)}}};const wk={key:0,ref:"before",class:"vue-recycle-scroller__slot"},_k={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function kk(t,e,n,o,i,s){const l=r.resolveComponent("ResizeObserver"),a=r.resolveDirective("observe-visibility");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:e[0]||(e[0]=(...d)=>s.handleScroll&&s.handleScroll(...d))},[t.$slots.before?(r.openBlock(),r.createElementBlock("div",wk,[r.renderSlot(t.$slots,"before")],512)):r.createCommentVNode("v-if",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listTag),{ref:"wrapper",style:r.normalizeStyle({[t.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:r.normalizeClass(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.pool,d=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.itemTag),r.mergeProps({key:d.nr.id,style:i.ready?{transform:`translate${t.direction==="vertical"?"Y":"X"}(${d.position}px) translate${t.direction==="vertical"?"X":"Y"}(${d.offset}px)`,width:n.gridItems?`${t.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${t.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&i.hoverKey===d.nr.key}]]},r.toHandlers(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=d.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:r.withCtx(()=>[r.renderSlot(t.$slots,"default",{item:d.item,index:d.nr.index,active:d.nr.used})]),_:2},1040,["style","class"]))),128)),r.renderSlot(t.$slots,"empty")]),_:3},8,["style","class"])),t.$slots.after?(r.openBlock(),r.createElementBlock("div",_k,[r.renderSlot(t.$slots,"after")],512)):r.createCommentVNode("v-if",!0),r.createVNode(l,{onNotify:s.handleResize},null,8,["onNotify"])],34)),[[a,s.handleVisibilityChange]])}ro.render=kk,ro.__file="src/components/RecycleScroller.vue";var wr={name:"DynamicScroller",components:{RecycleScroller:ro},provide(){return typeof ResizeObserver<"u"&&(this.$_resizeObserver=new ResizeObserver(t=>{requestAnimationFrame(()=>{if(Array.isArray(t)){for(const e of t)if(e.target&&e.target.$_vs_onResize){let n,o;if(e.borderBoxSize){const i=e.borderBoxSize[0];n=i.inlineSize,o=i.blockSize}else n=e.contentRect.width,o=e.contentRect.height;e.target.$_vs_onResize(e.target.$_vs_id,n,o)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...ou,minItemSize:{type:[Number,String],required:!0}},emits:["resize","visible"],data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:ru,itemsWithSize(){const t=[],{items:e,keyField:n,simpleArray:o}=this,i=this.vscrollData.sizes,s=e.length;for(let l=0;l<s;l++){const a=e[l],d=o?l:a[n];let c=i[d];typeof c>"u"&&!this.$_undefinedMap[d]&&(c=0),t.push({item:a,id:d,size:c})}return t}},watch:{items(){this.forceUpdate()},simpleArray:{handler(t){this.vscrollData.simpleArray=t},immediate:!0},direction(t){this.forceUpdate(!0)},itemsWithSize(t,e){const n=this.$el.scrollTop;let o=0,i=0;const s=Math.min(t.length,e.length);for(let a=0;a<s&&!(o>=n);a++)o+=e[a].size||this.minItemSize,i+=t[a].size||this.minItemSize;const l=i-o;l!==0&&(this.$el.scrollTop+=l)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={},this.$_events=mk()},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},unmounted(){this.$_events.all.clear()},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible(){this.$_events.emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate(t=!1){(t||this.simpleArray)&&(this.vscrollData.sizes={}),this.$_events.emit("vscroll:update",{force:!0})},scrollToItem(t){const e=this.$refs.scroller;e&&e.scrollToItem(t)},getItemSize(t,e=void 0){const n=this.simpleArray?e??this.items.indexOf(t):t[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const t=this.$el;this.$nextTick(()=>{t.scrollTop=t.scrollHeight+5e3;const e=()=>{t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(e)})};requestAnimationFrame(e)})}}};function Ck(t,e,n,o,i,s){const l=r.resolveComponent("RecycleScroller");return r.openBlock(),r.createBlock(l,r.mergeProps({ref:"scroller",items:s.itemsWithSize,"min-item-size":n.minItemSize,direction:t.direction,"key-field":"id","list-tag":t.listTag,"item-tag":t.itemTag},t.$attrs,{onResize:s.onScrollerResize,onVisible:s.onScrollerVisible}),{default:r.withCtx(({item:a,index:d,active:c})=>[r.renderSlot(t.$slots,"default",r.normalizeProps(r.guardReactiveProps({item:a.item,index:d,active:c,itemWithSize:a})))]),before:r.withCtx(()=>[r.renderSlot(t.$slots,"before")]),after:r.withCtx(()=>[r.renderSlot(t.$slots,"after")]),empty:r.withCtx(()=>[r.renderSlot(t.$slots,"empty")]),_:3},16,["items","min-item-size","direction","list-tag","item-tag","onResize","onVisible"])}wr.render=Ck,wr.__file="src/components/DynamicScroller.vue";var Ds={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},emits:["resize"],computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(t,e){if(this.$el.$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){const n=this.vscrollData.sizes[e],o=this.vscrollData.sizes[t];n!=null&&n!==o&&this.applySize(n)}},finalActive(t){this.size||(t?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?t?this.observeSize():this.unobserveSize():t&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(const t in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[t],this.onDataUpdate);this.vscrollParent.$_events.on("vscroll:update",this.onVscrollUpdate)}},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.vscrollParent.$_events.off("vscroll:update",this.onVscrollUpdate),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:t}){!this.finalActive&&t&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||t||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(t){this.$nextTick(()=>{if(this.id===t){const e=this.$el.offsetWidth,n=this.$el.offsetHeight;this.applyWidthHeight(e,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(t,e){const n=~~(this.vscrollParent.direction==="vertical"?e:t);n&&this.size!==n&&this.applySize(n)},applySize(t){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=t,this.emitResize&&this.$emit("resize",this.id)},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(this.$el),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(this.$el),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(t,e,n){this.id===t&&this.applyWidthHeight(e,n)}},render(){return r.h(this.tag,this.$slots.default())}};Ds.__file="src/components/DynamicScrollerItem.vue";function xk(t,e){t.component("".concat(e,"recycle-scroller"),ro),t.component("".concat(e,"RecycleScroller"),ro),t.component("".concat(e,"dynamic-scroller"),wr),t.component("".concat(e,"DynamicScroller"),wr),t.component("".concat(e,"dynamic-scroller-item"),Ds),t.component("".concat(e,"DynamicScrollerItem"),Ds)}var Sk={version:"2.0.0-beta.8",install:function(e,n){var o=Object.assign({},{installComponents:!0,componentsPrefix:""},n);for(var i in o)typeof o[i]<"u"&&(eu[i]=o[i]);o.installComponents&&xk(e,o.componentsPrefix)}};const vk=t=>{t.use(mu,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.directive("tooltip",X_),t.use(yf),t.use(J_),t.use(Sk),Object.entries(Uc).forEach(([e,n])=>{t.component(e,n)})};de.FeedMeUI=vk,de.components=Uc,de.useBreakpoints=yt,de.useDialog=lf,de.useDialogChild=df,de.useFocus=bn,de.useFormChild=Us,de.useProxiedModel=q,de.useSnackbar=cf,de.useValidation=Ws,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
54
+ */function fr(){return!0}const f_=Symbol("merge-proxy"),h_={get(t,e,n){return e===f_?n:t.get(e)},has(t,e){return t.has(e)},set:fr,deleteProperty:fr,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:fr,deleteProperty:fr}},ownKeys(t){return t.keys()}};function ws(t){return"value"in t?t.value:t}function hr(){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=ws(e[i])[o];if(s!==void 0)return s}},has(o){for(let i=e.length-1;i>=0;i--)if(o in ws(e[i]))return!0;return!1},keys(){const o=[];for(let i=0;i<e.length;i++)o.push(...Object.keys(ws(e[i])));return[...Array.from(new Set(o))]}},h_)}const mr=r.defineComponent({props:["render","props"],setup:t=>()=>typeof t.render=="function"||typeof t.render=="object"?r.h(t.render,t.props):t.render});function m_(t){const e=hr({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(i,s){return hr(i,s)}},t),n=o_(e),o=r.ref(n.initialState);return r.watchEffect(()=>{n.setOptions(i=>{var s;const l=new Proxy({},{get:(a,d)=>o.value[d]});return hr(i,t,{state:hr(l,(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 p_=["checked","disabled","indeterminate"],jc=J(r.defineComponent({__name:"FmTableCheckbox",props:{checked:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean},onChange:{type:Function}},setup(t){const e=t,n=r.computed(()=>e.indeterminate&&!e.checked?"remove":e.checked?"check_small":"");return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"fm-checkbox__input--container",onClick:i[0]||(i[0]=r.withModifiers((...s)=>o.onChange&&o.onChange(...s),["stop"]))},[r.createElementVNode("input",{checked:o.checked,class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.checked}),disabled:o.disabled,indeterminate:o.indeterminate,type:"checkbox"},null,10,p_),o.indeterminate||o.checked?(r.openBlock(),r.createBlock(H,{key:0,name:n.value,class:"fm-checkbox__input--checkmark",color:"#FFFFFF",size:"md"},null,8,["name"])):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-dbf1ded4"]]),g_={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]"},Wc=r.defineComponent({__name:"FmTableSelection",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(t){const n=q(t,"modelValue"),o=r.ref(!1);return(i,s)=>(r.openBlock(),r.createBlock(Ze,{onMenuChanged:s[0]||(s[0]=l=>o.value=l)},{"menu-button":r.withCtx(()=>{var l;return[r.createVNode(U,{variant:"tertiary",label:(l=i.items.find(a=>a.value===i.modelValue))==null?void 0:l.label,size:"md",icon:o.value?"expand_less":"expand_more","icon-position":"append"},null,8,["label","icon"])]}),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",g_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.items,l=>(r.openBlock(),r.createBlock(we,{key:l.value,"model-value":l.value===r.unref(n),label:l.label,value:l.value,"onUpdate:modelValue":a=>n.value=l.value},null,8,["model-value","label","value","onUpdate:modelValue"]))),128))])]),_:1}))}}),b_={class:"overflow-y-auto"},y_={class:"-translate-x-1/2 -translate-y-1/2 absolute flex flex-col gap-16 left-1/2 top-1/2"},$_=r.createElementVNode("span",{class:"text-fm-color-typo-secondary"},"Loading data...",-1),w_=["onClick"],__={key:0},k_={class:"fm-typo-body-md-400 line-clamp-2 w-full"},C_={key:1,class:"w-full"},x_={class:"-translate-x-1/2 -translate-y-1/2 absolute flex flex-col gap-16 left-1/2 top-1/2"},S_=r.createElementVNode("span",{class:"text-fm-color-typo-secondary"},"Loading data...",-1),v_=["onClick"],D_={class:"fm-typo-body-md-400 line-clamp-2 w-full"},M_={class:"flex gap-8 items-center"},V_=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),B_={class:"flex gap-8"},E_=r.defineComponent({__name:"FmTable",props:{modelValue:{default:{}},selection:{default:void 0},rowData:{default:()=>[]},columnDefs:{default:()=>[]},columnFilter:{default:void 0},searchValue:{default:""},pageCount:{default:0},rowCount:{default:void 0},fetchFn:{type:Function,default:void 0},pageSize:{default:10},loading:{type:Boolean,default:void 0},pinHeaderRow:{type:Boolean,default:!0},rowClassName:{},onRowClick:{type:Function,default:void 0},autoResetPageIndex:{type:Boolean},shrinkAt:{type:[String,Number,Boolean],default:"sm"},hideFooter:{type:Boolean},forceMobileFooter:{type:Boolean}},setup(t){const e=t,n=q(e,"modelValue"),o=q(e,"searchValue"),i=r.ref(e.rowData),s=()=>{let _=e.columnDefs;return e.selection&&(_=[{id:"row-selection",header:({table:x})=>r.createVNode(jc,{checked:x.getIsAllPageRowsSelected(),indeterminate:x.getIsSomePageRowsSelected(),onChange:x.getToggleAllPageRowsSelectedHandler()},null),cell:({row:x})=>r.createVNode(jc,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),onChange:x.getToggleSelectedHandler()},null),enableResizing:!1,meta:{headerClass:"py-4 pl-4 pr-16",cellClass:"pl-4 pr-16",width:"60px"}},..._]),_},l=r.ref([]);r.watch(()=>e.rowData,_=>{i.value=[..._]},{deep:!0});const a=r.ref({pageIndex:0,pageSize:e.pageSize}),d=m_({enableRowSelection:!!e.selection,enableMultiRowSelection:e.selection==="multiple",columns:s(),get data(){return i.value},state:{get pagination(){return typeof e.fetchFn=="function"?a.value:void 0},get globalFilter(){return o.value},get rowSelection(){return n.value},get sorting(){return l.value}},getCoreRowModel:r_(),getSortedRowModel:u_(),getFilteredRowModel:d_(),getPaginationRowModel:c_(),onRowSelectionChange:_=>{if(!h.value)return n.value=typeof _=="function"?_(n.value):_},onSortingChange:_=>{l.value=typeof _=="function"?_(l.value):_},onGlobalFilterChange:_=>{o.value=typeof _=="function"?_(o.value):_},autoResetPageIndex:e.autoResetPageIndex,manualPagination:typeof e.fetchFn=="function",...typeof e.fetchFn=="function"&&{onPaginationChange:_=>a.value=typeof _=="function"?_(a.value):_},pageCount:typeof e.fetchFn=="function"?e.pageCount:void 0,getSubRows:_=>_.subRows,getExpandedRowModel:i_()});r.watch(()=>a.value,_=>{f(_)});const c=r.ref(""),u=r.ref(!1);async function f(_){if(!e.fetchFn)return;u.value=!0;const x=`${Math.random()}`;c.value=x;try{await e.fetchFn(_)}catch{}finally{c.value===x&&(u.value=!1)}}const h=r.computed(()=>{const _=u.value;return typeof e.loading=="boolean"?e.loading:_});r.watch(()=>e.rowData,()=>{d.setOptions(_=>({..._,data:e.rowData}))}),r.watch([()=>e.pageCount,()=>e.rowCount],()=>{d.setOptions(_=>({..._,pageCount:e.pageCount,rowCount:e.rowCount}))}),r.watch(()=>e.pageSize,()=>{d.setPageSize(e.pageSize)}),r.watch([()=>e.columnFilter],([_])=>{d.setColumnFilters(()=>_??[])}),r.watch(()=>e.columnDefs,()=>{d.setOptions(_=>({..._,columns:s()}))}),r.onMounted(()=>{e.fetchFn&&e.fetchFn(d.getState().pagination),d.setPageSize(e.pageSize)});const m=r.ref(380);function p(_){var N;const x=((N=_.el)==null?void 0:N.scrollHeight)??0;m.value=Math.max(100,x)}const g=yt(),b=r.ref(),y=r.ref(typeof e.shrinkAt=="boolean"&&!e.shrinkAt?!1:g.isBreakpointKeyword(e.shrinkAt)&&g.isAtMost(e.shrinkAt));function C(_){const x=_.el;if(!x||typeof e.shrinkAt>"u"||typeof e.shrinkAt=="boolean"&&!e.shrinkAt)return;const N=Qi(function(){if(b.value=x.clientWidth,g.isBreakpointKeyword(e.shrinkAt)){y.value=g.isAtMost(e.shrinkAt);return}const E=Number(e.shrinkAt);if(isNaN(E)){y.value=!1;return}y.value=x.scrollWidth>=E},200);x.resizeTable??(x.resizeTable=function(){y.value=g.isBreakpointKeyword(e.shrinkAt)&&g.isAtMost(e.shrinkAt),N()}),window.addEventListener("resize",x.resizeTable),x.resizeTable()}function v(_){const x=_.el;!x||typeof e.shrinkAt>"u"||typeof e.shrinkAt=="boolean"&&!e.shrinkAt||x.resizeTable&&window.removeEventListener("resize",x.resizeTable)}return(_,x)=>{const N=r.resolveComponent("FmListItem"),E=r.resolveComponent("FmList"),R=r.resolveComponent("FmTableHeader");return r.openBlock(),r.createElementBlock("div",{class:"flex flex-col h-full relative",onVnodeMounted:C,onVnodeUnmounted:v},[r.createElementVNode("div",b_,[y.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[h.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pointer-events-none",style:r.normalizeStyle({height:`${m.value}px`})},[r.createElementVNode("div",y_,[r.createVNode($t),r.createVNode(Zt,{size:"xl"}),r.createElementVNode("div",null,[r.renderSlot(_.$slots,"loading-text",{},()=>[$_])]),r.createVNode($t)])],4)):(r.openBlock(),r.createBlock(E,{key:1,onVnodeMounted:p},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).getRowModel().rows,k=>r.renderSlot(_.$slots,"list-row",r.normalizeProps(r.mergeProps({key:k.id},k)),()=>[r.createVNode(N,{style:{padding:"0"},class:r.normalizeClass([{"bg-fm-color-neutral-gray-100":k.getIsSelected(),"cursor-pointer":typeof _.onRowClick=="function"}]),tag:"label"},{prepend:r.withCtx(()=>{var S,w,$,B,M;return[r.createVNode(r.unref(mr),{render:($=(w=(S=k.getVisibleCells().find(P=>P.column.id==="row-selection"))==null?void 0:S.column)==null?void 0:w.columnDef)==null?void 0:$.cell,props:(M=(B=k.getVisibleCells().find(P=>P.column.id==="row-selection"))==null?void 0:B.getContext)==null?void 0:M.call(B)},null,8,["render","props"])]}),default:r.withCtx(()=>[r.createElementVNode("div",{class:"flex flex-col gap-4 grow p-8",onClick:S=>{var w;return(w=_.onRowClick)==null?void 0:w.call(_,k)}},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.getVisibleCells(),S=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:S.id},[S.column.id!=="row-selection"?(r.openBlock(),r.createElementBlock("div",__,[r.createElementVNode("span",k_,[r.createVNode(r.unref(mr),{render:S.column.columnDef.cell,props:S.getContext()},null,8,["render","props"])])])):r.createCommentVNode("",!0)],64))),128))],8,w_)]),_:2},1032,["class"])])),128))]),_:3},512))],64)):(r.openBlock(),r.createElementBlock("table",C_,[_.pinHeaderRow?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(R,{key:0,table:r.unref(d)},null,8,["table"])),r.renderSlot(_.$slots,"pin-top"),r.createElementVNode("tbody",{onVnodeMounted:p},[h.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pointer-events-none",style:r.normalizeStyle({height:`${m.value}px`})},[r.createElementVNode("div",x_,[r.createVNode($t),r.createVNode(Zt,{size:"xl"}),r.createElementVNode("div",null,[r.renderSlot(_.$slots,"loading-text",{},()=>[S_])]),r.createVNode($t)])],4)):(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(r.unref(d).getRowModel().rows,k=>r.renderSlot(_.$slots,"table-row",r.normalizeProps(r.mergeProps({key:k.id},k)),()=>[r.createElementVNode("tr",{class:r.normalizeClass(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",[{"bg-fm-color-neutral-gray-100":k.getIsSelected(),"cursor-pointer":typeof _.onRowClick=="function"},_.rowClassName]]),onClick:S=>{var w;return(w=_.onRowClick)==null?void 0:w.call(_,k)}},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.getVisibleCells(),S=>{var w,$,B,M;return r.openBlock(),r.createElementBlock("td",{key:S.id,class:r.normalizeClass([h.value?"hidden":"","h-[52px] px-16 text-fm-color-typo-primary",((w=S.column.columnDef.meta)==null?void 0:w.cellClass)??"px-16"]),style:r.normalizeStyle({width:($=S.column.columnDef.meta)==null?void 0:$.width,maxWidth:(B=S.column.columnDef.meta)==null?void 0:B.maxWidth,textAlign:((M=S.column.columnDef.meta)==null?void 0:M.textAlign)??"left"})},[r.createElementVNode("span",D_,[r.createVNode(r.unref(mr),{render:S.column.columnDef.cell,props:S.getContext()},null,8,["render","props"])])],6)}),128))],10,v_)])),128))],512),_.pinHeaderRow?(r.openBlock(),r.createBlock(R,{key:1,class:"bg-fm-color-neutral-gray-100 sticky top-0",table:r.unref(d)},null,8,["table"])):r.createCommentVNode("",!0)]))]),_.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"basis-72 bg-white flex items-center justify-between px-24",style:r.normalizeStyle({maxWidth:b.value?`${b.value}px`:void 0})},[y.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex gap-24 items-center justify-between xs:hidden xs:invisible",{"hidden invisible":_.forceMobileFooter}])},[r.createElementVNode("div",M_,[V_,r.createVNode(Wc,{"model-value":r.unref(d).getState().pagination.pageSize,items:[...Array.from(Array(5),(k,S)=>(S+1)*10).map(k=>({label:k.toString(),value:k})),{label:"All",value:e.rowData.length}],"onUpdate:modelValue":x[0]||(x[0]=k=>r.unref(d).setPageSize(k))},null,8,["model-value","items"])]),r.createElementVNode("span",{class:r.normalizeClass(["fm-typo-body-lg-400 text-fm-color-typo-secondary xs:hidden xs:invisible",{"hidden invisible":_.forceMobileFooter}])},r.toDisplayString(e.rowData.length<r.unref(d).getState().pagination.pageSize?e.rowData.length:r.unref(d).getState().pagination.pageIndex*r.unref(d).getState().pagination.pageSize+1)+" - "+r.toDisplayString((r.unref(d).getState().pagination.pageIndex+1)*r.unref(d).getState().pagination.pageSize)+" of "+r.toDisplayString(e.rowCount??e.rowData.length)+" items ",3)],2)),r.createElementVNode("div",{class:r.normalizeClass(["flex gap-8 items-center",{"w-full justify-between":y.value||_.forceMobileFooter,"xs:w-full xs:justify-between":!y.value}])},[r.createVNode(Wc,{"model-value":r.unref(d).getState().pagination.pageIndex+1,items:Array.from(Array(r.unref(d).getPageCount()),(k,S)=>S+1).map(k=>({label:k.toString(),value:k})),"onUpdate:modelValue":x[1]||(x[1]=k=>r.unref(d).setPageIndex(k?k-1:0))},null,8,["model-value","items"]),r.createElementVNode("span",{class:r.normalizeClass(["fm-typo-body-lg-400 text-fm-color-typo-primary xs:mr-auto",{"mr-auto":y.value||_.forceMobileFooter}])}," of "+r.toDisplayString(r.unref(d).getPageCount())+" pages ",3),r.createElementVNode("div",B_,[r.createVNode(U,{disabled:!r.unref(d).getCanPreviousPage(),icon:"chevron_left",variant:"tertiary","icon-color":"neutral-black",onClick:x[2]||(x[2]=()=>r.unref(d).previousPage())},null,8,["disabled"]),r.createVNode(U,{disabled:!r.unref(d).getCanNextPage(),icon:"chevron_right",variant:"tertiary","icon-color":"neutral-black",onClick:x[3]||(x[3]=()=>r.unref(d).nextPage())},null,8,["disabled"])])],2)],4))],512)}}}),P_=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),N_=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(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>({vertical:n.vertical,disabled:n.disabled})),l=r.computed(()=>{const c=n.items.slice(0,n.showMoreAt-1),u=n.items.find(h=>{var m;return h.value===n.modelValue||((m=h.children)==null?void 0:m.find(p=>p.value===n.modelValue))}),f=c.map(h=>h.value);return u&&f.includes(u.value)?n.items.slice(0,n.showMoreAt):u?[...c,u]:c}),a=r.computed(()=>{const c=l.value.map(u=>u.value);return n.items.filter(u=>!c.includes(u.value))}),d=c=>{i.value=!1,o("update:modelValue",c)};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex",c.vertical?"flex-col":"flex-row items-center"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,f=>r.renderSlot(c.$slots,"default",r.normalizeProps(r.guardReactiveProps({...f,tabsProps:s.value})),()=>[r.createVNode(Ec,r.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?c.disabled:f.disabled,vertical:c.vertical,"onUpdate:modelValue":u[0]||(u[0]=h=>o("update:modelValue",h))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(r.openBlock(),r.createBlock(Ze,{key:0,"show-menu":i.value,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":c.vertical}]),placement:c.vertical?"right-start":"bottom-start",onMenuChanged:u[1]||(u[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",[c.vertical?"h-40":"h-[46px]"]])},[r.createVNode(H,{name:"more_vert"}),P_],2)]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,f=>{var h;return r.openBlock(),r.createElementBlock(r.Fragment,{key:f.value},[(h=f.children)!=null&&h.length?(r.openBlock(),r.createBlock(Ze,{key:0,placement:"right-start"},{"menu-button":r.withCtx(()=>[r.createVNode(we,{"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,expandable:""},{append:r.withCtx(()=>[f.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled"])]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,m=>(r.openBlock(),r.createBlock(we,{key:m.value,"model-value":n.modelValue===m.value,label:m.label,icon:m.icon,disabled:m.disabled,onClick:p=>d(m.value)},{append:r.withCtx(()=>[m.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:m.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"]))),128))]),_:2},1024)):(r.openBlock(),r.createBlock(we,{key:1,"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,onClick:m=>d(f.value)},{append:r.withCtx(()=>[f.badge?(r.openBlock(),r.createBlock(Ft,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"]))],64)}),128))]),_:1},8,["show-menu","class","placement"])):r.createCommentVNode("",!0)],2))}}),F_=["tabindex"],R_=r.defineComponent({__name:"FmCollapsibleTab",props:{modelValue:{default:void 0},label:{default:""},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:void 0},children:{default:()=>[]},indentation:{default:1},active:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},focusable:{type:Boolean,default:void 0}},setup(t){const e=t,n=q(e,"modelValue"),o=r.computed(()=>e.children.length>0),i=r.ref(!e.expand||e.disabled),s=r.computed(()=>{if(!o.value)return 0;function h(p){return p.children?[p,...p.children.flatMap(h)]:[p]}return 56*(e.children?e.children.flatMap(h):[]).length});function l(){if(!e.disabled){if(o.value){i.value=!i.value;return}n.value=e.value}}const a=r.computed(()=>typeof e.focusable=="boolean"?e.focusable:!e.disabled&&(!i.value||!o.value));function d(h){return h.children&&h.children.length?h.children.some(d):e.modelValue===h.value}const c=r.computed(()=>{const h=d(e);return o.value?h&&i.value:h}),u=r.computed(()=>e.children?e.children.map(({modelValue:h,indentation:m,active:p,focusable:g,...b})=>{const y=d(b);return{...b,expand:y,focusable:!b.disabled&&!i.value}}):[]),f=r.computed(()=>{switch(e.indentation){case 1:return 8;case 2:return 16;case 3:return 24;default:return 32}});return(h,m)=>{const p=r.resolveComponent("FmCollapsibleTab",!0),g=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle({paddingLeft:`${f.value}px`}),class:"flex flex-col px-8"},[r.withDirectives((r.openBlock(),r.createElementBlock("button",{class:r.normalizeClass(["flex fm-corner-radius-md gap-4 items-center px-16 py-8 focus-visible:outline-none",{"cursor-pointer focus-visible:bg-fm-color-opacity-md hover:bg-fm-color-opacity-sm ":!h.disabled,"cursor-not-allowed":h.disabled,"bg-fm-color-system-warning-100":c.value}]),tabindex:a.value?"0":"-1",type:"button",onClick:l},[h.icon?(r.openBlock(),r.createBlock(H,{key:0,class:r.normalizeClass({"text-fm-color-typo-disabled":h.disabled,"text-fm-color-typo-primary":!h.disabled&&!c.value,"text-fm-color-primary":!h.disabled&&c.value}),name:h.icon},null,8,["class","name"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["py-4 fm-typo-body-lg-400 text-left line-clamp-2",{"text-fm-color-typo-secondary":!h.disabled&&!c.value,"text-fm-color-primary":!h.disabled&&c.value,"text-fm-color-typo-disabled":h.disabled}])},r.toDisplayString(h.label),3),h.badge?(r.openBlock(),r.createBlock(Ft,{key:1,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",{key:2,style:r.normalizeStyle({transformOrigin:"center",transform:`rotate(${i.value?"0":"180"}deg)`,transition:"transform ease-out 250ms"}),class:"flex h-24 items-center w-24 ml-auto"},[r.createVNode(H,{class:r.normalizeClass({"text-fm-color-neutral-gray-300":!h.disabled,"text-fm-color-typo-disabled":h.disabled}),name:"expand_more",size:"md"},null,8,["class"])],4)):r.createCommentVNode("",!0)],10,F_)),[[g,!h.disabled]]),o.value?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle({maxHeight:i.value?0:`${s.value}px`,transition:"max-height 250ms",transitionTimingFunction:i.value?"ease-out":"ease-in"}),class:"flex flex-col overflow-hidden"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,(b,y)=>(r.openBlock(),r.createBlock(p,r.mergeProps({key:y,"model-value":r.unref(n),"onUpdate:modelValue":m[0]||(m[0]=C=>r.isRef(n)?n.value=C:null),indentation:h.indentation+1},b),null,16,["model-value","indentation"]))),128))],4)):r.createCommentVNode("",!0)],4)}}}),A_={class:"flex flex-col"},O_=r.defineComponent({__name:"FmCollapsibleTabs",props:{modelValue:{default:void 0},items:{default:()=>[]}},setup(t){const e=t,n=q(e,"modelValue"),o=r.computed(()=>e.items?e.items.map(({modelValue:s,...l})=>l):[]);function i(s){function l(d){return d.children?d.children.flatMap(l):[d.value]}return(s.children?s.children.flatMap(l):[s.value]).includes(e.modelValue)}return(s,l)=>(r.openBlock(),r.createElementBlock("div",A_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(a,d)=>(r.openBlock(),r.createBlock(R_,r.mergeProps({key:d},a,{"model-value":r.unref(n),"onUpdate:modelValue":l[0]||(l[0]=c=>r.isRef(n)?n.value=c:null),active:i(a),expand:i(a)}),null,16,["model-value","active","expand"]))),128))]))}}),I_=r.defineComponent({__name:"FmAvatar",props:{initials:{default:()=>""},name:{default:()=>""},src:{default:void 0},size:{default:()=>"md"}},setup(t){const e=t,n=r.computed(()=>{if(e.initials)return e.initials.slice(0,2);if(e.name){const[o,i]=e.name.split(" ");return i?`${o[0]}${i[0]}`:o.slice(0,2)}return e.src?"":"?"});return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex items-center justify-center rounded-xxxl uppercase",{"w-24 h-24 fm-typo-body-sm-700":o.size==="sm","w-40 h-40 fm-typo-body-md-700":o.size==="md","w-48 h-48 fm-typo-body-lg-700":o.size==="lg","w-56 h-56 fm-typo-body-lg-700":o.size==="xl","bg-fm-color-neutral-gray-100":!e.src}]),style:r.normalizeStyle({background:e.src?`url(${e.src})`:void 0,backgroundSize:e.src?"cover":void 0,backgroundPosition:e.src?"center":void 0,backgroundRepeat:e.src?"no-repeat":void 0})},r.toDisplayString(n.value),7))}}),T_=r.defineComponent({__name:"FmThumbnail",props:{src:{default:void 0},icon:{default:t=>t.src?"":"image"},size:{default:()=>"md"}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex items-center justify-center fm-corner-radius-md border-1 border-fm-color-neutral-gray-300",{"w-24 h-24 fm-typo-body-sm-700":n.size==="sm","w-40 h-40 fm-typo-body-md-700":n.size==="md","w-56 h-56 fm-typo-body-lg-700":n.size==="lg","w-72 h-72 fm-typo-body-lg-700":n.size==="xl","text-fm-color-neutral-gray-300 bg-fm-color-neutral-gray-100":!e.src}]),style:r.normalizeStyle({background:e.src?`url(${e.src})`:void 0,backgroundSize:e.src?"cover":void 0,backgroundPosition:e.src?"center":void 0,backgroundRepeat:e.src?"no-repeat":void 0})},[n.icon?(r.openBlock(),r.createBlock(H,{key:0,name:n.icon},null,8,["name"])):r.createCommentVNode("",!0)],6))}}),z_={class:"bg-white flex fm-corner-radius-md gap-4 items-center px-24 py-16"},L_={class:"flex gap-4 items-center xs:hidden"},H_={key:1,class:"hidden xs:flex"},Y_={class:"absolute bottom-16 hidden right-16 xs:inline"},j_=r.defineComponent({__name:"FmPageHead",props:{title:{default:()=>""},description:{default:()=>""},backButton:{type:Boolean,default:()=>!1},actions:{default:()=>[]},zIndexForBottomSheet:{default:void 0}},emits:["click:back","click:action"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{const l=[...n.actions],a=l.findIndex(h=>h.isPrimary),d=l[a],[c,u,...f]=l.filter((h,m)=>m!==a);return{primaryAction:d,firstSecondaryAction:c,secondSecondaryAction:u,showMoreSecondary:f,bottomSheetActions:l.filter(h=>!h.isPrimary),fabActions:l.filter(h=>h.isPrimary)}}),s=r.ref(!1);return(l,a)=>(r.openBlock(),r.createElementBlock("div",z_,[l.backButton?(r.openBlock(),r.createBlock(U,{key:0,type:"button",size:"md",variant:"tertiary",icon:"arrow_back","icon-color":"black",onClick:a[0]||(a[0]=d=>o("click:back"))})):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"prepend"),r.createVNode(os,{class:"flex-grow",title:l.title,description:l.description,"title-bold":""},null,8,["title","description"]),r.createElementVNode("div",L_,[i.value.firstSecondaryAction?(r.openBlock(),r.createBlock(U,{key:0,label:i.value.firstSecondaryAction.label,"prepend-icon":i.value.firstSecondaryAction.prependIcon,"append-icon":i.value.firstSecondaryAction.appendIcon,type:"button",variant:"tertiary",size:"md",onClick:a[1]||(a[1]=d=>o("click:action",i.value.firstSecondaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0),i.value.secondSecondaryAction?(r.openBlock(),r.createBlock(U,{key:1,label:i.value.secondSecondaryAction.label,"prepend-icon":i.value.secondSecondaryAction.prependIcon,"append-icon":i.value.secondSecondaryAction.appendIcon,type:"button",variant:"tertiary",size:"md",onClick:a[2]||(a[2]=d=>o("click:action",i.value.secondSecondaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0),i.value.showMoreSecondary.length>1?(r.openBlock(),r.createBlock(Ze,{key:2},{"menu-button":r.withCtx(()=>[r.createVNode(U,{label:"More","append-icon":"expand_more","icon-color":"black",type:"button",variant:"tertiary",size:"md"})]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value.showMoreSecondary,d=>(r.openBlock(),r.createBlock(we,{key:d.value,label:d.label,icon:d.prependIcon,onClick:c=>o("click:action",d.value)},null,8,["label","icon","onClick"]))),128))]),_:1})):i.value.showMoreSecondary.length===1?(r.openBlock(),r.createBlock(U,{key:3,label:i.value.showMoreSecondary[0].label,"prepend-icon":i.value.showMoreSecondary[0].prependIcon,"append-icon":i.value.showMoreSecondary[0].appendIcon,type:"button",variant:"tertiary",size:"md",onClick:a[3]||(a[3]=d=>o("click:action",i.value.showMoreSecondary[0].value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0),i.value.primaryAction?(r.openBlock(),r.createBlock(U,{key:4,label:i.value.primaryAction.label,"prepend-icon":i.value.primaryAction.prependIcon,"append-icon":i.value.primaryAction.appendIcon,type:"button",variant:"primary",size:"md",onClick:a[4]||(a[4]=d=>o("click:action",i.value.primaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0)]),i.value.bottomSheetActions.length>0?(r.openBlock(),r.createElementBlock("div",H_,[r.createVNode(U,{type:"button",size:"md",variant:"tertiary",icon:"more_vert","icon-color":"black",onClick:a[5]||(a[5]=d=>s.value=!0)})])):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"append"),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(Vr,{"model-value":s.value,"onUpdate:modelValue":a[6]||(a[6]=d=>s.value=d),"dismiss-away":"","z-index":n.zIndexForBottomSheet},{default:r.withCtx(()=>[r.createVNode(ts,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value.bottomSheetActions,d=>(r.openBlock(),r.createBlock(ns,{key:d.value,class:"hover:bg-fm-color-neutral-gray-100",label:d.label,onClick:c=>{o("click:action",d.value),s.value=!1}},null,8,["label","onClick"]))),128))]),_:1})]),_:1},8,["model-value","z-index"]),r.createElementVNode("div",Y_,[i.value.primaryAction?(r.openBlock(),r.createBlock(U,{key:0,class:"fm-shadow-light-100",label:i.value.primaryAction.label,"prepend-icon":i.value.primaryAction.prependIcon,"append-icon":i.value.primaryAction.appendIcon,type:"button",variant:"fab",size:"md",onClick:a[7]||(a[7]=d=>o("click:action",i.value.primaryAction.value))},null,8,["label","prepend-icon","append-icon"])):r.createCommentVNode("",!0)])]))]))}}),W_=["colSpan","onClick"],U_={class:"flex gap-8 items-center justify-between"},Uc={FmBadge:Ft,FmBottomSheet:Vr,FmBreadcrumb:zu,FmButton:U,FmButtonGroup:Ku,FmCard:Zu,FmCardActionArea:Ju,FmCardActions:ef,FmCardHeader:nf,FmCardMedia:rf,FmCardSection:Er,FmCardSubtitle:Hs,FmCardTitle:Ls,FmChip:Ys,FmChipGroup:Pr,FmDialog:uf,FmDropField:mf,FmDynamicDialog:Gs,FmLineChart:Eg,FmPieChart:Og,FmBarChart:Yg,FmCheckbox:md,FmDatePicker:u2,FmDatePickerMobile:Od,FmDateRangePicker:wb,FmDateRangePickerMobile:Ld,FmSimpleDatePicker:Ub,FmSimpleDatePickerMobile:Yd,FmSimpleDateRangePicker:xy,FmSimpleDateRangePickerMobile:jd,FmField:le,FmForm:Sy,FmFormGroup:_e,FmHelperText:pd,FmLabel:Kt,FmPhoneNumber:O3,FmPinField:z3,FmRadio:G3,FmRadioGroup:q3,FmSearch:Zi,FmGlobalSearch:_4,FmSelect:dn,FmStepperField:v4,FmSwitch:Ri,FmTextField:Ki,FmTextarea:M4,FmTimeInput:lr,FmTimePicker:L4,FmTimeRangePicker:X4,FmIcon:H,FmList:ts,FmListItem:ns,FmMenu:Ze,FmMenuDeprecated:ew,FmMenuDivider:Id,FmMenuHeader:nw,FmMenuItem:we,FmCircularProgress:Zt,FmLinearProgress:lw,FmSideSheet:fw,FmSnackbar:Bc,FmSpacer:$t,FmStep:yw,FmStepper:_w,FmTab:Ec,FmTable:E_,FmTableToolbar:Vw,FmTableHeader:r.defineComponent({__name:"FmTableHeader",props:{table:{}},setup(t){function e(n){return n.column.columnDef.meta}return(n,o)=>{const i=r.resolveComponent("FmIcon");return r.openBlock(),r.createElementBlock("thead",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.table.getHeaderGroups(),s=>(r.openBlock(),r.createElementBlock("tr",{key:s.id},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.headers,l=>{var a,d,c,u;return r.openBlock(),r.createElementBlock("th",{key:l.id,colSpan:l.colSpan,class:r.normalizeClass(["fm-typo-body-md-700 text-fm-color-typo-secondary border-b border-fm-color-neutral-gray-100 h-24 hover:bg-fm-color-opacity-sm",l.column.getCanSort()?"cursor-pointer select-none":"",((a=e(l))==null?void 0:a.headerClass)??"px-16 py-12"]),style:r.normalizeStyle({width:`${(d=e(l))==null?void 0:d.width}`,maxWidth:(c=e(l))==null?void 0:c.maxWidth,textAlign:((u=e(l))==null?void 0:u.textAlign)??"left"}),onClick:f=>{var h;return(h=l.column.getToggleSortingHandler())==null?void 0:h(f)}},[r.createElementVNode("div",U_,[l.isPlaceholder?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(mr),{key:0,render:l.column.columnDef.header,props:l.getContext()},null,8,["render","props"])),l.column.getCanSort()?(r.openBlock(),r.createBlock(i,{key:1,color:"neutral-gray-400",name:{asc:"arrow_upward",desc:"arrow_downward"}[l.column.getIsSorted()]??"unfold_more"},null,8,["name"])):r.createCommentVNode("",!0)])],14,W_)}),128))]))),128))])}}}),FmTabs:N_,FmCollapsibleTabs:O_,FmTooltip:Fd,FmAvatar:I_,FmThumbnail:T_,FmPageHead:j_,FmTopSheet:vc},G_=r.defineComponent({__name:"FmTooltipDirective",props:{reference:{},placement:{default:"top"},content:{default:""},disabled:{type:Boolean,default:!1},hideArrow:{type:Boolean,default:!1}},setup(t){const e=t,n=r.ref(!1),o=r.ref(null),i=r.ref(null),s=r.computed(()=>e.reference());let l;const{floatingStyles:a,middlewareData:d,placement:c}=Jn(s,o,{whileElementsMounted:Kn,placement:e.placement,middleware:[Zn(),Gn({mainAxis:6}),Ed({element:i})]}),u=r.computed(()=>{var p,g,b,y;const m={top:"bottom",right:"left",bottom:"top",left:"right"}[c.value];return{left:((p=d.value.arrow)==null?void 0:p.x)!=null?`${(g=d.value.arrow)==null?void 0:g.x}px`:"",top:((b=d.value.arrow)==null?void 0:b.y)!=null?`${(y=d.value.arrow)==null?void 0:y.y}px`:"",[m]:"-3px"}}),f=()=>{e.disabled||(l&&clearTimeout(l),l=setTimeout(()=>{n.value=!0},250))},h=()=>{e.disabled||(l&&clearTimeout(l),l=setTimeout(()=>{n.value=!1},250))};return r.onMounted(()=>{s.value.addEventListener("pointerdown",f),s.value.addEventListener("pointermove",m=>{m.pointerType!=="touch"&&f()}),s.value.addEventListener("pointerleave",h),s.value.addEventListener("pointerup",h)}),r.onBeforeUnmount(()=>{s.value.removeEventListener("pointerdown",f),s.value.removeEventListener("pointermove",m=>{m.pointerType!=="touch"&&f()}),s.value.removeEventListener("pointerleave",h),s.value.removeEventListener("pointerup",h)}),(m,p)=>n.value&&!m.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"tooltipContent",ref:o,class:"bg-fm-color-neutral-black fm-shadow-light-300 fm-typo-body-sm-400 max-w-[240px] px-16 py-12 rounded-lg text-fm-color-typo-white",style:r.normalizeStyle(r.unref(a))},[r.withDirectives(r.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:"absolute bg-fm-color-neutral-black h-8 rotate-45 rounded-[2px] w-8",style:r.normalizeStyle(u.value)},null,4),[[r.vShow,!m.hideArrow]]),r.createTextVNode(" "+r.toDisplayString(m.content),1)],4)):r.createCommentVNode("",!0)}});let _s;const Pt=r.ref([]);let Gc=0;const q_=()=>{if(_s)return;const t=document.createElement("div");document.body.appendChild(t),_s=r.createApp({render:()=>Pt.value.map(e=>r.h(G_,e))}),_s.mount(t)},pr=t=>{if(t){for(const e of["top","right","bottom","left"])if(t[e])return e}return"top"},qc=(t,e)=>{const{value:n,modifiers:o}=e;q_(),t.$_fmTooltipId=Gc,Gc+=1,typeof n=="string"?Pt.value.push({id:t.$_fmTooltipId,reference:()=>t,content:n.toString(),placement:pr(o),hideArrow:!1}):n&&typeof n=="object"&&Pt.value.push({id:t.$_fmTooltipId,reference:()=>t,content:n.content.toString(),placement:pr(o),disabled:n.disabled??!1,hideArrow:n.hideArrow??!1})},X_={mounted:qc,updated:(t,e)=>{const{value:n,modifiers:o}=e,i=Pt.value.findIndex(s=>s.id===t.$_fmTooltipId);if(i===-1){qc(t,e);return}typeof n=="string"?Pt.value[i]={id:t.$_fmTooltipId,reference:()=>t,content:n.toString(),placement:pr(o),hideArrow:!1}:n&&typeof n=="object"&&(Pt.value[i]={id:t.$_fmTooltipId,reference:()=>t,content:n.content.toString(),disabled:n.disabled??!1,placement:pr(o),hideArrow:n.hideArrow??!1})},beforeUnmount:t=>{const e=Pt.value.findIndex(n=>n.id===t.$_fmTooltipId);e!==-1&&Pt.value.splice(e,1)}},gr=16,K_=r.defineComponent({__name:"FmSnackbarToast",setup(t){const{breakpoints:e}=yt(),n=r.inject(Br),o=r.computed(()=>{var l;return[...((l=n==null?void 0:n.store)==null?void 0:l.snackbars)??[]].reduce(({currentSum:a,tops:d},c)=>{d.push({id:c.id,accumulatedHeight:a});const u=c.mountStage===Nt.EXPIRED?0:gr+c.renderedHeight;return{currentSum:a+u,tops:d}},{currentSum:gr,tops:new Array}).tops}),i=r.computed(()=>{var s,l;return(l=(s=n==null?void 0:n.store)==null?void 0:s.snackbars)==null?void 0:l.map(a=>{var c,u,f,h,m,p;let d=0;switch(a.mountStage){case Nt.PREMOUNT:{d=e.value.xs?0:gr;break}case Nt.MOUNTED:{d=((f=(u=(c=o.value)==null?void 0:c.find)==null?void 0:u.call(c,g=>g.id===a.id))==null?void 0:f.accumulatedHeight)||gr;break}case Nt.EXPIRED:{d=((p=(m=(h=o.value)==null?void 0:h.find)==null?void 0:m.call(h,g=>g.id===a.id))==null?void 0:p.accumulatedHeight)||0,d=Math.max(0,d-a.renderedHeight);break}}return{...a,top:d}})});return(s,l)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,a=>(r.openBlock(),r.createBlock(r.Teleport,{key:a.id,to:"body"},[r.createVNode(Bc,{class:"fixed transition-all z-10",variant:a.type,title:a.title,description:a.message,action:a.action,dismissable:a.dismissable,style:r.normalizeStyle(r.unref(e).xs?{bottom:`${a.top}px`,width:"calc(100vw - 32px)",right:"16px",opacity:a.mountStage===r.unref(Nt).EXPIRED?0:1}:{top:`${a.top}px`,right:a.mountStage===r.unref(Nt).PREMOUNT?"-20px":"16px",opacity:a.mountStage===r.unref(Nt).EXPIRED?0:1}),onVnodeMounted:d=>{var c;return(c=r.unref(n))==null?void 0:c.onSnackbarMounted(a.id,d.el.scrollHeight)},onOnAction:()=>{var d,c;(d=a==null?void 0:a.onAction)==null||d.call(a),(c=r.unref(n))==null||c.close(a.id)},onOnDismiss:()=>{var d;return(d=r.unref(n))==null?void 0:d.close(a.id)}},null,8,["variant","title","description","action","dismissable","style","onVnodeMounted","onOnAction","onOnDismiss"])]))),128))}});var Nt=(t=>(t.PREMOUNT="PREMOUNT",t.MOUNTED="MOUNTED",t.EXPIRED="EXPIRED",t))(Nt||{});class Z_{constructor(){T(this,"store",r.reactive({snackbars:new Array}))}open(e,n){const o=Math.random().toString(16).slice(2),i=[{...e,id:o,mountStage:"PREMOUNT",duration:n===null?null:n??5e3,renderedHeight:0,type:(e==null?void 0:e.type)??"info",dismissable:typeof(e==null?void 0:e.dismissable)=="boolean"?e.dismissable:!0},...this.store.snackbars];return this.store.snackbars=i,o}onSnackbarMounted(e,n){const o=this.store.snackbars.findIndex(s=>s.id===e);if(o===-1)return;const i=this.store.snackbars[o];this.store.snackbars[o]={...i,renderedHeight:n},setTimeout(()=>{const s=this.store.snackbars[o];this.store.snackbars[o]={...s,mountStage:"MOUNTED"}}),typeof i.duration=="number"&&setTimeout(()=>{this.close(e)},i.duration)}close(e){const n=this.store.snackbars.findIndex(i=>i.id===e);if(n===-1)return;const o=this.store.snackbars[n];this.store.snackbars[n]={...o,mountStage:"EXPIRED"},setTimeout(()=>{this.removeSnackbar(e)},500)}removeSnackbar(e){const n=this.store.snackbars.findIndex(o=>o.id===e);n!==-1&&this.store.snackbars.splice(n,1)}}const J_={install(t){t.provide(Br,new Z_);const e=document.body,n=r.createVNode(K_);n.appContext=t._context,r.render(n,e)}};function Q_(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var o=t.indexOf("rv:");return parseInt(t.substring(o+3,t.indexOf(".",o)),10)}var i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}let br;function ks(){ks.init||(ks.init=!0,br=Q_()!==-1)}var yr={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ks(),r.nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",br&&this.$el.appendChild(t),t.data="about:blank",br||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!br&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ek=r.withScopeId("data-v-b329ee4c");r.pushScopeId("data-v-b329ee4c");const tk={class:"resize-observer",tabindex:"-1"};r.popScopeId();const nk=ek((t,e,n,o,i,s)=>(r.openBlock(),r.createBlock("div",tk)));yr.render=nk,yr.__scopeId="data-v-b329ee4c",yr.__file="src/components/ResizeObserver.vue";function $r(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$r=function(e){return typeof e}:$r=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$r(t)}function ok(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xc(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function rk(t,e,n){return e&&Xc(t.prototype,e),n&&Xc(t,n),t}function Kc(t){return ik(t)||sk(t)||lk(t)||ak()}function ik(t){if(Array.isArray(t))return Cs(t)}function sk(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function lk(t,e){if(t){if(typeof t=="string")return Cs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cs(t,e)}}function Cs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function ak(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
55
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dk(t){var e;return typeof t=="function"?e={callback:t}:e=t,e}function ck(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,i,s,l=function(d){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];if(s=u,!(o&&d===i)){var h=n.leading;typeof h=="function"&&(h=h(d,i)),(!o||d!==i)&&h&&t.apply(void 0,[d].concat(Kc(s))),i=d,clearTimeout(o),o=setTimeout(function(){t.apply(void 0,[d].concat(Kc(s))),o=0},e)}};return l._clear=function(){clearTimeout(o),o=null},l}function Zc(t,e){if(t===e)return!0;if($r(t)==="object"){for(var n in t)if(!Zc(t[n],e[n]))return!1;return!0}return!1}var uk=function(){function t(e,n,o){ok(this,t),this.el=e,this.observer=null,this.frozen=!1,this.createObserver(n,o)}return rk(t,[{key:"createObserver",value:function(n,o){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=dk(n),this.callback=function(a,d){i.options.callback(a,d),a&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var s=this.options.throttleOptions||{},l=s.leading;this.callback=ck(this.callback,this.options.throttle,{leading:function(d){return l==="both"||l==="visible"&&d||l==="hidden"&&!d}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(a){var d=a[0];if(a.length>1){var c=a.find(function(f){return f.isIntersecting});c&&(d=c)}if(i.callback){var u=d.isIntersecting&&d.intersectionRatio>=i.threshold;if(u===i.oldResult)return;i.oldResult=u,i.callback(u,d)}},this.options.intersection),r.nextTick(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),t}();function Jc(t,e,n){var o=e.value;if(o)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new uk(t,o,n);t._vue_visibilityState=i}}function fk(t,e,n){var o=e.value,i=e.oldValue;if(!Zc(o,i)){var s=t._vue_visibilityState;if(!o){Qc(t);return}s?s.createObserver(o,n):Jc(t,{value:o},n)}}function Qc(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}var hk={beforeMount:Jc,updated:fk,unmounted:Qc};function mk(t){return{all:t=t||new Map,on:function(e,n){var o=t.get(e);o&&o.push(n)||t.set(e,[n])},off:function(e,n){var o=t.get(e);o&&o.splice(o.indexOf(n)>>>0,1)},emit:function(e,n){(t.get(e)||[]).slice().map(function(o){o(n)}),(t.get("*")||[]).slice().map(function(o){o(e,n)})}}}var eu={itemsLimit:1e3},pk=/(auto|scroll)/;function tu(t,e){return t.parentNode===null?e:tu(t.parentNode,e.concat([t]))}var xs=function(e,n){return getComputedStyle(e,null).getPropertyValue(n)},gk=function(e){return xs(e,"overflow")+xs(e,"overflow-y")+xs(e,"overflow-x")},bk=function(e){return pk.test(gk(e))};function nu(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var e=tu(t.parentNode,[]),n=0;n<e.length;n+=1)if(bk(e[n]))return e[n];return document.scrollingElement||document.documentElement}}function Ss(t){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ss(t)}var ou={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function ru(){return this.items.length&&Ss(this.items[0])!=="object"}var vs=!1;if(typeof window<"u"){vs=!1;try{var yk=Object.defineProperty({},"passive",{get:function(){vs=!0}});window.addEventListener("test",null,yk)}catch{}}let $k=0;var ro={name:"RecycleScroller",components:{ResizeObserver:yr},directives:{ObserveVisibility:hk},props:{...ou,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const t={"-1":{accumulator:0}},e=this.items,n=this.sizeField,o=this.minItemSize;let i=1e4,s=0,l;for(let a=0,d=e.length;a<d;a++)l=e[a][n]||o,l<i&&(i=l),s+=l,t[a]={accumulator:s,size:l};return this.$_computedMinItemSize=i,t}return[]},simpleArray:ru,itemIndexByKey(){const{keyField:t,items:e}=this,n={};for(let o=0,i=e.length;o<i;o++)n[e[o][t]]=o;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const t=this.$_lastUpdateScrollPosition;typeof t=="number"&&this.$nextTick(()=>{this.scrollToPosition(t)})},beforeUnmount(){this.removeListeners()},methods:{addView(t,e,n,o,i){const s=r.markRaw({id:$k++,index:e,used:!0,key:o,type:i}),l=r.shallowReactive({item:n,position:0,nr:s});return t.push(l),l},unuseView(t,e=!1){const n=this.$_unusedViews,o=t.nr.type;let i=n.get(o);i||(i=[],n.set(o,i)),i.push(t),e||(t.nr.used=!1,t.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(t){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const e=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});e(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&e()},this.updateInterval))}},handleVisibilityChange(t,e){this.ready&&(t||e.boundingClientRect.width!==0||e.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(t,e=!1){const n=this.itemSize,o=this.gridItems||1,i=this.itemSecondarySize||n,s=this.$_computedMinItemSize,l=this.typeField,a=this.simpleArray?null:this.keyField,d=this.items,c=d.length,u=this.sizes,f=this.$_views,h=this.$_unusedViews,m=this.pool,p=this.itemIndexByKey;let g,b,y,C,v;if(!c)g=b=C=v=y=0;else if(this.$_prerender)g=C=0,b=v=Math.min(this.prerender,d.length),y=null;else{const S=this.getScroll();if(e){let B=S.start-this.$_lastUpdateScrollPosition;if(B<0&&(B=-B),n===null&&B<s||B<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=S.start;const w=this.buffer;S.start-=w,S.end+=w;let $=0;if(this.$refs.before&&($=this.$refs.before.scrollHeight,S.start-=$),this.$refs.after){const B=this.$refs.after.scrollHeight;S.end+=B}if(n===null){let B,M=0,P=c-1,V=~~(c/2),F;do F=V,B=u[V].accumulator,B<S.start?M=V:V<c-1&&u[V+1].accumulator>S.start&&(P=V),V=~~((M+P)/2);while(V!==F);for(V<0&&(V=0),g=V,y=u[c-1].accumulator,b=V;b<c&&u[b].accumulator<S.end;b++);for(b===-1?b=d.length-1:(b++,b>c&&(b=c)),C=g;C<c&&$+u[C].accumulator<S.start;C++);for(v=C;v<c&&$+u[v].accumulator<S.end;v++);}else{g=~~(S.start/n*o);const B=g%o;g-=B,b=Math.ceil(S.end/n*o),C=Math.max(0,Math.floor((S.start-$)/n*o)),v=Math.floor((S.end-$)/n*o),g<0&&(g=0),b>c&&(b=c),C<0&&(C=0),v>c&&(v=c),y=Math.ceil(c/o)*n}}b-g>eu.itemsLimit&&this.itemsLimitError(),this.totalSize=y;let _;const x=g<=this.$_endIndex&&b>=this.$_startIndex;if(x)for(let S=0,w=m.length;S<w;S++)_=m[S],_.nr.used&&(t&&(_.nr.index=p[_.item[a]]),(_.nr.index==null||_.nr.index<g||_.nr.index>=b)&&this.unuseView(_));const N=x?null:new Map;let E,R,k;for(let S=g;S<b;S++){E=d[S];const w=a?E[a]:E;if(w==null)throw new Error(`Key is ${w} on item (keyField is '${a}')`);if(_=f.get(w),!n&&!u[S].size){_&&this.unuseView(_);continue}R=E[l];let $=h.get(R),B=!1;if(!_)x?$&&$.length?_=$.pop():_=this.addView(m,S,E,w,R):(k=N.get(R)||0,(!$||k>=$.length)&&(_=this.addView(m,S,E,w,R),this.unuseView(_,!0),$=h.get(R)),_=$[k],N.set(R,k+1)),f.delete(_.nr.key),_.nr.used=!0,_.nr.index=S,_.nr.key=w,_.nr.type=R,f.set(w,_),B=!0;else if(!_.nr.used&&(_.nr.used=!0,B=!0,$)){const M=$.indexOf(_);M!==-1&&$.splice(M,1)}_.item=E,B&&(S===d.length-1&&this.$emit("scroll-end"),S===0&&this.$emit("scroll-start")),n===null?(_.position=u[S-1].accumulator,_.offset=0):(_.position=Math.floor(S/o)*n,_.offset=S%o*i)}return this.$_startIndex=g,this.$_endIndex=b,this.emitUpdate&&this.$emit("update",g,b,C,v),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let t=nu(this.$el);return window.document&&(t===window.document.documentElement||t===window.document.body)&&(t=window),t},getScroll(){const{$el:t,direction:e}=this,n=e==="vertical";let o;if(this.pageMode){const i=t.getBoundingClientRect(),s=n?i.height:i.width;let l=-(n?i.top:i.left),a=n?window.innerHeight:window.innerWidth;l<0&&(a+=l,l=0),l+a>s&&(a=s-l),o={start:l,end:l+a}}else n?o={start:t.scrollTop,end:t.scrollTop+t.clientHeight}:o={start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return o},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,vs?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(t){let e;const n=this.gridItems||1;this.itemSize===null?e=t>0?this.sizes[t-1].accumulator:0:e=Math.floor(t/n)*this.itemSize,this.scrollToPosition(e)},scrollToPosition(t){const e=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,o,i;if(this.pageMode){const s=nu(this.$el),l=s.tagName==="HTML"?0:s[e.scroll],a=s.getBoundingClientRect(),c=this.$el.getBoundingClientRect()[e.start]-a[e.start];n=s,o=e.scroll,i=t+l+c}else n=this.$el,o=e.scroll,i=t;n[o]=i},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((t,e)=>t.nr.index-e.nr.index)}}};const wk={key:0,ref:"before",class:"vue-recycle-scroller__slot"},_k={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function kk(t,e,n,o,i,s){const l=r.resolveComponent("ResizeObserver"),a=r.resolveDirective("observe-visibility");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:e[0]||(e[0]=(...d)=>s.handleScroll&&s.handleScroll(...d))},[t.$slots.before?(r.openBlock(),r.createElementBlock("div",wk,[r.renderSlot(t.$slots,"before")],512)):r.createCommentVNode("v-if",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listTag),{ref:"wrapper",style:r.normalizeStyle({[t.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:r.normalizeClass(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.pool,d=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.itemTag),r.mergeProps({key:d.nr.id,style:i.ready?{transform:`translate${t.direction==="vertical"?"Y":"X"}(${d.position}px) translate${t.direction==="vertical"?"X":"Y"}(${d.offset}px)`,width:n.gridItems?`${t.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${t.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&i.hoverKey===d.nr.key}]]},r.toHandlers(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=d.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:r.withCtx(()=>[r.renderSlot(t.$slots,"default",{item:d.item,index:d.nr.index,active:d.nr.used})]),_:2},1040,["style","class"]))),128)),r.renderSlot(t.$slots,"empty")]),_:3},8,["style","class"])),t.$slots.after?(r.openBlock(),r.createElementBlock("div",_k,[r.renderSlot(t.$slots,"after")],512)):r.createCommentVNode("v-if",!0),r.createVNode(l,{onNotify:s.handleResize},null,8,["onNotify"])],34)),[[a,s.handleVisibilityChange]])}ro.render=kk,ro.__file="src/components/RecycleScroller.vue";var wr={name:"DynamicScroller",components:{RecycleScroller:ro},provide(){return typeof ResizeObserver<"u"&&(this.$_resizeObserver=new ResizeObserver(t=>{requestAnimationFrame(()=>{if(Array.isArray(t)){for(const e of t)if(e.target&&e.target.$_vs_onResize){let n,o;if(e.borderBoxSize){const i=e.borderBoxSize[0];n=i.inlineSize,o=i.blockSize}else n=e.contentRect.width,o=e.contentRect.height;e.target.$_vs_onResize(e.target.$_vs_id,n,o)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...ou,minItemSize:{type:[Number,String],required:!0}},emits:["resize","visible"],data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:ru,itemsWithSize(){const t=[],{items:e,keyField:n,simpleArray:o}=this,i=this.vscrollData.sizes,s=e.length;for(let l=0;l<s;l++){const a=e[l],d=o?l:a[n];let c=i[d];typeof c>"u"&&!this.$_undefinedMap[d]&&(c=0),t.push({item:a,id:d,size:c})}return t}},watch:{items(){this.forceUpdate()},simpleArray:{handler(t){this.vscrollData.simpleArray=t},immediate:!0},direction(t){this.forceUpdate(!0)},itemsWithSize(t,e){const n=this.$el.scrollTop;let o=0,i=0;const s=Math.min(t.length,e.length);for(let a=0;a<s&&!(o>=n);a++)o+=e[a].size||this.minItemSize,i+=t[a].size||this.minItemSize;const l=i-o;l!==0&&(this.$el.scrollTop+=l)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={},this.$_events=mk()},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},unmounted(){this.$_events.all.clear()},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible(){this.$_events.emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate(t=!1){(t||this.simpleArray)&&(this.vscrollData.sizes={}),this.$_events.emit("vscroll:update",{force:!0})},scrollToItem(t){const e=this.$refs.scroller;e&&e.scrollToItem(t)},getItemSize(t,e=void 0){const n=this.simpleArray?e??this.items.indexOf(t):t[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const t=this.$el;this.$nextTick(()=>{t.scrollTop=t.scrollHeight+5e3;const e=()=>{t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(e)})};requestAnimationFrame(e)})}}};function Ck(t,e,n,o,i,s){const l=r.resolveComponent("RecycleScroller");return r.openBlock(),r.createBlock(l,r.mergeProps({ref:"scroller",items:s.itemsWithSize,"min-item-size":n.minItemSize,direction:t.direction,"key-field":"id","list-tag":t.listTag,"item-tag":t.itemTag},t.$attrs,{onResize:s.onScrollerResize,onVisible:s.onScrollerVisible}),{default:r.withCtx(({item:a,index:d,active:c})=>[r.renderSlot(t.$slots,"default",r.normalizeProps(r.guardReactiveProps({item:a.item,index:d,active:c,itemWithSize:a})))]),before:r.withCtx(()=>[r.renderSlot(t.$slots,"before")]),after:r.withCtx(()=>[r.renderSlot(t.$slots,"after")]),empty:r.withCtx(()=>[r.renderSlot(t.$slots,"empty")]),_:3},16,["items","min-item-size","direction","list-tag","item-tag","onResize","onVisible"])}wr.render=Ck,wr.__file="src/components/DynamicScroller.vue";var Ds={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},emits:["resize"],computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(t,e){if(this.$el.$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){const n=this.vscrollData.sizes[e],o=this.vscrollData.sizes[t];n!=null&&n!==o&&this.applySize(n)}},finalActive(t){this.size||(t?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?t?this.observeSize():this.unobserveSize():t&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(const t in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[t],this.onDataUpdate);this.vscrollParent.$_events.on("vscroll:update",this.onVscrollUpdate)}},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.vscrollParent.$_events.off("vscroll:update",this.onVscrollUpdate),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:t}){!this.finalActive&&t&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||t||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(t){this.$nextTick(()=>{if(this.id===t){const e=this.$el.offsetWidth,n=this.$el.offsetHeight;this.applyWidthHeight(e,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(t,e){const n=~~(this.vscrollParent.direction==="vertical"?e:t);n&&this.size!==n&&this.applySize(n)},applySize(t){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=t,this.emitResize&&this.$emit("resize",this.id)},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(this.$el),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(this.$el),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(t,e,n){this.id===t&&this.applyWidthHeight(e,n)}},render(){return r.h(this.tag,this.$slots.default())}};Ds.__file="src/components/DynamicScrollerItem.vue";function xk(t,e){t.component("".concat(e,"recycle-scroller"),ro),t.component("".concat(e,"RecycleScroller"),ro),t.component("".concat(e,"dynamic-scroller"),wr),t.component("".concat(e,"DynamicScroller"),wr),t.component("".concat(e,"dynamic-scroller-item"),Ds),t.component("".concat(e,"DynamicScrollerItem"),Ds)}var Sk={version:"2.0.0-beta.8",install:function(e,n){var o=Object.assign({},{installComponents:!0,componentsPrefix:""},n);for(var i in o)typeof o[i]<"u"&&(eu[i]=o[i]);o.installComponents&&xk(e,o.componentsPrefix)}};const vk=t=>{t.use(mu,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.directive("tooltip",X_),t.use(yf),t.use(J_),t.use(Sk),Object.entries(Uc).forEach(([e,n])=>{t.component(e,n)})};de.FeedMeUI=vk,de.components=Uc,de.useBreakpoints=yt,de.useDialog=lf,de.useDialogChild=df,de.useFocus=bn,de.useFormChild=Us,de.useProxiedModel=q,de.useSnackbar=cf,de.useValidation=Ws,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});