codesaaz-core 0.0.14 → 0.0.16
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.
- package/dist/codesaaz-core.css +1 -1
- package/dist/codesaaz.es.js +6453 -4399
- package/dist/codesaaz.umd.js +31 -26
- package/package.json +2 -2
package/dist/codesaaz.umd.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Ve,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],a):(Ve=typeof globalThis<"u"?globalThis:Ve||self,a(Ve.Codesaaz={},Ve.Vue,Ve.VueRouter,Ve.PrimeVue))})(this,function(Ve,a,Ye,Jr){"use strict";var ZC=Object.defineProperty;var e1=(Ve,a,Ye)=>a in Ve?ZC(Ve,a,{enumerable:!0,configurable:!0,writable:!0,value:Ye}):Ve[a]=Ye;var z=(Ve,a,Ye)=>e1(Ve,typeof a!="symbol"?a+"":a,Ye);var po;const is={get:ss("GET"),post:ss("POST"),put:ss("PUT"),delete:ss("DELETE")};function ss(t){return(e,n)=>{const i={method:t,headers:{}};return n&&(i.headers["Content-Type"]="application/json",i.body=JSON.stringify(n)),fetch(e,i).then(gf)}}function gf(t){return t.text().then(e=>{const n=e&&JSON.parse(e);return t.ok?n:Promise.reject(n)})}/*!
|
|
2
2
|
* pinia v2.3.1
|
|
3
3
|
* (c) 2025 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/let dr;const js=n=>dr=n,Wd=Symbol();function zs(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Ln;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Ln||(Ln={}));const ur=()=>{};function fr(n,e,t,i=ur){n.push(e);const s=()=>{const o=n.indexOf(e);o>-1&&(n.splice(o,1),i())};return!t&&r.getCurrentScope()&&r.onScopeDispose(s),s}function kn(n,...e){n.slice().forEach(t=>{t(...e)})}const Hd=n=>n(),hr=Symbol(),Ws=Symbol();function Hs(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];zs(s)&&zs(i)&&n.hasOwnProperty(t)&&!r.isRef(i)&&!r.isReactive(i)?n[t]=Hs(s,i):n[t]=i}return n}const Ud=Symbol();function qd(n){return!zs(n)||!n.hasOwnProperty(Ud)}const{assign:$t}=Object;function Yd(n){return!!(r.isRef(n)&&n.effect)}function Kd(n,e,t,i){const{state:s,actions:o,getters:a}=e,l=t.state.value[n];let c;function d(){l||(t.state.value[n]=s?s():{});const u=r.toRefs(t.state.value[n]);return $t(u,o,Object.keys(a||{}).reduce((f,h)=>(f[h]=r.markRaw(r.computed(()=>{js(t);const m=t._s.get(n);return a[h].call(m,m)})),f),{}))}return c=mr(n,d,e,t,i,!0),c}function mr(n,e,t={},i,s,o){let a;const l=$t({actions:{}},t),c={deep:!0};let d,u,f=[],h=[],m;const p=i.state.value[n];!o&&!p&&(i.state.value[n]={}),r.ref({});let g;function y(x){let v;d=u=!1,typeof x=="function"?(x(i.state.value[n]),v={type:Ln.patchFunction,storeId:n,events:m}):(Hs(i.state.value[n],x),v={type:Ln.patchObject,payload:x,storeId:n,events:m});const B=g=Symbol();r.nextTick().then(()=>{g===B&&(d=!0)}),u=!0,kn(f,v,i.state.value[n])}const b=o?function(){const{state:v}=t,B=v?v():{};this.$patch(D=>{$t(D,B)})}:ur;function _(){a.stop(),f=[],h=[],i._s.delete(n)}const w=(x,v="")=>{if(hr in x)return x[Ws]=v,x;const B=function(){js(i);const D=Array.from(arguments),T=[],I=[];function q(j){T.push(j)}function L(j){I.push(j)}kn(h,{args:D,name:B[Ws],store:k,after:q,onError:L});let A;try{A=x.apply(this&&this.$id===n?this:k,D)}catch(j){throw kn(I,j),j}return A instanceof Promise?A.then(j=>(kn(T,j),j)).catch(j=>(kn(I,j),Promise.reject(j))):(kn(T,A),A)};return B[hr]=!0,B[Ws]=v,B},E={_p:i,$id:n,$onAction:fr.bind(null,h),$patch:y,$reset:b,$subscribe(x,v={}){const B=fr(f,x,v.detached,()=>D()),D=a.run(()=>r.watch(()=>i.state.value[n],T=>{(v.flush==="sync"?u:d)&&x({storeId:n,type:Ln.direct,events:m},T)},$t({},c,v)));return B},$dispose:_},k=r.reactive(E);i._s.set(n,k);const S=(i._a&&i._a.runWithContext||Hd)(()=>i._e.run(()=>(a=r.effectScope()).run(()=>e({action:w}))));for(const x in S){const v=S[x];if(r.isRef(v)&&!Yd(v)||r.isReactive(v))o||(p&&qd(v)&&(r.isRef(v)?v.value=p[x]:Hs(v,p[x])),i.state.value[n][x]=v);else if(typeof v=="function"){const B=w(v,x);S[x]=B,l.actions[x]=v}}return $t(k,S),$t(r.toRaw(k),S),Object.defineProperty(k,"$state",{get:()=>i.state.value[n],set:x=>{y(v=>{$t(v,x)})}}),i._p.forEach(x=>{$t(k,a.run(()=>x({store:k,app:i._a,pinia:i,options:l})))}),p&&o&&t.hydrate&&t.hydrate(k.$state,p),d=!0,u=!0,k}/*! #__NO_SIDE_EFFECTS__ */function pr(n,e,t){let i,s;const o=typeof e=="function";typeof n=="string"?(i=n,s=o?t:e):(s=n,i=n.id);function a(l,c){const d=r.hasInjectionContext();return l=l||(d?r.inject(Wd,null):null),l&&js(l),l=dr,l._s.has(i)||(o?mr(i,e,s,l):Kd(i,s,l)),l._s.get(i)}return a.$id=i,a}const Ze=pr("globalConfigsStore",{state:()=>({globalConfigs:{}}),actions:{setBaseUrl(n){this.globalConfigs.baseUrl=n},setAppId(n){this.globalConfigs.appId=n}},getters:{getBaseUrl:n=>()=>n.globalConfigs.baseUrl,getAppId:n=>()=>n.globalConfigs.appId}});class gr{constructor(){let e="http://localhost:7070";const t=Ze();t.getBaseUrl()!=null&&t.getBaseUrl()!=""&&(e=t.getBaseUrl()),this.baseUrl=e}async post(e,t){return await Ri.post(this.baseUrl+e,t)}async put(e,t){return await Ri.put(this.baseUrl+e,t)}async delete(e,t){return await Ri.delete(this.baseUrl+e,t)}async get(e){return await Ri.get(this.baseUrl+e)}}class sn{constructor(){this.httpService=new gr}async getEntityRecords(e){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/record`)}async searchEntityRecords(e,t){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/record/search`,t)}async getRelatedEntityRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/link/record/${t}?fetchRelatedEntities=true`)}async saveRelatedEntityRecord(e,t,i){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/link/record/${t}`,i)}async getRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/record/${t}?fetchRelatedEntities=false`)}async addRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/record`,t)}async updateRecord(e,t,i){return this.appId==null&&this.getAppId(),await this.httpService.put(`/api/app/v1/${this.appId}/entity/${e}/record/${t}`,i)}async deleteRecord(e,t){return this.appId==null&&this.getAppId(),await this.httpService.delete(`/api/app/v1/${this.appId}/entity/${e}/record/${t}`)}async getAppId(){const e=Ze();this.appId=e.getAppId()}}function Xd(n=""){const e=new sn,t={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};let i=r.ref({}),s=r.ref([]),o=r.ref([]),a=r.ref([]);const l=r.ref(""),c=r.ref(1),d=r.ref(25),u=r.ref(0),f=r.ref(0),h=r.ref(0),m=r.ref(!1),p=r.ref([]),g=r.ref(""),y=r.ref({}),b=async(D,T=!0)=>{m.value=!0;try{const I=await e.getEntityRecords(D);I&&I.response&&(i.value=I.response,s.value=I.response.result,a.value=I.response.entity.entityDefinition.columns,o.value=w(I.response.entity.entityDefinition.columns),f.value=I.response.totalRecords,B())}catch(I){console.error("Error fetching entity:",I.errorMessage)}finally{m.value=!1}},_=async(D=!0)=>{m.value=!0;try{const T={sortBy:[l.value],sortDirection:c.value===1?"ASC":"DESC",pageSize:d.value,currentPage:u.value,columnList:null,filter:p.value,fullTextSearch:g.value};Object.keys(T.filter).length===0&&(T.filter=[]);const I=await e.searchEntityRecords(n,T);I&&I.response&&(m.value=!1,i.value=I.response,s.value=I.response.result,f.value=I.response.totalRecords,h.value=u.value*d.value)}catch(T){console.error("Error fetching entity:",T.errorMessage)}finally{m.value=!1}},w=D=>D.map(T=>({field:T.name,name:T.displayName?T.displayName:T.name,filterable:T.filterable,datatype:T.type,sortable:!0,displayFormatKey:T.displayFormatKey,displayFormat:T.displayFormat})),E=D=>{l.value=D.sortField,c.value=D.sortOrder,h.value=0,_()},k=D=>{d.value=D.rows,u.value=D.page,h.value=D.first,_()},C=()=>{_()},S=()=>{_()},x=D=>{switch(D.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},v=D=>{const T=o.value.find(I=>I.field===D);return T?T.datatype:null},B=()=>{for(let D=0;D<a.value.length;D++){const T=a.value[D];if(T.primaryKey&&T.primaryKey==!0){y.value=T,l.value=T.name;break}}};return{items:s,headers:o,first:h,totalRecords:f,pageSize:d,loading:m,sortBy:l,sortDirection:c,operatorMap:t,filterToSend:p,fullTextSearch:g,listingResponse:i,primarayKeyColumn:y,onFullTextSearch:S,getDatatypeByField:v,getColumnDatatype:x,onSort:E,onPage:k,onFilter:C,fetchEntityFilterData:_,fetchEntityByName:b}}const Be=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},Gd={key:0,class:"field flex flex-col mb-3"},Qd=["for"],Jd={key:0},Zd={key:0,class:"font-bold"},eu={key:1,class:"font-bold text-color-hint"},tu={key:1,class:"flex items-center mb-3"},nu={class:"ml-2"},iu={key:0},zi=Be({__name:"EntityForm",props:r.mergeModels({column:Object,errors:Array},{modelValue:{},modelModifiers:{}}),emits:r.mergeModels(["input"],["update:modelValue"]),setup(n,{emit:e}){const t=r.useModel(n,"modelValue"),i=e,s=o=>{i("input",o.name)};if(n.column&&!n.column.inputComponent){let o="";switch(n.column.type.toLowerCase()){case"text":o="INPUT_TEXT";break;case"int":o="INPUT_NUMBER";break;case"float":o="INPUT_FLOAT";break;case"boolean":o="INPUT_BOOLEAN";break;case"uuid":o="INPUT_UUID";break;case"date":o="INPUT_DATE";break;default:o="INPUT_STRING"}n.column.inputComponent=o}return(o,a)=>{var f,h,m,p,g;const l=r.resolveComponent("DatePicker"),c=r.resolveComponent("InputNumber"),d=r.resolveComponent("InputText"),u=r.resolveComponent("Checkbox");return r.openBlock(),r.createElementBlock(r.Fragment,null,[n.column.inputComponent.toLowerCase()!="input_boolean"?(r.openBlock(),r.createElementBlock("div",Gd,[r.createElementVNode("label",{class:"mb-1",for:n.column.name},[r.createTextVNode(r.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(r.openBlock(),r.createElementBlock("span",Jd,"*")):r.createCommentVNode("",!0)],8,Qd),n.column.inputComponent.toLowerCase()=="input_date"?(r.openBlock(),r.createBlock(l,{key:0,modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=y=>t.value=y),id:n.column.name,name:n.column.name,onDateSelect:a[1]||(a[1]=y=>s(n.column)),invalid:((f=n.errors)==null?void 0:f.length)>0},null,8,["modelValue","id","name","invalid"])):n.column.inputComponent.toLowerCase()=="input_number"?(r.openBlock(),r.createBlock(c,{key:1,modelValue:t.value,"onUpdate:modelValue":a[2]||(a[2]=y=>t.value=y),id:n.column.name,name:n.column.name,allowEmpty:!0,format:!1,onInput:a[3]||(a[3]=y=>s(n.column)),invalid:((h=n.errors)==null?void 0:h.length)>0},null,8,["modelValue","id","name","invalid"])):n.column.type.toLowerCase()=="input_float"?(r.openBlock(),r.createBlock(c,{key:2,type:"decimal",minFractionDigits:1,id:n.column.name,allowEmpty:!0,format:!1,name:n.column.name,onInput:a[4]||(a[4]=y=>s(n.column)),invalid:((m=n.errors)==null?void 0:m.length)>0},null,8,["id","name","invalid"])):(r.openBlock(),r.createBlock(d,{key:3,modelValue:t.value,"onUpdate:modelValue":a[5]||(a[5]=y=>t.value=y),id:n.column.name,name:n.column.name,onInput:a[6]||(a[6]=y=>s(n.column)),invalid:((p=n.errors)==null?void 0:p.length)>0},null,8,["modelValue","id","name","invalid"])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.errors,(y,b)=>(r.openBlock(),r.createElementBlock("div",{key:b,class:"text-red-500 mt-1 ml-2"},[y.includes("hint:")?(r.openBlock(),r.createElementBlock("small",eu,r.toDisplayString(y.split(":")[1]),1)):(r.openBlock(),r.createElementBlock("small",Zd,r.toDisplayString(y),1))]))),128))])):r.createCommentVNode("",!0),n.column.inputComponent.toLowerCase()=="input_boolean"?(r.openBlock(),r.createElementBlock("div",tu,[r.createVNode(u,{modelValue:t.value,"onUpdate:modelValue":a[7]||(a[7]=y=>t.value=y),invalid:((g=n.errors)==null?void 0:g.length)>0,onInput:a[8]||(a[8]=y=>s(n.column.name)),binary:""},null,8,["modelValue","invalid"]),r.createElementVNode("label",nu,[r.createTextVNode(r.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(r.openBlock(),r.createElementBlock("span",iu,"*")):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-8820d348"]]);/**
|
|
5
|
+
*/let Qr;const go=t=>Qr=t,yf=Symbol();function yo(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Qn;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Qn||(Qn={}));const Zr=()=>{};function ea(t,e,n,i=Zr){t.push(e);const s=()=>{const o=t.indexOf(e);o>-1&&(t.splice(o,1),i())};return!n&&a.getCurrentScope()&&a.onScopeDispose(s),s}function Pn(t,...e){t.slice().forEach(n=>{n(...e)})}const bf=t=>t(),ta=Symbol(),bo=Symbol();function xo(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,i)=>t.set(i,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n],s=t[n];yo(s)&&yo(i)&&t.hasOwnProperty(n)&&!a.isRef(i)&&!a.isReactive(i)?t[n]=xo(s,i):t[n]=i}return t}const xf=Symbol();function _f(t){return!yo(t)||!t.hasOwnProperty(xf)}const{assign:qt}=Object;function kf(t){return!!(a.isRef(t)&&t.effect)}function Sf(t,e,n,i){const{state:s,actions:o,getters:r}=e,l=n.state.value[t];let c;function d(){l||(n.state.value[t]=s?s():{});const u=a.toRefs(n.state.value[t]);return qt(u,o,Object.keys(r||{}).reduce((f,h)=>(f[h]=a.markRaw(a.computed(()=>{go(n);const m=n._s.get(t);return r[h].call(m,m)})),f),{}))}return c=na(t,d,e,n,i,!0),c}function na(t,e,n={},i,s,o){let r;const l=qt({actions:{}},n),c={deep:!0};let d,u,f=[],h=[],m;const p=i.state.value[t];!o&&!p&&(i.state.value[t]={}),a.ref({});let g;function y(_){let O;d=u=!1,typeof _=="function"?(_(i.state.value[t]),O={type:Qn.patchFunction,storeId:t,events:m}):(xo(i.state.value[t],_),O={type:Qn.patchObject,payload:_,storeId:t,events:m});const P=g=Symbol();a.nextTick().then(()=>{g===P&&(d=!0)}),u=!0,Pn(f,O,i.state.value[t])}const b=o?function(){const{state:O}=n,P=O?O():{};this.$patch(v=>{qt(v,P)})}:Zr;function x(){r.stop(),f=[],h=[],i._s.delete(t)}const w=(_,O="")=>{if(ta in _)return _[bo]=O,_;const P=function(){go(i);const v=Array.from(arguments),T=[],R=[];function U(j){T.push(j)}function Y(j){R.push(j)}Pn(h,{args:v,name:P[bo],store:k,after:U,onError:Y});let L;try{L=_.apply(this&&this.$id===t?this:k,v)}catch(j){throw Pn(R,j),j}return L instanceof Promise?L.then(j=>(Pn(T,j),j)).catch(j=>(Pn(R,j),Promise.reject(j))):(Pn(T,L),L)};return P[ta]=!0,P[bo]=O,P},E={_p:i,$id:t,$onAction:ea.bind(null,h),$patch:y,$reset:b,$subscribe(_,O={}){const P=ea(f,_,O.detached,()=>v()),v=r.run(()=>a.watch(()=>i.state.value[t],T=>{(O.flush==="sync"?u:d)&&_({storeId:t,type:Qn.direct,events:m},T)},qt({},c,O)));return P},$dispose:x},k=a.reactive(E);i._s.set(t,k);const S=(i._a&&i._a.runWithContext||bf)(()=>i._e.run(()=>(r=a.effectScope()).run(()=>e({action:w}))));for(const _ in S){const O=S[_];if(a.isRef(O)&&!kf(O)||a.isReactive(O))o||(p&&_f(O)&&(a.isRef(O)?O.value=p[_]:xo(O,p[_])),i.state.value[t][_]=O);else if(typeof O=="function"){const P=w(O,_);S[_]=P,l.actions[_]=O}}return qt(k,S),qt(a.toRaw(k),S),Object.defineProperty(k,"$state",{get:()=>i.state.value[t],set:_=>{y(O=>{qt(O,_)})}}),i._p.forEach(_=>{qt(k,r.run(()=>_({store:k,app:i._a,pinia:i,options:l})))}),p&&o&&n.hydrate&&n.hydrate(k.$state,p),d=!0,u=!0,k}/*! #__NO_SIDE_EFFECTS__ */function ia(t,e,n){let i,s;const o=typeof e=="function";typeof t=="string"?(i=t,s=o?n:e):(s=t,i=t.id);function r(l,c){const d=a.hasInjectionContext();return l=l||(d?a.inject(yf,null):null),l&&go(l),l=Qr,l._s.has(i)||(o?na(i,e,s,l):Sf(i,s,l)),l._s.get(i)}return r.$id=i,r}const ot=ia("globalConfigsStore",{state:()=>({globalConfigs:{}}),actions:{setBaseUrl(t){this.globalConfigs.baseUrl=t},setAppId(t){this.globalConfigs.appId=t}},getters:{getBaseUrl:t=>()=>t.globalConfigs.baseUrl,getAppId:t=>()=>t.globalConfigs.appId}});class sa{constructor(){let e="http://localhost:7070";const n=ot();n.getBaseUrl()!=null&&n.getBaseUrl()!=""&&(e=n.getBaseUrl()),this.baseUrl=e}async post(e,n){return await is.post(this.baseUrl+e,n)}async put(e,n){return await is.put(this.baseUrl+e,n)}async delete(e,n){return await is.delete(this.baseUrl+e,n)}async get(e){return await is.get(this.baseUrl+e)}}class kt{constructor(){this.httpService=new sa}async getEntityRecords(e){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/record`)}async searchEntityRecords(e,n){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/record/search`,n)}async getRelatedEntityRecord(e,n){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/link/record/${n}?fetchRelatedEntities=true`)}async saveRelatedEntityRecord(e,n,i){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/link/record/${n}`,i)}async getRecord(e,n){return this.appId==null&&this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity/${e}/record/${n}?fetchRelatedEntities=false`)}async addRecord(e,n){return this.appId==null&&this.getAppId(),await this.httpService.post(`/api/app/v1/${this.appId}/entity/${e}/record`,n)}async updateRecord(e,n,i){return this.appId==null&&this.getAppId(),await this.httpService.put(`/api/app/v1/${this.appId}/entity/${e}/record/${n}`,i)}async deleteRecord(e,n){return this.appId==null&&this.getAppId(),await this.httpService.delete(`/api/app/v1/${this.appId}/entity/${e}/record/${n}`)}async getAppId(){const e=ot();this.appId=e.getAppId()}}function wf(t=""){const e=new kt,n={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};let i=a.ref({}),s=a.ref([]),o=a.ref([]),r=a.ref([]);const l=a.ref(""),c=a.ref(1),d=a.ref(25),u=a.ref(0),f=a.ref(0),h=a.ref(0),m=a.ref(!1),p=a.ref([]),g=a.ref(""),y=a.ref({}),b=async(v,T=!0)=>{m.value=!0;try{const R=await e.getEntityRecords(v);R&&R.response&&(i.value=R.response,s.value=R.response.result,r.value=R.response.entity.entityDefinition.columns,o.value=w(R.response.entity.entityDefinition.columns),f.value=R.response.totalRecords,P())}catch(R){console.error("Error fetching entity:",R.errorMessage)}finally{m.value=!1}},x=async(v=!0)=>{m.value=!0;try{const T={sortBy:[l.value],sortDirection:c.value===1?"ASC":"DESC",pageSize:d.value,currentPage:u.value,columnList:null,filter:p.value,fullTextSearch:g.value};Object.keys(T.filter).length===0&&(T.filter=[]);const R=await e.searchEntityRecords(t,T);R&&R.response&&(m.value=!1,i.value=R.response,s.value=R.response.result,f.value=R.response.totalRecords,h.value=u.value*d.value)}catch(T){console.error("Error fetching entity:",T.errorMessage)}finally{m.value=!1}},w=v=>v.map(T=>({field:T.name,name:T.displayName?T.displayName:T.name,filterable:T.filterable,datatype:T.type,sortable:!0,displayFormatKey:T.displayFormatKey,displayFormat:T.displayFormat})),E=v=>{l.value=v.sortField,c.value=v.sortOrder,h.value=0,x()},k=v=>{d.value=v.rows,u.value=v.page,h.value=v.first,x()},C=()=>{x()},S=()=>{x()},_=v=>{switch(v.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},O=v=>{const T=o.value.find(R=>R.field===v);return T?T.datatype:null},P=()=>{for(let v=0;v<r.value.length;v++){const T=r.value[v];if(T.primaryKey&&T.primaryKey==!0){y.value=T,l.value=T.name;break}}};return{items:s,headers:o,first:h,totalRecords:f,pageSize:d,loading:m,sortBy:l,sortDirection:c,operatorMap:n,filterToSend:p,fullTextSearch:g,listingResponse:i,primarayKeyColumn:y,onFullTextSearch:S,getDatatypeByField:O,getColumnDatatype:_,onSort:E,onPage:k,onFilter:C,fetchEntityFilterData:x,fetchEntityByName:b}}const De=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Ef={key:0,class:"field flex flex-col mb-3"},Cf=["for"],Of={key:0},vf={key:0,class:"font-bold"},Nf={key:1,class:"font-bold text-color-hint"},Df={key:1,class:"flex items-center mb-3"},Tf={class:"ml-2"},Bf={key:0},os=De({__name:"EntityForm",props:a.mergeModels({column:Object,errors:Array},{modelValue:{},modelModifiers:{}}),emits:a.mergeModels(["input"],["update:modelValue"]),setup(t,{emit:e}){const n=a.useModel(t,"modelValue"),i=e,s=o=>{i("input",o.name)};if(t.column&&!t.column.inputComponent){let o="";switch(t.column.type.toLowerCase()){case"text":o="INPUT_TEXT";break;case"int":o="INPUT_NUMBER";break;case"float":o="INPUT_FLOAT";break;case"boolean":o="INPUT_BOOLEAN";break;case"uuid":o="INPUT_UUID";break;case"date":o="INPUT_DATE";break;default:o="INPUT_STRING"}t.column.inputComponent=o}return(o,r)=>{var f,h,m,p,g;const l=a.resolveComponent("DatePicker"),c=a.resolveComponent("InputNumber"),d=a.resolveComponent("InputText"),u=a.resolveComponent("Checkbox");return a.openBlock(),a.createElementBlock(a.Fragment,null,[t.column.inputComponent.toLowerCase()!="input_boolean"?(a.openBlock(),a.createElementBlock("div",Ef,[a.createElementVNode("label",{class:"mb-1",for:t.column.name},[a.createTextVNode(a.toDisplayString(t.column.displayName||t.column.name)+" ",1),t.column.required?(a.openBlock(),a.createElementBlock("span",Of,"*")):a.createCommentVNode("",!0)],8,Cf),t.column.inputComponent.toLowerCase()=="input_date"?(a.openBlock(),a.createBlock(l,{key:0,modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=y=>n.value=y),id:t.column.name,name:t.column.name,onDateSelect:r[1]||(r[1]=y=>s(t.column)),invalid:((f=t.errors)==null?void 0:f.length)>0},null,8,["modelValue","id","name","invalid"])):t.column.inputComponent.toLowerCase()=="input_number"?(a.openBlock(),a.createBlock(c,{key:1,modelValue:n.value,"onUpdate:modelValue":r[2]||(r[2]=y=>n.value=y),id:t.column.name,name:t.column.name,allowEmpty:!0,format:!1,onInput:r[3]||(r[3]=y=>s(t.column)),invalid:((h=t.errors)==null?void 0:h.length)>0},null,8,["modelValue","id","name","invalid"])):t.column.type.toLowerCase()=="input_float"?(a.openBlock(),a.createBlock(c,{key:2,type:"decimal",minFractionDigits:1,id:t.column.name,allowEmpty:!0,format:!1,name:t.column.name,onInput:r[4]||(r[4]=y=>s(t.column)),invalid:((m=t.errors)==null?void 0:m.length)>0},null,8,["id","name","invalid"])):(a.openBlock(),a.createBlock(d,{key:3,modelValue:n.value,"onUpdate:modelValue":r[5]||(r[5]=y=>n.value=y),id:t.column.name,name:t.column.name,onInput:r[6]||(r[6]=y=>s(t.column)),invalid:((p=t.errors)==null?void 0:p.length)>0},null,8,["modelValue","id","name","invalid"])),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.errors,(y,b)=>(a.openBlock(),a.createElementBlock("div",{key:b,class:"text-red-500 mt-1 ml-2"},[y.includes("hint:")?(a.openBlock(),a.createElementBlock("small",Nf,a.toDisplayString(y.split(":")[1]),1)):(a.openBlock(),a.createElementBlock("small",vf,a.toDisplayString(y),1))]))),128))])):a.createCommentVNode("",!0),t.column.inputComponent.toLowerCase()=="input_boolean"?(a.openBlock(),a.createElementBlock("div",Df,[a.createVNode(u,{modelValue:n.value,"onUpdate:modelValue":r[7]||(r[7]=y=>n.value=y),invalid:((g=t.errors)==null?void 0:g.length)>0,onInput:r[8]||(r[8]=y=>s(t.column.name)),binary:""},null,8,["modelValue","invalid"]),a.createElementVNode("label",Tf,[a.createTextVNode(a.toDisplayString(t.column.displayName||t.column.name)+" ",1),t.column.required?(a.openBlock(),a.createElementBlock("span",Bf,"*")):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-8820d348"]]);/**
|
|
6
6
|
* vee-validate v4.15.0
|
|
7
7
|
* (c) 2024 Abdelrahman Awad
|
|
8
8
|
* @license MIT
|
|
9
|
-
*/function ot(n){return typeof n=="function"}function yr(n){return n==null}const Sn=n=>n!==null&&!!n&&typeof n=="object"&&!Array.isArray(n);function Us(n){return Number(n)>=0}function su(n){return typeof n=="object"&&n!==null}function ou(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}function br(n){if(!su(n)||ou(n)!=="[object Object]")return!1;if(Object.getPrototypeOf(n)===null)return!0;let e=n;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function Rn(n,e){return Object.keys(e).forEach(t=>{if(br(e[t])&&br(n[t])){n[t]||(n[t]={}),Rn(n[t],e[t]);return}n[t]=e[t]}),n}function Wi(n){const e=n.split(".");if(!e.length)return"";let t=String(e[0]);for(let i=1;i<e.length;i++){if(Us(e[i])){t+=`[${e[i]}]`;continue}t+=`.${e[i]}`}return t}const ru={};function au(n){return ru[n]}function xr(n,e,t){typeof t.value=="object"&&(t.value=be(t.value)),!t.enumerable||t.get||t.set||!t.configurable||!t.writable||e==="__proto__"?Object.defineProperty(n,e,t):n[e]=t.value}function be(n){if(typeof n!="object")return n;var e=0,t,i,s,o=Object.prototype.toString.call(n);if(o==="[object Object]"?s=Object.create(n.__proto__||null):o==="[object Array]"?s=Array(n.length):o==="[object Set]"?(s=new Set,n.forEach(function(a){s.add(be(a))})):o==="[object Map]"?(s=new Map,n.forEach(function(a,l){s.set(be(l),be(a))})):o==="[object Date]"?s=new Date(+n):o==="[object RegExp]"?s=new RegExp(n.source,n.flags):o==="[object DataView]"?s=new n.constructor(be(n.buffer)):o==="[object ArrayBuffer]"?s=n.slice(0):o.slice(-6)==="Array]"&&(s=new n.constructor(n)),s){for(i=Object.getOwnPropertySymbols(n);e<i.length;e++)xr(s,i[e],Object.getOwnPropertyDescriptor(n,i[e]));for(e=0,i=Object.getOwnPropertyNames(n);e<i.length;e++)Object.hasOwnProperty.call(s,t=i[e])&&s[t]===n[t]||xr(s,t,Object.getOwnPropertyDescriptor(n,t))}return s||n}const lu=Symbol("vee-validate-form"),cu=Symbol("vee-validate-form-context"),du=typeof window<"u";function uu(n){return ot(n)&&!!n.__locatorRef}function It(n){return!!n&&ot(n.parse)&&n.__type==="VVTypedSchema"}function _r(n){return!!n&&ot(n.validate)}function fu(n){return n==="checkbox"||n==="radio"}function hu(n){return Sn(n)||Array.isArray(n)}function mu(n){return Array.isArray(n)?n.length===0:Sn(n)&&Object.keys(n).length===0}function Hi(n){return/^\[.+\]$/i.test(n)}function pu(n){return kr(n)&&n.multiple}function kr(n){return n.tagName==="SELECT"}function gu(n){return Sr(n)&&n.target&&"submit"in n.target}function Sr(n){return n?!!(typeof Event<"u"&&ot(Event)&&n instanceof Event||n&&n.srcElement):!1}function jn(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,i,s;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(i=t;i--!==0;)if(!jn(n[i],e[i]))return!1;return!0}if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(i of n.entries())if(!e.has(i[0]))return!1;for(i of n.entries())if(!jn(i[1],e.get(i[0])))return!1;return!0}if(Er(n)&&Er(e))return!(n.size!==e.size||n.name!==e.name||n.lastModified!==e.lastModified||n.type!==e.type);if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(i of n.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(i=t;i--!==0;)if(n[i]!==e[i])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===e.toString();if(s=Object.keys(n),t=s.length-wr(n,s),t!==Object.keys(e).length-wr(e,Object.keys(e)))return!1;for(i=t;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=t;i--!==0;){var o=s[i];if(!jn(n[o],e[o]))return!1}return!0}return n!==n&&e!==e}function wr(n,e){let t=0;for(let s=e.length;s--!==0;){var i=e[s];n[i]===void 0&&t++}return t}function Er(n){return du?n instanceof File:!1}function qs(n){return Hi(n)?n.replace(/\[|\]/gi,""):n}function wt(n,e,t){return n?Hi(e)?n[qs(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((s,o)=>hu(s)&&o in s?s[o]:t,n):t}function Et(n,e,t){if(Hi(e)){n[qs(e)]=t;return}const i=e.split(/\.|\[(\d+)\]/).filter(Boolean);let s=n;for(let o=0;o<i.length;o++){if(o===i.length-1){s[i[o]]=t;return}(!(i[o]in s)||yr(s[i[o]]))&&(s[i[o]]=Us(i[o+1])?[]:{}),s=s[i[o]]}}function Ys(n,e){if(Array.isArray(n)&&Us(e)){n.splice(Number(e),1);return}Sn(n)&&delete n[e]}function Cr(n,e){if(Hi(e)){delete n[qs(e)];return}const t=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=n;for(let o=0;o<t.length;o++){if(o===t.length-1){Ys(i,t[o]);break}if(!(t[o]in i)||yr(i[t[o]]))break;i=i[t[o]]}const s=t.map((o,a)=>wt(n,t.slice(0,a).join(".")));for(let o=s.length-1;o>=0;o--)if(mu(s[o])){if(o===0){Ys(n,t[0]);continue}Ys(s[o-1],t[o-1])}}function et(n){return Object.keys(n)}function vr(n,e=0){let t=null,i=[];return function(...s){return t&&clearTimeout(t),t=setTimeout(()=>{const o=n(...s);i.forEach(a=>a(o)),i=[]},e),new Promise(o=>i.push(o))}}function yu(n,e){let t;return async function(...s){const o=n(...s);t=o;const a=await o;return o!==t?a:(t=void 0,e(a,s))}}function Dr(n){return Array.isArray(n)?n:n?[n]:[]}function Ui(n,e){const t={};for(const i in n)e.includes(i)||(t[i]=n[i]);return t}function bu(n){let e=null,t=[];return function(...i){const s=r.nextTick(()=>{if(e!==s)return;const o=n(...i);t.forEach(a=>a(o)),t=[],e=null});return e=s,new Promise(o=>t.push(o))}}function Ks(n){if(Nr(n))return n._value}function Nr(n){return"_value"in n}function xu(n){return n.type==="number"||n.type==="range"?Number.isNaN(n.valueAsNumber)?n.value:n.valueAsNumber:n.value}function Or(n){if(!Sr(n))return n;const e=n.target;if(fu(e.type)&&Nr(e))return Ks(e);if(e.type==="file"&&e.files){const t=Array.from(e.files);return e.multiple?t:t[0]}if(pu(e))return Array.from(e.options).filter(t=>t.selected&&!t.disabled).map(Ks);if(kr(e)){const t=Array.from(e.options).find(i=>i.selected);return t?Ks(t):e.value}return xu(e)}function _u(n){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n?Sn(n)&&n._$$isNormalized?n:Sn(n)?Object.keys(n).reduce((t,i)=>{const s=ku(n[i]);return n[i]!==!1&&(t[i]=Tr(s)),t},e):typeof n!="string"?e:n.split("|").reduce((t,i)=>{const s=Su(i);return s.name&&(t[s.name]=Tr(s.params)),t},e):e}function ku(n){return n===!0?[]:Array.isArray(n)||Sn(n)?n:[n]}function Tr(n){const e=t=>typeof t=="string"&&t[0]==="@"?wu(t.slice(1)):t;return Array.isArray(n)?n.map(e):n instanceof RegExp?[n]:Object.keys(n).reduce((t,i)=>(t[i]=e(n[i]),t),{})}const Su=n=>{let e=[];const t=n.split(":")[0];return n.includes(":")&&(e=n.split(":").slice(1).join(":").split(",")),{name:t,params:e}};function wu(n){const e=t=>{var i;return(i=wt(t,n))!==null&&i!==void 0?i:t[n]};return e.__locatorRef=n,e}let Eu=Object.assign({},{generateMessage:({field:n})=>`${n} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const zn=()=>Eu;async function Cu(n,e,t={}){const i=t==null?void 0:t.bails,s={name:(t==null?void 0:t.name)||"{field}",rules:e,label:t==null?void 0:t.label,bails:i??!0,formData:(t==null?void 0:t.values)||{}},o=await vu(s,n);return Object.assign(Object.assign({},o),{valid:!o.errors.length})}async function vu(n,e){const t=n.rules;if(It(t)||_r(t))return Nu(e,Object.assign(Object.assign({},n),{rules:t}));if(ot(t)||Array.isArray(t)){const l={field:n.label||n.name,name:n.name,label:n.label,form:n.formData,value:e},c=Array.isArray(t)?t:[t],d=c.length,u=[];for(let f=0;f<d;f++){const h=c[f],m=await h(e,l);if(!(typeof m!="string"&&!Array.isArray(m)&&m)){if(Array.isArray(m))u.push(...m);else{const g=typeof m=="string"?m:Br(l);u.push(g)}if(n.bails)return{errors:u}}}return{errors:u}}const i=Object.assign(Object.assign({},n),{rules:_u(t)}),s=[],o=Object.keys(i.rules),a=o.length;for(let l=0;l<a;l++){const c=o[l],d=await Ou(i,e,{name:c,params:i.rules[c]});if(d.error&&(s.push(d.error),n.bails))return{errors:s}}return{errors:s}}function Du(n){return!!n&&n.name==="ValidationError"}function Pr(n){return{__type:"VVTypedSchema",async parse(t,i){var s;try{return{output:await n.validate(t,{abortEarly:!1,context:(i==null?void 0:i.formData)||{}}),errors:[]}}catch(o){if(!Du(o))throw o;if(!(!((s=o.inner)===null||s===void 0)&&s.length)&&o.errors.length)return{errors:[{path:o.path,errors:o.errors}]};const a=o.inner.reduce((l,c)=>{const d=c.path||"";return l[d]||(l[d]={errors:[],path:d}),l[d].errors.push(...c.errors),l},{});return{errors:Object.values(a)}}}}}async function Nu(n,e){const i=await(It(e.rules)?e.rules:Pr(e.rules)).parse(n,{formData:e.formData}),s=[];for(const o of i.errors)o.errors.length&&s.push(...o.errors);return{value:i.value,errors:s}}async function Ou(n,e,t){const i=au(t.name);if(!i)throw new Error(`No such validator '${t.name}' exists.`);const s=Tu(t.params,n.formData),o={field:n.label||n.name,name:n.name,label:n.label,value:e,form:n.formData,rule:Object.assign(Object.assign({},t),{params:s})},a=await i(e,s,o);return typeof a=="string"?{error:a}:{error:a?void 0:Br(o)}}function Br(n){const e=zn().generateMessage;return e?e(n):"Field is invalid"}function Tu(n,e){const t=i=>uu(i)?i(e):i;return Array.isArray(n)?n.map(t):Object.keys(n).reduce((i,s)=>(i[s]=t(n[s]),i),{})}async function Pu(n,e){const i=await(It(n)?n:Pr(n)).parse(be(e),{formData:be(e)}),s={},o={};for(const a of i.errors){const l=a.errors,c=(a.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);s[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!i.errors.length,results:s,errors:o,values:i.value,source:"schema"}}async function Bu(n,e,t){const s=et(n).map(async d=>{var u,f,h;const m=(u=t==null?void 0:t.names)===null||u===void 0?void 0:u[d],p=await Cu(wt(e,d),n[d],{name:(m==null?void 0:m.name)||d,label:m==null?void 0:m.label,values:e,bails:(h=(f=t==null?void 0:t.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},p),{path:d})});let o=!0;const a=await Promise.all(s),l={},c={};for(const d of a)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c,source:"schema"}}let Mu=0;const qi=["bails","fieldsCount","id","multiple","type","validate"];function Mr(n){const e={},t=Object.assign({},r.toValue(e)),i=r.unref(void 0);return i&&It(i)&&ot(i.cast)?be(i.cast(t)||{}):be(t)}function Vr(n){var e;const t=Mu++,i="Form";let s=0;const o=r.ref(!1),a=r.ref(!1),l=r.ref(0),c=[],d=r.reactive(Mr()),u=r.ref([]),f=r.ref({}),h=r.ref({}),m=bu(()=>{h.value=u.value.reduce((N,O)=>(N[Wi(r.toValue(O.path))]=O,N),{})});function p(N,O){const V=j(N);if(!V){typeof N=="string"&&(f.value[Wi(N)]=Dr(O));return}if(typeof N=="string"){const U=Wi(N);f.value[U]&&delete f.value[U]}V.errors=Dr(O),V.valid=!V.errors.length}function g(N){et(N).forEach(O=>{p(O,N[O])})}const y=r.computed(()=>{const N=u.value.reduce((O,V)=>(V.errors.length&&(O[r.toValue(V.path)]=V.errors),O),{});return Object.assign(Object.assign({},f.value),N)}),b=r.computed(()=>et(y.value).reduce((N,O)=>{const V=y.value[O];return V!=null&&V.length&&(N[O]=V[0]),N},{})),_=r.computed(()=>u.value.reduce((N,O)=>(N[r.toValue(O.path)]={name:r.toValue(O.path)||"",label:O.label||""},N),{})),w=r.computed(()=>u.value.reduce((N,O)=>{var V;return N[r.toValue(O.path)]=(V=O.bails)!==null&&V!==void 0?V:!0,N},{})),E=Object.assign({},{}),k=(e=void 0)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:S,setInitialValues:x}=Au(u,d),v=Vu(u,d,S,b),B=r.computed(()=>u.value.reduce((N,O)=>{const V=wt(d,r.toValue(O.path));return Et(N,r.toValue(O.path),V),N},{})),D=void 0;function T(N,O){var V,U;const ee=r.computed(()=>wt(C.value,r.toValue(N))),re=h.value[r.toValue(N)],J=(O==null?void 0:O.type)==="checkbox"||(O==null?void 0:O.type)==="radio";if(re&&J){re.multiple=!0;const ve=s++;return Array.isArray(re.id)?re.id.push(ve):re.id=[re.id,ve],re.fieldsCount++,re.__flags.pendingUnmount[ve]=!1,re}const M=r.computed(()=>wt(d,r.toValue(N))),W=r.toValue(N),X=P.findIndex(ve=>ve===W);X!==-1&&P.splice(X,1);const K=r.computed(()=>{var ve,Le,$i,Ii;const Li=r.toValue(D);if(It(Li))return(Le=(ve=Li.describe)===null||ve===void 0?void 0:ve.call(Li,r.toValue(N)).required)!==null&&Le!==void 0?Le:!1;const lr=r.toValue(O==null?void 0:O.schema);return It(lr)&&(Ii=($i=lr.describe)===null||$i===void 0?void 0:$i.call(lr).required)!==null&&Ii!==void 0?Ii:!1}),ie=s++,ye=r.reactive({id:ie,path:N,touched:!1,pending:!1,valid:!0,validated:!!(!((V=E[W])===null||V===void 0)&&V.length),required:K,initialValue:ee,errors:r.shallowRef([]),bails:(U=O==null?void 0:O.bails)!==null&&U!==void 0?U:!1,label:O==null?void 0:O.label,type:(O==null?void 0:O.type)||"default",value:M,multiple:!1,__flags:{pendingUnmount:{[ie]:!1},pendingReset:!1},fieldsCount:1,validate:O==null?void 0:O.validate,dirty:r.computed(()=>!jn(r.unref(M),r.unref(ee)))});return u.value.push(ye),h.value[W]=ye,m(),b.value[W]&&!E[W]&&r.nextTick(()=>{Ye(W,{mode:"silent"})}),r.isRef(N)&&r.watch(N,ve=>{m();const Le=be(M.value);h.value[ve]=ye,r.nextTick(()=>{Et(d,ve,Le)})}),ye}const I=vr(st,5),q=vr(st,5),L=yu(async N=>await(N==="silent"?I():q()),(N,[O])=>{const V=et(ce.errorBag.value),ee=[...new Set([...et(N.results),...u.value.map(re=>re.path),...V])].sort().reduce((re,J)=>{var M;const W=J,X=j(W)||$(W),K=((M=N.results[W])===null||M===void 0?void 0:M.errors)||[],ie=r.toValue(X==null?void 0:X.path)||W,ye=Fu({errors:K,valid:!K.length},re.results[ie]);return re.results[ie]=ye,ye.valid||(re.errors[ie]=ye.errors[0]),X&&f.value[ie]&&delete f.value[ie],X?(X.valid=ye.valid,O==="silent"||O==="validated-only"&&!X.validated||p(X,ye.errors),re):(p(ie,K),re)},{valid:N.valid,results:{},errors:{},source:N.source});return N.values&&(ee.values=N.values,ee.source=N.source),et(ee.results).forEach(re=>{var J;const M=j(re);M&&O!=="silent"&&(O==="validated-only"&&!M.validated||p(M,(J=ee.results[re])===null||J===void 0?void 0:J.errors))}),ee});function A(N){u.value.forEach(N)}function j(N){const O=typeof N=="string"?Wi(N):N;return typeof O=="string"?h.value[O]:O}function $(N){return u.value.filter(V=>N.startsWith(r.toValue(V.path))).reduce((V,U)=>V?U.path.length>V.path.length?U:V:U,void 0)}let P=[],R;function G(N){return P.push(N),R||(R=r.nextTick(()=>{[...P].sort().reverse().forEach(V=>{Cr(d,V)}),P=[],R=null})),R}function se(N){return function(V,U){return function(re){return re instanceof Event&&(re.preventDefault(),re.stopPropagation()),A(J=>J.touched=!0),o.value=!0,l.value++,De().then(J=>{const M=be(d);if(J.valid&&typeof V=="function"){const W=be(B.value);let X=N?W:M;return J.values&&(X=J.source==="schema"?J.values:Object.assign({},X,J.values)),V(X,{evt:re,controlledValues:W,setErrors:g,setFieldError:p,setTouched:he,setFieldTouched:it,setValues:ze,setFieldValue:_e,resetForm:me,resetField:fe})}!J.valid&&typeof U=="function"&&U({values:M,evt:re,errors:J.errors,results:J.results})}).then(J=>(o.value=!1,J),J=>{throw o.value=!1,J})}}}const Q=se(!1);Q.withControlled=se(!0);function Y(N,O){const V=u.value.findIndex(ee=>ee.path===N&&(Array.isArray(ee.id)?ee.id.includes(O):ee.id===O)),U=u.value[V];if(!(V===-1||!U)){if(r.nextTick(()=>{Ye(N,{mode:"silent",warn:!1})}),U.multiple&&U.fieldsCount&&U.fieldsCount--,Array.isArray(U.id)){const ee=U.id.indexOf(O);ee>=0&&U.id.splice(ee,1),delete U.__flags.pendingUnmount[O]}(!U.multiple||U.fieldsCount<=0)&&(u.value.splice(V,1),St(N),m(),delete h.value[N])}}function te(N){et(h.value).forEach(O=>{O.startsWith(N)&&delete h.value[O]}),u.value=u.value.filter(O=>!O.path.startsWith(N)),r.nextTick(()=>{m()})}const ce={name:i,formId:t,values:d,controlledValues:B,errorBag:y,errors:b,schema:D,submitCount:l,meta:v,isSubmitting:o,isValidating:a,fieldArrays:c,keepValuesOnUnmount:k,validateSchema:r.unref(D)?L:void 0,validate:De,setFieldError:p,validateField:Ye,setFieldValue:_e,setValues:ze,setErrors:g,setFieldTouched:it,setTouched:he,resetForm:me,resetField:fe,handleSubmit:Q,useFieldModel:_n,defineInputBinds:Z,defineComponentBinds:ht,defineField:nn,stageInitialValue:Ae,unsetInitialValue:St,setFieldInitialValue:Ke,createPathState:T,getPathState:j,unsetPathValue:G,removePathState:Y,initialValues:C,getAllPathStates:()=>u.value,destroyPath:te,isFieldTouched:H,isFieldDirty:F,isFieldValid:ue};function _e(N,O,V=!0){const U=be(O),ee=typeof N=="string"?N:N.path;j(ee)||T(ee),Et(d,ee,U),V&&Ye(ee)}function Qe(N,O=!0){et(d).forEach(V=>{delete d[V]}),et(N).forEach(V=>{_e(V,N[V],!1)}),O&&De()}function ze(N,O=!0){Rn(d,N),c.forEach(V=>V&&V.reset()),O&&De()}function ft(N,O){const V=j(r.toValue(N))||T(N);return r.computed({get(){return V.value},set(U){var ee;const re=r.toValue(N);_e(re,U,(ee=r.toValue(O))!==null&&ee!==void 0?ee:!1)}})}function it(N,O){const V=j(N);V&&(V.touched=O)}function H(N){const O=j(N);return O?O.touched:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.touched)}function F(N){const O=j(N);return O?O.dirty:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.dirty)}function ue(N){const O=j(N);return O?O.valid:u.value.filter(V=>V.path.startsWith(N)).every(V=>V.valid)}function he(N){if(typeof N=="boolean"){A(O=>{O.touched=N});return}et(N).forEach(O=>{it(O,!!N[O])})}function fe(N,O){var V;const U=O&&"value"in O?O.value:wt(C.value,N),ee=j(N);ee&&(ee.__flags.pendingReset=!0),Ke(N,be(U),!0),_e(N,U,!1),it(N,(V=O==null?void 0:O.touched)!==null&&V!==void 0?V:!1),p(N,(O==null?void 0:O.errors)||[]),r.nextTick(()=>{ee&&(ee.__flags.pendingReset=!1)})}function me(N,O){let V=be(N!=null&&N.values?N.values:S.value);V=O!=null&&O.force?V:Rn(S.value,V),V=It(D)&&ot(D.cast)?D.cast(V):V,x(V,{force:O==null?void 0:O.force}),A(U=>{var ee;U.__flags.pendingReset=!0,U.validated=!1,U.touched=((ee=N==null?void 0:N.touched)===null||ee===void 0?void 0:ee[r.toValue(U.path)])||!1,_e(r.toValue(U.path),wt(V,r.toValue(U.path)),!1),p(r.toValue(U.path),void 0)}),O!=null&&O.force?Qe(V,!1):ze(V,!1),g((N==null?void 0:N.errors)||{}),l.value=(N==null?void 0:N.submitCount)||0,r.nextTick(()=>{De({mode:"silent"}),A(U=>{U.__flags.pendingReset=!1})})}async function De(N){const O=(N==null?void 0:N.mode)||"force";if(O==="force"&&A(J=>J.validated=!0),ce.validateSchema)return ce.validateSchema(O);a.value=!0;const V=await Promise.all(u.value.map(J=>J.validate?J.validate(N).then(M=>({key:r.toValue(J.path),valid:M.valid,errors:M.errors,value:M.value})):Promise.resolve({key:r.toValue(J.path),valid:!0,errors:[],value:void 0})));a.value=!1;const U={},ee={},re={};for(const J of V)U[J.key]={valid:J.valid,errors:J.errors},J.value&&Et(re,J.key,J.value),J.errors.length&&(ee[J.key]=J.errors[0]);return{valid:V.every(J=>J.valid),results:U,errors:ee,values:re,source:"fields"}}async function Ye(N,O){var V;const U=j(N);return U&&(O==null?void 0:O.mode)!=="silent"&&(U.validated=!0),U!=null&&U.validate?U.validate(O):(!U&&(V=O==null?void 0:O.warn),Promise.resolve({errors:[],valid:!0}))}function St(N){Cr(C.value,N)}function Ae(N,O,V=!1){Ke(N,O),Et(d,N,O),V&&Et(S.value,N,be(O))}function Ke(N,O,V=!1){Et(C.value,N,be(O)),V&&Et(S.value,N,be(O))}async function st(){const N=r.unref(D);if(!N)return{valid:!0,results:{},errors:{},source:"none"};a.value=!0;const O=_r(N)||It(N)?await Pu(N,d):await Bu(N,d,{names:_.value,bailsMap:w.value});return a.value=!1,O}const tn=Q((N,{evt:O})=>{gu(O)&&O.target.submit()});r.onMounted(()=>{ce.validateSchema&&ce.validateSchema("silent")}),r.isRef(D)&&r.watch(D,()=>{var N;(N=ce.validateSchema)===null||N===void 0||N.call(ce,"validated-only")}),r.provide(lu,ce);function nn(N,O){const V=ot(O)||O==null?void 0:O.label,U=j(r.toValue(N))||T(N,{label:V}),ee=()=>ot(O)?O(Ui(U,qi)):O||{};function re(){var K;U.touched=!0,((K=ee().validateOnBlur)!==null&&K!==void 0?K:zn().validateOnBlur)&&Ye(r.toValue(U.path))}function J(){var K;((K=ee().validateOnInput)!==null&&K!==void 0?K:zn().validateOnInput)&&r.nextTick(()=>{Ye(r.toValue(U.path))})}function M(){var K;((K=ee().validateOnChange)!==null&&K!==void 0?K:zn().validateOnChange)&&r.nextTick(()=>{Ye(r.toValue(U.path))})}const W=r.computed(()=>{const K={onChange:M,onInput:J,onBlur:re};return ot(O)?Object.assign(Object.assign({},K),O(Ui(U,qi)).props||{}):O!=null&&O.props?Object.assign(Object.assign({},K),O.props(Ui(U,qi))):K});return[ft(N,()=>{var K,ie,ye;return(ye=(K=ee().validateOnModelUpdate)!==null&&K!==void 0?K:(ie=zn())===null||ie===void 0?void 0:ie.validateOnModelUpdate)!==null&&ye!==void 0?ye:!0}),W]}function _n(N){return Array.isArray(N)?N.map(O=>ft(O,!0)):ft(N)}function Z(N,O){const[V,U]=nn(N,O);function ee(){U.value.onBlur()}function re(M){const W=Or(M);_e(r.toValue(N),W,!1),U.value.onInput()}function J(M){const W=Or(M);_e(r.toValue(N),W,!1),U.value.onChange()}return r.computed(()=>Object.assign(Object.assign({},U.value),{onBlur:ee,onInput:re,onChange:J,value:V.value}))}function ht(N,O){const[V,U]=nn(N,O),ee=j(r.toValue(N));function re(J){V.value=J}return r.computed(()=>{const J=ot(O)?O(Ui(ee,qi)):O||{};return Object.assign({[J.model||"modelValue"]:V.value,[`onUpdate:${J.model||"modelValue"}`]:re},U.value)})}const Oe=Object.assign(Object.assign({},ce),{values:r.readonly(d),handleReset:()=>me(),submitForm:tn});return r.provide(cu,Oe),Oe}function Vu(n,e,t,i){const s={touched:"some",pending:"some",valid:"every"},o=r.computed(()=>!jn(e,r.unref(t)));function a(){const c=n.value;return et(s).reduce((d,u)=>{const f=s[u];return d[u]=c[f](h=>h[u]),d},{})}const l=r.reactive(a());return r.watchEffect(()=>{const c=a();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),r.computed(()=>Object.assign(Object.assign({initialValues:r.unref(t)},l),{valid:l.valid&&!et(i.value).length,dirty:o.value}))}function Au(n,e,t){const i=Mr(),s=r.ref(i),o=r.ref(be(i));function a(l,c){c!=null&&c.force?(s.value=be(l),o.value=be(l)):(s.value=Rn(be(s.value)||{},be(l)),o.value=Rn(be(o.value)||{},be(l))),c!=null&&c.updateFields&&n.value.forEach(d=>{if(d.touched)return;const f=wt(s.value,r.toValue(d.path));Et(e,r.toValue(d.path),be(f))})}return{initialValues:s,originalInitialValues:o,setInitialValues:a}}function Fu(n,e){return e?{valid:n.valid&&e.valid,errors:[...n.errors,...e.errors]}:n}function $u(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xs,Ar;function Iu(){if(Ar)return Xs;Ar=1;function n(b){this._maxSize=b,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(b){return this._values[b]},n.prototype.set=function(b,_){return this._size>=this._maxSize&&this.clear(),b in this._values||this._size++,this._values[b]=_};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,t=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,l=new n(a),c=new n(a),d=new n(a);Xs={Cache:n,split:f,normalizePath:u,setter:function(b){var _=u(b);return c.get(b)||c.set(b,function(E,k){for(var C=0,S=_.length,x=E;C<S-1;){var v=_[C];if(v==="__proto__"||v==="constructor"||v==="prototype")return E;x=x[_[C++]]}x[_[C]]=k})},getter:function(b,_){var w=u(b);return d.get(b)||d.set(b,function(k){for(var C=0,S=w.length;C<S;)if(k!=null||!_)k=k[w[C++]];else return;return k})},join:function(b){return b.reduce(function(_,w){return _+(m(w)||t.test(w)?"["+w+"]":(_?".":"")+w)},"")},forEach:function(b,_,w){h(Array.isArray(b)?b:f(b),_,w)}};function u(b){return l.get(b)||l.set(b,f(b).map(function(_){return _.replace(o,"$2")}))}function f(b){return b.match(e)||[""]}function h(b,_,w){var E=b.length,k,C,S,x;for(C=0;C<E;C++)k=b[C],k&&(y(k)&&(k='"'+k+'"'),x=m(k),S=!x&&/^\d+$/.test(k),_.call(w,k,x,S,C,b))}function m(b){return typeof b=="string"&&b&&["'",'"'].indexOf(b.charAt(0))!==-1}function p(b){return b.match(i)&&!b.match(t)}function g(b){return s.test(b)}function y(b){return!m(b)&&(p(b)||g(b))}return Xs}var on=Iu(),Gs,Fr;function Lu(){if(Fr)return Gs;Fr=1;const n=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=u=>u.match(n)||[],t=u=>u[0].toUpperCase()+u.slice(1),i=(u,f)=>e(u).join(f).toLowerCase(),s=u=>e(u).reduce((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return Gs={words:e,upperFirst:t,camelCase:s,pascalCase:u=>t(s(u)),snakeCase:u=>i(u,"_"),kebabCase:u=>i(u,"-"),sentenceCase:u=>t(i(u," ")),titleCase:u=>e(u).map(t).join(" ")},Gs}var Qs=Lu(),Yi={exports:{}},$r;function Ru(){if($r)return Yi.exports;$r=1,Yi.exports=function(s){return n(e(s),s)},Yi.exports.array=n;function n(s,o){var a=s.length,l=new Array(a),c={},d=a,u=t(o),f=i(s);for(o.forEach(function(m){if(!f.has(m[0])||!f.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)c[d]||h(s[d],d,new Set);return l;function h(m,p,g){if(g.has(m)){var y;try{y=", node was:"+JSON.stringify(m)}catch{y=""}throw new Error("Cyclic dependency"+y)}if(!f.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!c[p]){c[p]=!0;var b=u.get(m)||new Set;if(b=Array.from(b),p=b.length){g.add(m);do{var _=b[--p];h(_,f.get(_),g)}while(p);g.delete(m)}l[--a]=m}}}function e(s){for(var o=new Set,a=0,l=s.length;a<l;a++){var c=s[a];o.add(c[0]),o.add(c[1])}return Array.from(o)}function t(s){for(var o=new Map,a=0,l=s.length;a<l;a++){var c=s[a];o.has(c[0])||o.set(c[0],new Set),o.has(c[1])||o.set(c[1],new Set),o.get(c[0]).add(c[1])}return o}function i(s){for(var o=new Map,a=0,l=s.length;a<l;a++)o.set(s[a],a);return o}return Yi.exports}var ju=Ru();const zu=$u(ju),Wu=Object.prototype.toString,Hu=Error.prototype.toString,Uu=RegExp.prototype.toString,qu=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Yu=/^Symbol\((.*)\)(.*)$/;function Ku(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function Ir(n,e=!1){if(n==null||n===!0||n===!1)return""+n;const t=typeof n;if(t==="number")return Ku(n);if(t==="string")return e?`"${n}"`:n;if(t==="function")return"[Function "+(n.name||"anonymous")+"]";if(t==="symbol")return qu.call(n).replace(Yu,"Symbol($1)");const i=Wu.call(n).slice(8,-1);return i==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):i==="Error"||n instanceof Error?"["+Hu.call(n)+"]":i==="RegExp"?Uu.call(n):null}function Lt(n,e){let t=Ir(n,e);return t!==null?t:JSON.stringify(n,function(i,s){let o=Ir(this[i],e);return o!==null?o:s},2)}function Lr(n){return n==null?[]:[].concat(n)}let Rr,jr,zr,Xu=/\$\{\s*(\w+)\s*\}/g;Rr=Symbol.toStringTag;class Wr{constructor(e,t,i,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Rr]="Error",this.name="ValidationError",this.value=t,this.path=i,this.type=s,this.errors=[],this.inner=[],Lr(e).forEach(o=>{if(We.isError(o)){this.errors.push(...o.errors);const a=o.inner.length?o.inner:[o];this.inner.push(...a)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}jr=Symbol.hasInstance,zr=Symbol.toStringTag;class We extends Error{static formatError(e,t){const i=t.label||t.path||"this";return t=Object.assign({},t,{path:i,originalPath:t.path}),typeof e=="string"?e.replace(Xu,(s,o)=>Lt(t[o])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,i,s,o){const a=new Wr(e,t,i,s);if(o)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[zr]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,We)}static[jr](e){return Wr[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let mt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:e,value:t,originalValue:i})=>{const s=i!=null&&i!==t?` (cast from the value \`${Lt(i,!0)}\`).`:".";return e!=="mixed"?`${n} must be a \`${e}\` type, but the final value was: \`${Lt(t,!0)}\``+s:`${n} must match the configured type. The validated value was: \`${Lt(t,!0)}\``+s}},He={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Gu={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Js={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Qu={isValue:"${path} field must be ${value}"},Ki={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:mt,string:He,number:Gu,date:Js,object:Ki,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Qu,tuple:{notType:n=>{const{path:e,value:t,spec:i}=n,s=i.types.length;if(Array.isArray(t)){if(t.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${t.length} for value: \`${Lt(t,!0)}\``;if(t.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${t.length} for value: \`${Lt(t,!0)}\``}return We.formatError(mt.notType,n)}}});const Zs=n=>n&&n.__isYupSchema__;class Xi{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:o}=t,a=typeof i=="function"?i:(...l)=>l.every(c=>c===i);return new Xi(e,(l,c)=>{var d;let u=a(...l)?s:o;return(d=u==null?void 0:u(c))!=null?d:c})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let i=this.refs.map(o=>o.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),s=this.fn(i,e,t);if(s===void 0||s===e)return e;if(!Zs(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const Gi={context:"$",value:"."};class rn{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Gi.context,this.isValue=this.key[0]===Gi.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?Gi.context:this.isValue?Gi.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&on.getter(this.path,!0),this.map=t.map}getValue(e,t,i){let s=this.isContext?i:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}rn.prototype.__isYupRef=!0;const an=n=>n==null;function wn(n){function e({value:t,path:i="",options:s,originalValue:o,schema:a},l,c){const{name:d,test:u,params:f,message:h,skipAbsent:m}=n;let{parent:p,context:g,abortEarly:y=a.spec.abortEarly,disableStackTrace:b=a.spec.disableStackTrace}=s;function _(D){return rn.isRef(D)?D.getValue(t,p,g):D}function w(D={}){const T=Object.assign({value:t,originalValue:o,label:a.spec.label,path:D.path||i,spec:a.spec,disableStackTrace:D.disableStackTrace||b},f,D.params);for(const q of Object.keys(T))T[q]=_(T[q]);const I=new We(We.formatError(D.message||h,T),t,T.path,D.type||d,T.disableStackTrace);return I.params=T,I}const E=y?l:c;let k={path:i,parent:p,type:d,from:s.from,createError:w,resolve:_,options:s,originalValue:o,schema:a};const C=D=>{We.isError(D)?E(D):D?c(null):E(w())},S=D=>{We.isError(D)?E(D):l(D)};if(m&&an(t))return C(!0);let v;try{var B;if(v=u.call(k,t,k),typeof((B=v)==null?void 0:B.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(v).then(C,S)}}catch(D){S(D);return}C(v)}return e.OPTIONS=n,e}function Ju(n,e,t,i=t){let s,o,a;return e?(on.forEach(e,(l,c,d)=>{let u=c?l.slice(1,l.length-1):l;n=n.resolve({context:i,parent:s,value:t});let f=n.type==="tuple",h=d?parseInt(u,10):0;if(n.innerType||f){if(f&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(t&&h>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);s=t,t=t&&t[h],n=f?n.spec.types[h]:n.innerType}if(!d){if(!n.fields||!n.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${n.type}")`);s=t,t=t&&t[u],n=n.fields[u]}o=u,a=c?"["+l+"]":"."+l}),{schema:n,parent:s,parentPath:o}):{parent:s,parentPath:e,schema:n}}class Qi extends Set{describe(){const e=[];for(const t of this.values())e.push(rn.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const i of this.values())t.push(e(i));return t}clone(){return new Qi(this.values())}merge(e,t){const i=this.clone();return e.forEach(s=>i.add(s)),t.forEach(s=>i.delete(s)),i}}function En(n,e=new Map){if(Zs(n)||!n||typeof n!="object")return n;if(e.has(n))return e.get(n);let t;if(n instanceof Date)t=new Date(n.getTime()),e.set(n,t);else if(n instanceof RegExp)t=new RegExp(n),e.set(n,t);else if(Array.isArray(n)){t=new Array(n.length),e.set(n,t);for(let i=0;i<n.length;i++)t[i]=En(n[i],e)}else if(n instanceof Map){t=new Map,e.set(n,t);for(const[i,s]of n.entries())t.set(i,En(s,e))}else if(n instanceof Set){t=new Set,e.set(n,t);for(const i of n)t.add(En(i,e))}else if(n instanceof Object){t={},e.set(n,t);for(const[i,s]of Object.entries(n))t[i]=En(s,e)}else throw Error(`Unable to clone ${n}`);return t}class pt{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Qi,this._blacklist=new Qi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=En(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=t,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,i=e.clone();const s=Object.assign({},t.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},t.internalTests,i.internalTests),i._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),i.tests=t.tests,i.exclusiveTests=t.exclusiveTests,i.withMutation(o=>{e.tests.forEach(a=>{o.test(a.OPTIONS)})}),i.transforms=[...t.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let i=t.conditions;t=t.clone(),t.conditions=[],t=i.reduce((s,o)=>o.resolve(s,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,i,s,o;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=e.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(e,t={}){let i=this.resolve(Object.assign({value:e},t)),s=t.assert==="ignore-optionality",o=i._cast(e,t);if(t.assert!==!1&&!i.isType(o)){if(s&&an(o))return o;let a=Lt(e),l=Lt(o);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
|
|
9
|
+
*/function ut(t){return typeof t=="function"}function oa(t){return t==null}const An=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function _o(t){return Number(t)>=0}function Pf(t){return typeof t=="object"&&t!==null}function Af(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ra(t){if(!Pf(t)||Af(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Zn(t,e){return Object.keys(e).forEach(n=>{if(ra(e[n])&&ra(t[n])){t[n]||(t[n]={}),Zn(t[n],e[n]);return}t[n]=e[n]}),t}function rs(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let i=1;i<e.length;i++){if(_o(e[i])){n+=`[${e[i]}]`;continue}n+=`.${e[i]}`}return n}const Mf={};function Vf(t){return Mf[t]}function aa(t,e,n){typeof n.value=="object"&&(n.value=_e(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function _e(t){if(typeof t!="object")return t;var e=0,n,i,s,o=Object.prototype.toString.call(t);if(o==="[object Object]"?s=Object.create(t.__proto__||null):o==="[object Array]"?s=Array(t.length):o==="[object Set]"?(s=new Set,t.forEach(function(r){s.add(_e(r))})):o==="[object Map]"?(s=new Map,t.forEach(function(r,l){s.set(_e(l),_e(r))})):o==="[object Date]"?s=new Date(+t):o==="[object RegExp]"?s=new RegExp(t.source,t.flags):o==="[object DataView]"?s=new t.constructor(_e(t.buffer)):o==="[object ArrayBuffer]"?s=t.slice(0):o.slice(-6)==="Array]"&&(s=new t.constructor(t)),s){for(i=Object.getOwnPropertySymbols(t);e<i.length;e++)aa(s,i[e],Object.getOwnPropertyDescriptor(t,i[e]));for(e=0,i=Object.getOwnPropertyNames(t);e<i.length;e++)Object.hasOwnProperty.call(s,n=i[e])&&s[n]===t[n]||aa(s,n,Object.getOwnPropertyDescriptor(t,n))}return s||t}const Rf=Symbol("vee-validate-form"),Ff=Symbol("vee-validate-form-context"),$f=typeof window<"u";function Lf(t){return ut(t)&&!!t.__locatorRef}function Yt(t){return!!t&&ut(t.parse)&&t.__type==="VVTypedSchema"}function la(t){return!!t&&ut(t.validate)}function If(t){return t==="checkbox"||t==="radio"}function jf(t){return An(t)||Array.isArray(t)}function zf(t){return Array.isArray(t)?t.length===0:An(t)&&Object.keys(t).length===0}function as(t){return/^\[.+\]$/i.test(t)}function Uf(t){return ca(t)&&t.multiple}function ca(t){return t.tagName==="SELECT"}function Wf(t){return da(t)&&t.target&&"submit"in t.target}function da(t){return t?!!(typeof Event<"u"&&ut(Event)&&t instanceof Event||t&&t.srcElement):!1}function ei(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(i=n;i--!==0;)if(!ei(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!ei(i[1],e.get(i[0])))return!1;return!0}if(fa(t)&&fa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(i=n;i--!==0;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(s=Object.keys(t),n=s.length-ua(t,s),n!==Object.keys(e).length-ua(e,Object.keys(e)))return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!ei(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function ua(t,e){let n=0;for(let s=e.length;s--!==0;){var i=e[s];t[i]===void 0&&n++}return n}function fa(t){return $f?t instanceof File:!1}function ko(t){return as(t)?t.replace(/\[|\]/gi,""):t}function Pt(t,e,n){return t?as(e)?t[ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((s,o)=>jf(s)&&o in s?s[o]:n,t):n}function At(t,e,n){if(as(e)){t[ko(e)]=n;return}const i=e.split(/\.|\[(\d+)\]/).filter(Boolean);let s=t;for(let o=0;o<i.length;o++){if(o===i.length-1){s[i[o]]=n;return}(!(i[o]in s)||oa(s[i[o]]))&&(s[i[o]]=_o(i[o+1])?[]:{}),s=s[i[o]]}}function So(t,e){if(Array.isArray(t)&&_o(e)){t.splice(Number(e),1);return}An(t)&&delete t[e]}function ha(t,e){if(as(e)){delete t[ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<n.length;o++){if(o===n.length-1){So(i,n[o]);break}if(!(n[o]in i)||oa(i[n[o]]))break;i=i[n[o]]}const s=n.map((o,r)=>Pt(t,n.slice(0,r).join(".")));for(let o=s.length-1;o>=0;o--)if(zf(s[o])){if(o===0){So(t,n[0]);continue}So(s[o-1],n[o-1])}}function rt(t){return Object.keys(t)}function ma(t,e=0){let n=null,i=[];return function(...s){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...s);i.forEach(r=>r(o)),i=[]},e),new Promise(o=>i.push(o))}}function Hf(t,e){let n;return async function(...s){const o=t(...s);n=o;const r=await o;return o!==n?r:(n=void 0,e(r,s))}}function pa(t){return Array.isArray(t)?t:t?[t]:[]}function ls(t,e){const n={};for(const i in t)e.includes(i)||(n[i]=t[i]);return n}function qf(t){let e=null,n=[];return function(...i){const s=a.nextTick(()=>{if(e!==s)return;const o=t(...i);n.forEach(r=>r(o)),n=[],e=null});return e=s,new Promise(o=>n.push(o))}}function wo(t){if(ga(t))return t._value}function ga(t){return"_value"in t}function Yf(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function ya(t){if(!da(t))return t;const e=t.target;if(If(e.type)&&ga(e))return wo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Uf(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(wo);if(ca(e)){const n=Array.from(e.options).find(i=>i.selected);return n?wo(n):e.value}return Yf(e)}function Kf(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?An(t)&&t._$$isNormalized?t:An(t)?Object.keys(t).reduce((n,i)=>{const s=Xf(t[i]);return t[i]!==!1&&(n[i]=ba(s)),n},e):typeof t!="string"?e:t.split("|").reduce((n,i)=>{const s=Gf(i);return s.name&&(n[s.name]=ba(s.params)),n},e):e}function Xf(t){return t===!0?[]:Array.isArray(t)||An(t)?t:[t]}function ba(t){const e=n=>typeof n=="string"&&n[0]==="@"?Jf(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,i)=>(n[i]=e(t[i]),n),{})}const Gf=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Jf(t){const e=n=>{var i;return(i=Pt(n,t))!==null&&i!==void 0?i:n[t]};return e.__locatorRef=t,e}let Qf=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ti=()=>Qf;async function Zf(t,e,n={}){const i=n==null?void 0:n.bails,s={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:i??!0,formData:(n==null?void 0:n.values)||{}},o=await eh(s,t);return Object.assign(Object.assign({},o),{valid:!o.errors.length})}async function eh(t,e){const n=t.rules;if(Yt(n)||la(n))return nh(e,Object.assign(Object.assign({},t),{rules:n}));if(ut(n)||Array.isArray(n)){const l={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},c=Array.isArray(n)?n:[n],d=c.length,u=[];for(let f=0;f<d;f++){const h=c[f],m=await h(e,l);if(!(typeof m!="string"&&!Array.isArray(m)&&m)){if(Array.isArray(m))u.push(...m);else{const g=typeof m=="string"?m:_a(l);u.push(g)}if(t.bails)return{errors:u}}}return{errors:u}}const i=Object.assign(Object.assign({},t),{rules:Kf(n)}),s=[],o=Object.keys(i.rules),r=o.length;for(let l=0;l<r;l++){const c=o[l],d=await ih(i,e,{name:c,params:i.rules[c]});if(d.error&&(s.push(d.error),t.bails))return{errors:s}}return{errors:s}}function th(t){return!!t&&t.name==="ValidationError"}function xa(t){return{__type:"VVTypedSchema",async parse(n,i){var s;try{return{output:await t.validate(n,{abortEarly:!1,context:(i==null?void 0:i.formData)||{}}),errors:[]}}catch(o){if(!th(o))throw o;if(!(!((s=o.inner)===null||s===void 0)&&s.length)&&o.errors.length)return{errors:[{path:o.path,errors:o.errors}]};const r=o.inner.reduce((l,c)=>{const d=c.path||"";return l[d]||(l[d]={errors:[],path:d}),l[d].errors.push(...c.errors),l},{});return{errors:Object.values(r)}}}}}async function nh(t,e){const i=await(Yt(e.rules)?e.rules:xa(e.rules)).parse(t,{formData:e.formData}),s=[];for(const o of i.errors)o.errors.length&&s.push(...o.errors);return{value:i.value,errors:s}}async function ih(t,e,n){const i=Vf(n.name);if(!i)throw new Error(`No such validator '${n.name}' exists.`);const s=sh(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:s})},r=await i(e,s,o);return typeof r=="string"?{error:r}:{error:r?void 0:_a(o)}}function _a(t){const e=ti().generateMessage;return e?e(t):"Field is invalid"}function sh(t,e){const n=i=>Lf(i)?i(e):i;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((i,s)=>(i[s]=n(t[s]),i),{})}async function oh(t,e){const i=await(Yt(t)?t:xa(t)).parse(_e(e),{formData:_e(e)}),s={},o={};for(const r of i.errors){const l=r.errors,c=(r.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);s[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!i.errors.length,results:s,errors:o,values:i.value,source:"schema"}}async function rh(t,e,n){const s=rt(t).map(async d=>{var u,f,h;const m=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],p=await Zf(Pt(e,d),t[d],{name:(m==null?void 0:m.name)||d,label:m==null?void 0:m.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},p),{path:d})});let o=!0;const r=await Promise.all(s),l={},c={};for(const d of r)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c,source:"schema"}}let ah=0;const cs=["bails","fieldsCount","id","multiple","type","validate"];function ka(t){const e={},n=Object.assign({},a.toValue(e)),i=a.unref(void 0);return i&&Yt(i)&&ut(i.cast)?_e(i.cast(n)||{}):_e(n)}function Sa(t){var e;const n=ah++,i="Form";let s=0;const o=a.ref(!1),r=a.ref(!1),l=a.ref(0),c=[],d=a.reactive(ka()),u=a.ref([]),f=a.ref({}),h=a.ref({}),m=qf(()=>{h.value=u.value.reduce((N,D)=>(N[rs(a.toValue(D.path))]=D,N),{})});function p(N,D){const V=j(N);if(!V){typeof N=="string"&&(f.value[rs(N)]=pa(D));return}if(typeof N=="string"){const q=rs(N);f.value[q]&&delete f.value[q]}V.errors=pa(D),V.valid=!V.errors.length}function g(N){rt(N).forEach(D=>{p(D,N[D])})}const y=a.computed(()=>{const N=u.value.reduce((D,V)=>(V.errors.length&&(D[a.toValue(V.path)]=V.errors),D),{});return Object.assign(Object.assign({},f.value),N)}),b=a.computed(()=>rt(y.value).reduce((N,D)=>{const V=y.value[D];return V!=null&&V.length&&(N[D]=V[0]),N},{})),x=a.computed(()=>u.value.reduce((N,D)=>(N[a.toValue(D.path)]={name:a.toValue(D.path)||"",label:D.label||""},N),{})),w=a.computed(()=>u.value.reduce((N,D)=>{var V;return N[a.toValue(D.path)]=(V=D.bails)!==null&&V!==void 0?V:!0,N},{})),E=Object.assign({},{}),k=(e=void 0)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:S,setInitialValues:_}=ch(u,d),O=lh(u,d,S,b),P=a.computed(()=>u.value.reduce((N,D)=>{const V=Pt(d,a.toValue(D.path));return At(N,a.toValue(D.path),V),N},{})),v=void 0;function T(N,D){var V,q;const te=a.computed(()=>Pt(C.value,a.toValue(N))),le=h.value[a.toValue(N)],Z=(D==null?void 0:D.type)==="checkbox"||(D==null?void 0:D.type)==="radio";if(le&&Z){le.multiple=!0;const Ne=s++;return Array.isArray(le.id)?le.id.push(Ne):le.id=[le.id,Ne],le.fieldsCount++,le.__flags.pendingUnmount[Ne]=!1,le}const M=a.computed(()=>Pt(d,a.toValue(N))),W=a.toValue(N),G=A.findIndex(Ne=>Ne===W);G!==-1&&A.splice(G,1);const X=a.computed(()=>{var Ne,ze,es,ts;const ns=a.toValue(v);if(Yt(ns))return(ze=(Ne=ns.describe)===null||Ne===void 0?void 0:Ne.call(ns,a.toValue(N)).required)!==null&&ze!==void 0?ze:!1;const Gr=a.toValue(D==null?void 0:D.schema);return Yt(Gr)&&(ts=(es=Gr.describe)===null||es===void 0?void 0:es.call(Gr).required)!==null&&ts!==void 0?ts:!1}),ie=s++,xe=a.reactive({id:ie,path:N,touched:!1,pending:!1,valid:!0,validated:!!(!((V=E[W])===null||V===void 0)&&V.length),required:X,initialValue:te,errors:a.shallowRef([]),bails:(q=D==null?void 0:D.bails)!==null&&q!==void 0?q:!1,label:D==null?void 0:D.label,type:(D==null?void 0:D.type)||"default",value:M,multiple:!1,__flags:{pendingUnmount:{[ie]:!1},pendingReset:!1},fieldsCount:1,validate:D==null?void 0:D.validate,dirty:a.computed(()=>!ei(a.unref(M),a.unref(te)))});return u.value.push(xe),h.value[W]=xe,m(),b.value[W]&&!E[W]&&a.nextTick(()=>{Ze(W,{mode:"silent"})}),a.isRef(N)&&a.watch(N,Ne=>{m();const ze=_e(M.value);h.value[Ne]=xe,a.nextTick(()=>{At(d,Ne,ze)})}),xe}const R=ma(dt,5),U=ma(dt,5),Y=Hf(async N=>await(N==="silent"?R():U()),(N,[D])=>{const V=rt(ue.errorBag.value),te=[...new Set([...rt(N.results),...u.value.map(le=>le.path),...V])].sort().reduce((le,Z)=>{var M;const W=Z,G=j(W)||$(W),X=((M=N.results[W])===null||M===void 0?void 0:M.errors)||[],ie=a.toValue(G==null?void 0:G.path)||W,xe=dh({errors:X,valid:!X.length},le.results[ie]);return le.results[ie]=xe,xe.valid||(le.errors[ie]=xe.errors[0]),G&&f.value[ie]&&delete f.value[ie],G?(G.valid=xe.valid,D==="silent"||D==="validated-only"&&!G.validated||p(G,xe.errors),le):(p(ie,X),le)},{valid:N.valid,results:{},errors:{},source:N.source});return N.values&&(te.values=N.values,te.source=N.source),rt(te.results).forEach(le=>{var Z;const M=j(le);M&&D!=="silent"&&(D==="validated-only"&&!M.validated||p(M,(Z=te.results[le])===null||Z===void 0?void 0:Z.errors))}),te});function L(N){u.value.forEach(N)}function j(N){const D=typeof N=="string"?rs(N):N;return typeof D=="string"?h.value[D]:D}function $(N){return u.value.filter(V=>N.startsWith(a.toValue(V.path))).reduce((V,q)=>V?q.path.length>V.path.length?q:V:q,void 0)}let A=[],I;function Q(N){return A.push(N),I||(I=a.nextTick(()=>{[...A].sort().reverse().forEach(V=>{ha(d,V)}),A=[],I=null})),I}function ne(N){return function(V,q){return function(le){return le instanceof Event&&(le.preventDefault(),le.stopPropagation()),L(Z=>Z.touched=!0),o.value=!0,l.value++,Te().then(Z=>{const M=_e(d);if(Z.valid&&typeof V=="function"){const W=_e(P.value);let G=N?W:M;return Z.values&&(G=Z.source==="schema"?Z.values:Object.assign({},G,Z.values)),V(G,{evt:le,controlledValues:W,setErrors:g,setFieldError:p,setTouched:pe,setFieldTouched:ct,setValues:qe,setFieldValue:ve,resetForm:ge,resetField:me})}!Z.valid&&typeof q=="function"&&q({values:M,evt:le,errors:Z.errors,results:Z.results})}).then(Z=>(o.value=!1,Z),Z=>{throw o.value=!1,Z})}}}const K=ne(!1);K.withControlled=ne(!0);function J(N,D){const V=u.value.findIndex(te=>te.path===N&&(Array.isArray(te.id)?te.id.includes(D):te.id===D)),q=u.value[V];if(!(V===-1||!q)){if(a.nextTick(()=>{Ze(N,{mode:"silent",warn:!1})}),q.multiple&&q.fieldsCount&&q.fieldsCount--,Array.isArray(q.id)){const te=q.id.indexOf(D);te>=0&&q.id.splice(te,1),delete q.__flags.pendingUnmount[D]}(!q.multiple||q.fieldsCount<=0)&&(u.value.splice(V,1),Bt(N),m(),delete h.value[N])}}function oe(N){rt(h.value).forEach(D=>{D.startsWith(N)&&delete h.value[D]}),u.value=u.value.filter(D=>!D.path.startsWith(N)),a.nextTick(()=>{m()})}const ue={name:i,formId:n,values:d,controlledValues:P,errorBag:y,errors:b,schema:v,submitCount:l,meta:O,isSubmitting:o,isValidating:r,fieldArrays:c,keepValuesOnUnmount:k,validateSchema:a.unref(v)?Y:void 0,validate:Te,setFieldError:p,validateField:Ze,setFieldValue:ve,setValues:qe,setErrors:g,setFieldTouched:ct,setTouched:pe,resetForm:ge,resetField:me,handleSubmit:K,useFieldModel:Bn,defineInputBinds:ee,defineComponentBinds:_t,defineField:fn,stageInitialValue:Le,unsetInitialValue:Bt,setFieldInitialValue:et,createPathState:T,getPathState:j,unsetPathValue:Q,removePathState:J,initialValues:C,getAllPathStates:()=>u.value,destroyPath:oe,isFieldTouched:H,isFieldDirty:F,isFieldValid:he};function ve(N,D,V=!0){const q=_e(D),te=typeof N=="string"?N:N.path;j(te)||T(te),At(d,te,q),V&&Ze(te)}function st(N,D=!0){rt(d).forEach(V=>{delete d[V]}),rt(N).forEach(V=>{ve(V,N[V],!1)}),D&&Te()}function qe(N,D=!0){Zn(d,N),c.forEach(V=>V&&V.reset()),D&&Te()}function xt(N,D){const V=j(a.toValue(N))||T(N);return a.computed({get(){return V.value},set(q){var te;const le=a.toValue(N);ve(le,q,(te=a.toValue(D))!==null&&te!==void 0?te:!1)}})}function ct(N,D){const V=j(N);V&&(V.touched=D)}function H(N){const D=j(N);return D?D.touched:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.touched)}function F(N){const D=j(N);return D?D.dirty:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.dirty)}function he(N){const D=j(N);return D?D.valid:u.value.filter(V=>V.path.startsWith(N)).every(V=>V.valid)}function pe(N){if(typeof N=="boolean"){L(D=>{D.touched=N});return}rt(N).forEach(D=>{ct(D,!!N[D])})}function me(N,D){var V;const q=D&&"value"in D?D.value:Pt(C.value,N),te=j(N);te&&(te.__flags.pendingReset=!0),et(N,_e(q),!0),ve(N,q,!1),ct(N,(V=D==null?void 0:D.touched)!==null&&V!==void 0?V:!1),p(N,(D==null?void 0:D.errors)||[]),a.nextTick(()=>{te&&(te.__flags.pendingReset=!1)})}function ge(N,D){let V=_e(N!=null&&N.values?N.values:S.value);V=D!=null&&D.force?V:Zn(S.value,V),V=Yt(v)&&ut(v.cast)?v.cast(V):V,_(V,{force:D==null?void 0:D.force}),L(q=>{var te;q.__flags.pendingReset=!0,q.validated=!1,q.touched=((te=N==null?void 0:N.touched)===null||te===void 0?void 0:te[a.toValue(q.path)])||!1,ve(a.toValue(q.path),Pt(V,a.toValue(q.path)),!1),p(a.toValue(q.path),void 0)}),D!=null&&D.force?st(V,!1):qe(V,!1),g((N==null?void 0:N.errors)||{}),l.value=(N==null?void 0:N.submitCount)||0,a.nextTick(()=>{Te({mode:"silent"}),L(q=>{q.__flags.pendingReset=!1})})}async function Te(N){const D=(N==null?void 0:N.mode)||"force";if(D==="force"&&L(Z=>Z.validated=!0),ue.validateSchema)return ue.validateSchema(D);r.value=!0;const V=await Promise.all(u.value.map(Z=>Z.validate?Z.validate(N).then(M=>({key:a.toValue(Z.path),valid:M.valid,errors:M.errors,value:M.value})):Promise.resolve({key:a.toValue(Z.path),valid:!0,errors:[],value:void 0})));r.value=!1;const q={},te={},le={};for(const Z of V)q[Z.key]={valid:Z.valid,errors:Z.errors},Z.value&&At(le,Z.key,Z.value),Z.errors.length&&(te[Z.key]=Z.errors[0]);return{valid:V.every(Z=>Z.valid),results:q,errors:te,values:le,source:"fields"}}async function Ze(N,D){var V;const q=j(N);return q&&(D==null?void 0:D.mode)!=="silent"&&(q.validated=!0),q!=null&&q.validate?q.validate(D):(!q&&(V=D==null?void 0:D.warn),Promise.resolve({errors:[],valid:!0}))}function Bt(N){ha(C.value,N)}function Le(N,D,V=!1){et(N,D),At(d,N,D),V&&At(S.value,N,_e(D))}function et(N,D,V=!1){At(C.value,N,_e(D)),V&&At(S.value,N,_e(D))}async function dt(){const N=a.unref(v);if(!N)return{valid:!0,results:{},errors:{},source:"none"};r.value=!0;const D=la(N)||Yt(N)?await oh(N,d):await rh(N,d,{names:x.value,bailsMap:w.value});return r.value=!1,D}const un=K((N,{evt:D})=>{Wf(D)&&D.target.submit()});a.onMounted(()=>{ue.validateSchema&&ue.validateSchema("silent")}),a.isRef(v)&&a.watch(v,()=>{var N;(N=ue.validateSchema)===null||N===void 0||N.call(ue,"validated-only")}),a.provide(Rf,ue);function fn(N,D){const V=ut(D)||D==null?void 0:D.label,q=j(a.toValue(N))||T(N,{label:V}),te=()=>ut(D)?D(ls(q,cs)):D||{};function le(){var X;q.touched=!0,((X=te().validateOnBlur)!==null&&X!==void 0?X:ti().validateOnBlur)&&Ze(a.toValue(q.path))}function Z(){var X;((X=te().validateOnInput)!==null&&X!==void 0?X:ti().validateOnInput)&&a.nextTick(()=>{Ze(a.toValue(q.path))})}function M(){var X;((X=te().validateOnChange)!==null&&X!==void 0?X:ti().validateOnChange)&&a.nextTick(()=>{Ze(a.toValue(q.path))})}const W=a.computed(()=>{const X={onChange:M,onInput:Z,onBlur:le};return ut(D)?Object.assign(Object.assign({},X),D(ls(q,cs)).props||{}):D!=null&&D.props?Object.assign(Object.assign({},X),D.props(ls(q,cs))):X});return[xt(N,()=>{var X,ie,xe;return(xe=(X=te().validateOnModelUpdate)!==null&&X!==void 0?X:(ie=ti())===null||ie===void 0?void 0:ie.validateOnModelUpdate)!==null&&xe!==void 0?xe:!0}),W]}function Bn(N){return Array.isArray(N)?N.map(D=>xt(D,!0)):xt(N)}function ee(N,D){const[V,q]=fn(N,D);function te(){q.value.onBlur()}function le(M){const W=ya(M);ve(a.toValue(N),W,!1),q.value.onInput()}function Z(M){const W=ya(M);ve(a.toValue(N),W,!1),q.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},q.value),{onBlur:te,onInput:le,onChange:Z,value:V.value}))}function _t(N,D){const[V,q]=fn(N,D),te=j(a.toValue(N));function le(Z){V.value=Z}return a.computed(()=>{const Z=ut(D)?D(ls(te,cs)):D||{};return Object.assign({[Z.model||"modelValue"]:V.value,[`onUpdate:${Z.model||"modelValue"}`]:le},q.value)})}const Ae=Object.assign(Object.assign({},ue),{values:a.readonly(d),handleReset:()=>ge(),submitForm:un});return a.provide(Ff,Ae),Ae}function lh(t,e,n,i){const s={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!ei(e,a.unref(n)));function r(){const c=t.value;return rt(s).reduce((d,u)=>{const f=s[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(r());return a.watchEffect(()=>{const c=r();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!rt(i.value).length,dirty:o.value}))}function ch(t,e,n){const i=ka(),s=a.ref(i),o=a.ref(_e(i));function r(l,c){c!=null&&c.force?(s.value=_e(l),o.value=_e(l)):(s.value=Zn(_e(s.value)||{},_e(l)),o.value=Zn(_e(o.value)||{},_e(l))),c!=null&&c.updateFields&&t.value.forEach(d=>{if(d.touched)return;const f=Pt(s.value,a.toValue(d.path));At(e,a.toValue(d.path),_e(f))})}return{initialValues:s,originalInitialValues:o,setInitialValues:r}}function dh(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}function uh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Eo,wa;function fh(){if(wa)return Eo;wa=1;function t(b){this._maxSize=b,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(b){return this._values[b]},t.prototype.set=function(b,x){return this._size>=this._maxSize&&this.clear(),b in this._values||this._size++,this._values[b]=x};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,r=512,l=new t(r),c=new t(r),d=new t(r);Eo={Cache:t,split:f,normalizePath:u,setter:function(b){var x=u(b);return c.get(b)||c.set(b,function(E,k){for(var C=0,S=x.length,_=E;C<S-1;){var O=x[C];if(O==="__proto__"||O==="constructor"||O==="prototype")return E;_=_[x[C++]]}_[x[C]]=k})},getter:function(b,x){var w=u(b);return d.get(b)||d.set(b,function(k){for(var C=0,S=w.length;C<S;)if(k!=null||!x)k=k[w[C++]];else return;return k})},join:function(b){return b.reduce(function(x,w){return x+(m(w)||n.test(w)?"["+w+"]":(x?".":"")+w)},"")},forEach:function(b,x,w){h(Array.isArray(b)?b:f(b),x,w)}};function u(b){return l.get(b)||l.set(b,f(b).map(function(x){return x.replace(o,"$2")}))}function f(b){return b.match(e)||[""]}function h(b,x,w){var E=b.length,k,C,S,_;for(C=0;C<E;C++)k=b[C],k&&(y(k)&&(k='"'+k+'"'),_=m(k),S=!_&&/^\d+$/.test(k),x.call(w,k,_,S,C,b))}function m(b){return typeof b=="string"&&b&&["'",'"'].indexOf(b.charAt(0))!==-1}function p(b){return b.match(i)&&!b.match(n)}function g(b){return s.test(b)}function y(b){return!m(b)&&(p(b)||g(b))}return Eo}var hn=fh(),Co,Ea;function hh(){if(Ea)return Co;Ea=1;const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=u=>u.match(t)||[],n=u=>u[0].toUpperCase()+u.slice(1),i=(u,f)=>e(u).join(f).toLowerCase(),s=u=>e(u).reduce((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return Co={words:e,upperFirst:n,camelCase:s,pascalCase:u=>n(s(u)),snakeCase:u=>i(u,"_"),kebabCase:u=>i(u,"-"),sentenceCase:u=>n(i(u," ")),titleCase:u=>e(u).map(n).join(" ")},Co}var Oo=hh(),ds={exports:{}},Ca;function mh(){if(Ca)return ds.exports;Ca=1,ds.exports=function(s){return t(e(s),s)},ds.exports.array=t;function t(s,o){var r=s.length,l=new Array(r),c={},d=r,u=n(o),f=i(s);for(o.forEach(function(m){if(!f.has(m[0])||!f.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)c[d]||h(s[d],d,new Set);return l;function h(m,p,g){if(g.has(m)){var y;try{y=", node was:"+JSON.stringify(m)}catch{y=""}throw new Error("Cyclic dependency"+y)}if(!f.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!c[p]){c[p]=!0;var b=u.get(m)||new Set;if(b=Array.from(b),p=b.length){g.add(m);do{var x=b[--p];h(x,f.get(x),g)}while(p);g.delete(m)}l[--r]=m}}}function e(s){for(var o=new Set,r=0,l=s.length;r<l;r++){var c=s[r];o.add(c[0]),o.add(c[1])}return Array.from(o)}function n(s){for(var o=new Map,r=0,l=s.length;r<l;r++){var c=s[r];o.has(c[0])||o.set(c[0],new Set),o.has(c[1])||o.set(c[1],new Set),o.get(c[0]).add(c[1])}return o}function i(s){for(var o=new Map,r=0,l=s.length;r<l;r++)o.set(s[r],r);return o}return ds.exports}var ph=mh();const gh=uh(ph),yh=Object.prototype.toString,bh=Error.prototype.toString,xh=RegExp.prototype.toString,_h=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",kh=/^Symbol\((.*)\)(.*)$/;function Sh(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function Oa(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Sh(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return _h.call(t).replace(kh,"Symbol($1)");const i=yh.call(t).slice(8,-1);return i==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):i==="Error"||t instanceof Error?"["+bh.call(t)+"]":i==="RegExp"?xh.call(t):null}function Kt(t,e){let n=Oa(t,e);return n!==null?n:JSON.stringify(t,function(i,s){let o=Oa(this[i],e);return o!==null?o:s},2)}function va(t){return t==null?[]:[].concat(t)}let Na,Da,Ta,wh=/\$\{\s*(\w+)\s*\}/g;Na=Symbol.toStringTag;class Ba{constructor(e,n,i,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Na]="Error",this.name="ValidationError",this.value=n,this.path=i,this.type=s,this.errors=[],this.inner=[],va(e).forEach(o=>{if(Ke.isError(o)){this.errors.push(...o.errors);const r=o.inner.length?o.inner:[o];this.inner.push(...r)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Da=Symbol.hasInstance,Ta=Symbol.toStringTag;class Ke extends Error{static formatError(e,n){const i=n.label||n.path||"this";return n=Object.assign({},n,{path:i,originalPath:n.path}),typeof e=="string"?e.replace(wh,(s,o)=>Kt(n[o])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,i,s,o){const r=new Ba(e,n,i,s);if(o)return r;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ta]="Error",this.name=r.name,this.message=r.message,this.type=r.type,this.value=r.value,this.path=r.path,this.errors=r.errors,this.inner=r.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ke)}static[Da](e){return Ba[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let St={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:i})=>{const s=i!=null&&i!==n?` (cast from the value \`${Kt(i,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Kt(n,!0)}\``+s:`${t} must match the configured type. The validated value was: \`${Kt(n,!0)}\``+s}},Xe={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Eh={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},vo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ch={isValue:"${path} field must be ${value}"},us={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:St,string:Xe,number:Eh,date:vo,object:us,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Ch,tuple:{notType:t=>{const{path:e,value:n,spec:i}=t,s=i.types.length;if(Array.isArray(n)){if(n.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${n.length} for value: \`${Kt(n,!0)}\``;if(n.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${n.length} for value: \`${Kt(n,!0)}\``}return Ke.formatError(St.notType,t)}}});const No=t=>t&&t.__isYupSchema__;class fs{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:o}=n,r=typeof i=="function"?i:(...l)=>l.every(c=>c===i);return new fs(e,(l,c)=>{var d;let u=r(...l)?s:o;return(d=u==null?void 0:u(c))!=null?d:c})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let i=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),s=this.fn(i,e,n);if(s===void 0||s===e)return e;if(!No(s))throw new TypeError("conditions must return a schema object");return s.resolve(n)}}const hs={context:"$",value:"."};class mn{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===hs.context,this.isValue=this.key[0]===hs.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?hs.context:this.isValue?hs.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&hn.getter(this.path,!0),this.map=n.map}getValue(e,n,i){let s=this.isContext?i:this.isValue?e:n;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}mn.prototype.__isYupRef=!0;const pn=t=>t==null;function Mn(t){function e({value:n,path:i="",options:s,originalValue:o,schema:r},l,c){const{name:d,test:u,params:f,message:h,skipAbsent:m}=t;let{parent:p,context:g,abortEarly:y=r.spec.abortEarly,disableStackTrace:b=r.spec.disableStackTrace}=s;function x(v){return mn.isRef(v)?v.getValue(n,p,g):v}function w(v={}){const T=Object.assign({value:n,originalValue:o,label:r.spec.label,path:v.path||i,spec:r.spec,disableStackTrace:v.disableStackTrace||b},f,v.params);for(const U of Object.keys(T))T[U]=x(T[U]);const R=new Ke(Ke.formatError(v.message||h,T),n,T.path,v.type||d,T.disableStackTrace);return R.params=T,R}const E=y?l:c;let k={path:i,parent:p,type:d,from:s.from,createError:w,resolve:x,options:s,originalValue:o,schema:r};const C=v=>{Ke.isError(v)?E(v):v?c(null):E(w())},S=v=>{Ke.isError(v)?E(v):l(v)};if(m&&pn(n))return C(!0);let O;try{var P;if(O=u.call(k,n,k),typeof((P=O)==null?void 0:P.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(O).then(C,S)}}catch(v){S(v);return}C(O)}return e.OPTIONS=t,e}function Oh(t,e,n,i=n){let s,o,r;return e?(hn.forEach(e,(l,c,d)=>{let u=c?l.slice(1,l.length-1):l;t=t.resolve({context:i,parent:s,value:n});let f=t.type==="tuple",h=d?parseInt(u,10):0;if(t.innerType||f){if(f&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${r}" must contain an index to the tuple element, e.g. "${r}[0]"`);if(n&&h>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);s=n,n=n&&n[h],t=f?t.spec.types[h]:t.innerType}if(!d){if(!t.fields||!t.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${r} which is a type: "${t.type}")`);s=n,n=n&&n[u],t=t.fields[u]}o=u,r=c?"["+l+"]":"."+l}),{schema:t,parent:s,parentPath:o}):{parent:s,parentPath:e,schema:t}}class ms extends Set{describe(){const e=[];for(const n of this.values())e.push(mn.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const i of this.values())n.push(e(i));return n}clone(){return new ms(this.values())}merge(e,n){const i=this.clone();return e.forEach(s=>i.add(s)),n.forEach(s=>i.delete(s)),i}}function Vn(t,e=new Map){if(No(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let i=0;i<t.length;i++)n[i]=Vn(t[i],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[i,s]of t.entries())n.set(i,Vn(s,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const i of t)n.add(Vn(i,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[i,s]of Object.entries(t))n[i]=Vn(s,e)}else throw Error(`Unable to clone ${t}`);return n}class wt{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ms,this._blacklist=new ms,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(St.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Vn(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=n,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,i=e.clone();const s=Object.assign({},n.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},n.internalTests,i.internalTests),i._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),i.tests=n.tests,i.exclusiveTests=n.exclusiveTests,i.withMutation(o=>{e.tests.forEach(r=>{o.test(r.OPTIONS)})}),i.transforms=[...n.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let i=n.conditions;n=n.clone(),n.conditions=[],n=i.reduce((s,o)=>o.resolve(s,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,i,s,o;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=e.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(e,n={}){let i=this.resolve(Object.assign({value:e},n)),s=n.assert==="ignore-optionality",o=i._cast(e,n);if(n.assert!==!1&&!i.isType(o)){if(s&&pn(o))return o;let r=Kt(e),l=Kt(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
|
|
10
10
|
|
|
11
|
-
attempted value: ${
|
|
12
|
-
`+(l!==a?`result of cast: ${l}`:""))}return o}_cast(e,t){let i=e===void 0?e:this.transforms.reduce((s,o)=>o.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(t)),i}_validate(e,t={},i,s){let{path:o,originalValue:a=e,strict:l=this.spec.strict}=t,c=e;l||(c=this._cast(c,Object.assign({assert:!1},t)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:c,originalValue:a,options:t,tests:d},i,u=>{if(u.length)return s(u,c);this.runTests({path:o,value:c,originalValue:a,options:t,tests:this.tests},i,s)})}runTests(e,t,i){let s=!1,{tests:o,value:a,originalValue:l,path:c,options:d}=e,u=g=>{s||(s=!0,t(g,a))},f=g=>{s||(s=!0,i(g,a))},h=o.length,m=[];if(!h)return f([]);let p={value:a,originalValue:l,path:c,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(p,u,function(_){_&&(Array.isArray(_)?m.push(..._):m.push(_)),--h<=0&&f(m)})}}asNestedTest({key:e,index:t,parent:i,parentPath:s,originalParent:o,options:a}){const l=e??t;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=i[l];const u=Object.assign({},a,{strict:!0,parent:i,value:d,originalValue:o[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${s||""}[${c?l:`"${l}"`}]`:(s?`${s}.`:"")+e});return(f,h,m)=>this.resolve(u)._validate(d,u,h,m)}validate(e,t){var i;let s=this.resolve(Object.assign({},t,{value:e})),o=(i=t==null?void 0:t.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((a,l)=>s._validate(e,t,(c,d)=>{We.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new We(c,d,void 0,void 0,o)):a(d)}))}validateSync(e,t){var i;let s=this.resolve(Object.assign({},t,{value:e})),o,a=(i=t==null?void 0:t.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},t,{sync:!0}),(l,c)=>{throw We.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new We(l,e,void 0,void 0,a);o=c}),o}isValid(e,t){return this.validate(e,t).then(()=>!0,i=>{if(We.isError(i))return!1;throw i})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(i){if(We.isError(i))return!1;throw i}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):En(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const i=this.clone({nullable:e});return i.internalTests.nullable=wn({message:t,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,t){const i=this.clone({optional:e});return i.internalTests.optionality=wn({message:t,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=mt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=mt.notNull){return this.nullability(!1,e)}required(e=mt.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=mt.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=wn(t),o=t.exclusive||t.name&&i.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(i.exclusiveTests[t.name]=!!t.exclusive),i.tests=i.tests.filter(a=>!(a.OPTIONS.name===t.name&&(o||a.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let i=this.clone(),s=Lr(e).map(o=>new rn(o));return s.forEach(o=>{o.isSibling&&i.deps.push(o.key)}),i.conditions.push(typeof t=="function"?new Xi(s,t):Xi.fromOptions(s,t)),i}typeError(e){let t=this.clone();return t.internalTests.typeError=wn({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=mt.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=wn({message:t,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),i}notOneOf(e,t=mt.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=wn({message:t,name:"notOneOf",test(s){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),i}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:o,nullable:a}=t.spec;return{meta:s,label:i,optional:o,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,u)=>u.findIndex(f=>f.name===c.name)===d)}}}pt.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])pt.prototype[`${n}At`]=function(e,t,i={}){const{parent:s,parentPath:o,schema:a}=Ju(this,e,t,i.context);return a[n](s&&s[o],Object.assign({},i,{parent:s,path:e}))};for(const n of["equals","is"])pt.prototype[n]=pt.prototype.oneOf;for(const n of["not","nope"])pt.prototype[n]=pt.prototype.notOneOf;const Zu=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ef(n){const e=eo(n);if(!e)return Date.parse?Date.parse(n):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function eo(n){var e,t;const i=Zu.exec(n);return i?{year:Ct(i[1]),month:Ct(i[2],1)-1,day:Ct(i[3],1),hour:Ct(i[4]),minute:Ct(i[5]),second:Ct(i[6]),millisecond:i[7]?Ct(i[7].substring(0,3)):0,precision:(e=(t=i[7])==null?void 0:t.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Ct(i[10]),minuteOffset:Ct(i[11])}:null}function Ct(n,e=0){return Number(n)||e}let tf=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,sf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,of="^\\d{4}-\\d{2}-\\d{2}",rf="\\d{2}:\\d{2}:\\d{2}",af="(([+-]\\d{2}(:?\\d{2})?)|Z)",lf=new RegExp(`${of}T${rf}(\\.\\d+)?${af}$`),cf=n=>an(n)||n===n.trim(),df={}.toString();function to(){return new Hr}class Hr extends pt{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===df?e:s})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||mt.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=He.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,t=He.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,t=He.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,t){let i=!1,s,o;return t&&(typeof t=="object"?{excludeEmptyString:i=!1,message:s,name:o}=t:s=t),this.test({name:o||"matches",message:s||He.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&i||a.search(e)!==-1})}email(e=He.email){return this.matches(tf,{name:"email",message:e,excludeEmptyString:!0})}url(e=He.url){return this.matches(nf,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=He.uuid){return this.matches(sf,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",i,s;return e&&(typeof e=="object"?{message:t="",allowOffset:i=!1,precision:s=void 0}=e:t=e),this.matches(lf,{name:"datetime",message:t||He.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||He.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:o=>{if(!o||i)return!0;const a=eo(o);return a?!!a.z:!1}}).test({name:"datetime_precision",message:t||He.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const a=eo(o);return a?a.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=He.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:cf})}lowercase(e=He.lowercase){return this.transform(t=>an(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>an(t)||t===t.toLowerCase()})}uppercase(e=He.uppercase){return this.transform(t=>an(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>an(t)||t===t.toUpperCase()})}}to.prototype=Hr.prototype;let uf=new Date(""),ff=n=>Object.prototype.toString.call(n)==="[object Date]";class Ji extends pt{constructor(){super({type:"date",check(e){return ff(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=ef(e),isNaN(e)?Ji.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let i;if(rn.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,t=Js.min){let i=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,t=Js.max){let i=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}Ji.INVALID_DATE=uf,Ji.prototype;function hf(n,e=[]){let t=[],i=new Set,s=new Set(e.map(([a,l])=>`${a}-${l}`));function o(a,l){let c=on.split(a)[0];i.add(c),s.has(`${l}-${c}`)||t.push([l,c])}for(const a of Object.keys(n)){let l=n[a];i.add(a),rn.isRef(l)&&l.isSibling?o(l.path,a):Zs(l)&&"deps"in l&&l.deps.forEach(c=>o(c,a))}return zu.array(Array.from(i),t).reverse()}function Ur(n,e){let t=1/0;return n.some((i,s)=>{var o;if((o=e.path)!=null&&o.includes(i))return t=s,!0}),t}function qr(n){return(e,t)=>Ur(n,e)-Ur(n,t)}const mf=(n,e,t)=>{if(typeof n!="string")return n;let i=n;try{i=JSON.parse(n)}catch{}return t.isType(i)?i:n};function Zi(n){if("fields"in n){const e={};for(const[t,i]of Object.entries(n.fields))e[t]=Zi(i);return n.setFields(e)}if(n.type==="array"){const e=n.optional();return e.innerType&&(e.innerType=Zi(e.innerType)),e}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(Zi)}):"optional"in n?n.optional():n}const pf=(n,e)=>{const t=[...on.normalizePath(e)];if(t.length===1)return t[0]in n;let i=t.pop(),s=on.getter(on.join(t),!0)(n);return!!(s&&i in s)};let Yr=n=>Object.prototype.toString.call(n)==="[object Object]";function Kr(n,e){let t=Object.keys(n.fields);return Object.keys(e).filter(i=>t.indexOf(i)===-1)}const gf=qr([]);function no(n){return new Xr(n)}class Xr extends pt{constructor(e){super({type:"object",check(t){return Yr(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=gf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var i;let s=super._cast(e,t);if(s===void 0)return this.getDefault(t);if(!this._typeCheck(s))return s;let o=this.fields,a=(i=t.stripUnknown)!=null?i:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(s).filter(f=>!this._nodes.includes(f))),c={},d=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),u=!1;for(const f of l){let h=o[f],m=f in s;if(h){let p,g=s[f];d.path=(t.path?`${t.path}.`:"")+f,h=h.resolve({value:g,context:t.context,parent:c});let y=h instanceof pt?h.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||f in s;continue}p=!t.__validating||!b?h.cast(s[f],d):s[f],p!==void 0&&(c[f]=p)}else m&&!a&&(c[f]=s[f]);(m!==f in c||c[f]!==s[f])&&(u=!0)}return u?c:s}_validate(e,t={},i,s){let{from:o=[],originalValue:a=e,recursive:l=this.spec.recursive}=t;t.from=[{schema:this,value:a},...o],t.__validating=!0,t.originalValue=a,super._validate(e,t,i,(c,d)=>{if(!l||!Yr(d)){s(c,d);return}a=a||d;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||rn.isRef(h)||u.push(h.asNestedTest({options:t,key:f,parent:d,parentPath:t.path,originalParent:a}))}this.runTests({tests:u,value:d,originalValue:a,options:t},i,f=>{s(f.sort(this._sortErrors).concat(c),d)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),i=t.fields;for(let[s,o]of Object.entries(this.fields)){const a=i[s];i[s]=a===void 0?o:a}return t.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(i=>{var s;const o=this.fields[i];let a=e;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),t[i]=o&&"getDefault"in o?o.getDefault(a):void 0}),t}setFields(e,t){let i=this.clone();return i.fields=e,i._nodes=hf(e,t),i._sortErrors=qr(Object.keys(e)),t&&(i._excludedEdges=t),i}shape(e,t=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...i._excludedEdges,...t]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[t,i]of Object.entries(this.fields))e[t]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return Zi(this)}pick(e){const t={};for(const i of e)this.fields[i]&&(t[i]=this.fields[i]);return this.setFields(t,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const t=[];for(const i of Object.keys(this.fields))e.includes(i)||t.push(i);return this.pick(t)}from(e,t,i){let s=on.getter(e,!0);return this.transform(o=>{if(!o)return o;let a=o;return pf(o,e)&&(a=Object.assign({},o),i||delete a[e],a[t]=s(o)),a})}json(){return this.transform(mf)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ki.exact,test(t){if(t==null)return!0;const i=Kr(this.schema,t);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ki.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:t,test(s){if(s==null)return!0;const o=Kr(this.schema,s);return!e||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,t=Ki.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const i={};for(const s of Object.keys(t))i[e(s)]=t[s];return i})}camelCase(){return this.transformKeys(Qs.camelCase)}snakeCase(){return this.transformKeys(Qs.snakeCase)}constantCase(){return this.transformKeys(e=>Qs.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[o,a]of Object.entries(t.fields)){var s;let l=e;(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),i.fields[o]=a.describe(l)}return i}}no.prototype=Xr.prototype;function io(n,e,t){const i=new sn;let s=r.ref({});const o=r.ref({}),a=r.ref({});let l=r.ref([]);const c=r.ref(null),d=r.ref([]);let u=r.ref([]),f=r.ref(!1);const h=r.ref({});let{handleSubmit:m,errors:p,setErrors:g}=Vr();const y=async()=>{var $;try{const P=await i.getEntityRecords(n);P&&P.response&&(s.value=P.response,l.value=($=P.response.entity.entityDefinition)==null?void 0:$.columns,j(),S(),D())}catch(P){toast.add({severity:"error",summary:"Error",detail:P.errorMessage,life:3e3})}finally{}},b=async()=>{var $;try{const P=await i.getRecord(n,e);P&&P.response&&(s.value=P.response,l.value=($=P.response.entity.entityDefinition)==null?void 0:$.columns,j(),o.value=JSON.parse(JSON.stringify(P.response.result[0])),D())}catch(P){console.error("Error fetching entity:",P.errorMessage)}finally{}},_=async()=>{var $,P;try{const R=await i.getRelatedEntityRecord(n,e);R&&R.response&&(s.value=R.response,l.value=(P=($=R.response.entity)==null?void 0:$.entityDefinition)==null?void 0:P.columns,j(),o.value=JSON.parse(JSON.stringify(R.response.result[0])),o.value.entityName&&delete o.value.entityName,o.value.linkedEntities&&delete o.value.linkedEntities,u.value=R.response.result[0].linkedEntities,a.value=JSON.parse(JSON.stringify(o.value)),D())}catch(R){console.error("Error fetching entity:",R.errorMessage)}finally{}},w=async $=>{try{let P=await i.addRecord(n,$);P&&P.response&&t("onSaveDialog",{entityName:n,recordId:e})}catch(P){P.validationErrors&&(d.value=JSON.parse(JSON.stringify(P.validationErrors))),console.error("Error fetching entity:",P.errorMessage)}finally{}},E=async($,P)=>{try{let R=await i.addRecord(n,P);if(R&&R.response){let G=await i.saveRelatedEntityRecord(n,R.response.recordId,$.linkedEntities);G&&G.response&&t("onSaveDialog",{entityName:n,recordId:e})}}catch(R){R.validationErrors&&(d.value=JSON.parse(JSON.stringify(R.validationErrors))),console.error("Error fetching entity:",R.errorMessage)}finally{}},k=async $=>{try{const P=await i.updateRecord(n,e,$);P&&P.response&&(f.value=!1,a.value=JSON.parse(JSON.stringify(o.value)),t("onSaveDialog",{entityName:n,recordId:e}))}catch(P){P.validationErrors&&(d.value=JSON.parse(JSON.stringify(P.errvalidationErrorsors))),console.error("Error fetching entity:",P.errorMessage)}finally{}},C=async($,P,R)=>{try{let G=await i.saveRelatedEntityRecord($,P,R);G&&G.response&&t("onSaveDialog",{entityName:n,enityRecordId:P})}catch(G){G.validationErrors&&(d.value=JSON.parse(JSON.stringify(G.validationErrors))),console.error("Error fetching entity:",G.errorMessage)}finally{}},S=()=>{for(let $=0;$<l.value.length;$++){let P=l.value[$];P.autoGenerated||(o.value[P.name]="")}},x=$=>{let P="";for(let R=0;R<l.value.length;R++){let G=l.value[R];if($==G.name){P=G.type;break}}return P},v=()=>{const $=l.value.filter(R=>R.autoGenerated).map(R=>R.name);return Object.entries(o.value).filter(([R])=>!$.includes(R)).map(([R,G])=>({recordColumnName:R,recordColumnValue:G,columnType:x(R)}))},B=async($={})=>{try{await c.value.validate(o.value,{abortEarly:!1}),g({})}catch(R){const G=R.inner.reduce((ne,Q)=>(ne[Q.path]||(ne[Q.path]={messages:[]}),ne[Q.path].messages.push(...Q.errors),ne),{}),se=Object.entries(G).reduce((ne,[Q,Y])=>(ne[Q]={messages:Y.messages},ne),{});g(se);return}const P={dataDefinitions:v()};e?await k(P):$.relationType=="MANY_TO_ONE"?await E($,P):await w(P)},D=()=>{c.value=no().shape(l.value.reduce(($,P)=>(P.autoGenerated||($[P.name]=to().nullable(!1).test({name:"custom-validation",test:function(R){const G=[];let se="";if(P.required&&(!R||R.trim()===""))if(P.validations){se=T(P.validations,"VALIDATE_REQUIRED"),G.push(se);let ne=q(P.validations,"VALIDATE_REQUIRED");ne&&(ne="hint:"+ne,G.push(ne))}else se=P.displayName+" is required.",G.push(se);else{if(P.maxLength&&R.length>P.maxLength)if(P.validations){se=T(P.validations,"VALIDATE_MAXLENGTH"),G.push(se);let ne=q(P.validations,"VALIDATE_MAXLENGTH");ne&&(ne="hint:"+ne,G.push(ne))}else se=P.displayName+" cannot exceed from "+P.maxLength+" characters",G.push(se);if(P.regxId&&!new RegExp(I(P.validations,"VALIDATE_REGX")).test(R))if(P.validations){se=T(P.validations,"VALIDATE_REGX"),G.push(se);let ne=q(P.validations,"VALIDATE_REGX");ne&&(ne="hint:"+ne,G.push(ne))}else se=P.displayName+" invalid format.",G.push(se)}return G.length>0?this.createError({message:G}):!0}})),$),{}))},T=($,P)=>{for(let R=0;R<$.length;R++)if(P==$[R].type)return $[R].message},I=($,P)=>{for(let R=0;R<$.length;R++)if(P==$[R].type)return $[R].regx},q=($,P)=>{for(let R=0;R<$.length;R++)if(P==$[R].type)return $[R].hint},L=$=>{g({...p.value,[$]:null}),f.value=!0},A=()=>{f.value=!1;for(let $ in o.value)o.value.hasOwnProperty($)&&g({...p.value,[$]:null});o.value=JSON.parse(JSON.stringify(a.value))},j=()=>{for(let $=0;$<l.value.length;$++){const P=l.value[$];if(P.primaryKey&&P.primaryKey==!0){h.value=P;break}}};return{formData:o,columns:l,errors:p,backendErrors:d,isDataChange:f,linkedEntities:u,primarayKeyColumn:h,clearErrors:L,saveRecord:B,fetchAllRecords:y,fetchRecord:b,getRelatedEntityRecordById:_,cancleRecord:A,saveRelatedEntityRecord:C}}const yf={key:0,class:"surface-card"},bf={class:"info"},xf={key:0,class:"list-none p-0"},Gr={__name:"EntityFormErrors",props:{errors:Array},setup(n){let e=r.ref(!0);const t=()=>{e.value=!e.value};return(i,s)=>{var a;const o=r.resolveComponent("Message");return((a=n.errors)==null?void 0:a.length)>0?(r.openBlock(),r.createElementBlock("div",yf,[s[1]||(s[1]=r.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),r.createElementVNode("div",bf,[r.createElementVNode("span",{onClick:s[0]||(s[0]=l=>t()),class:"cursor-pointer underline showHideColor"},r.toDisplayString(r.unref(e)?"Hide":"Show"),1)]),r.unref(e)?(r.openBlock(),r.createElementBlock("ul",xf,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.errors,(l,c)=>(r.openBlock(),r.createElementBlock("li",{key:c,class:"mb-2"},[r.createVNode(o,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(l.message),1)]),_:2},1024)]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)}}},_f={class:"field flex flex-col mb-3"},kf=["for"],Sf={key:0,class:"flex items-center"},wf={key:1},Ef={class:"flex items-center"},Qr={__name:"RelatedEntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=new sn,s=r.ref({});let o=r.ref("");const a=e;r.onMounted(()=>{l()});const l=async()=>{try{const u=await i.getEntityRecords(t.entityName);u&&u.response&&(s.value=u.response,d())}catch{}finally{}},c=()=>{a("update:modelValue",o.value[t.relatedEntityColumn])},d=()=>{for(let u=0;u<s.value.result.length;u++){const f=s.value.result[u];if(f[t.relatedEntityColumn]==t.modelValue){o.value=f;break}}};return(u,f)=>{const h=r.resolveComponent("Select");return r.openBlock(),r.createElementBlock("div",_f,[r.createElementVNode("label",{for:n.columnName},r.toDisplayString(n.columnName),9,kf),r.createVNode(h,{modelValue:r.unref(o),"onUpdate:modelValue":[f[0]||(f[0]=m=>r.isRef(o)?o.value=m:o=m),c],"item-value":n.relatedEntityColumn,options:s.value.result,filter:"",optionLabel:n.relatedEntityColumn,placeholder:"Select "+n.relatedEntityColumn,class:"w-full"},{value:r.withCtx(m=>[m.value?(r.openBlock(),r.createElementBlock("div",Sf,[r.createElementVNode("div",null,r.toDisplayString(m.value[n.relatedEntityColumn]),1)])):(r.openBlock(),r.createElementBlock("span",wf,r.toDisplayString(m.placeholder),1))]),option:r.withCtx(m=>[r.createElementVNode("div",Ef,[r.createElementVNode("div",null,r.toDisplayString(m.option[n.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},Cf={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},vf={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},Df={__name:"EntityDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showForm"]),setup(n,{emit:e}){const t=r.useModel(n,"showForm"),i=e,{formData:s,columns:o,errors:a,backendErrors:l,clearErrors:c,saveRecord:d,fetchAllRecords:u,fetchRecord:f}=io(n.entityName,n.recordId,i);return r.onMounted(()=>{n.recordId?f():u()}),(h,m)=>{const p=r.resolveComponent("Button"),g=r.resolveComponent("Dialog");return t.value?(r.openBlock(),r.createBlock(g,{key:0,showFooter:!1,visible:t.value,"onUpdate:visible":m[2]||(m[2]=y=>t.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[n.recordId?(r.openBlock(),r.createElementBlock("span",Cf,"Edit "+r.toDisplayString(n.entityName)+" record details",1)):r.createCommentVNode("",!0),n.recordId?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",vf,"Add "+r.toDisplayString(n.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(p,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:m[0]||(m[0]=y=>t.value=!1)}),r.createVNode(p,{type:"button",icon:"",label:"Save",severity:"success",onClick:m[1]||(m[1]=y=>r.unref(d)())})]),default:r.withCtx(()=>{var y;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(o),(b,_)=>{var w;return r.openBlock(),r.createElementBlock("div",{key:_},[!b.autoGenerated&&!b.foreignKey?(r.openBlock(),r.createBlock(zi,{key:0,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":E=>r.unref(s)[b.name]=E,column:b,errors:(w=r.unref(a)[b.name])==null?void 0:w.messages,onInput:r.unref(c)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0),!b.autoGenerated&&b.foreignKey?(r.openBlock(),r.createBlock(Qr,{key:1,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":E=>r.unref(s)[b.name]=E,entityName:b.foreignKey.referencedEntityName,columnName:b.name,relatedEntityColumn:b.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((y=r.unref(l))==null?void 0:y.length)>0?(r.openBlock(),r.createBlock(Gr,{key:0,errors:r.unref(l)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},Nf={__name:"DeleteConfirmationDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(n,{emit:e}){const t=new sn,i=r.useModel(n,"showDeleteDialog"),s=e,o=async()=>{try{const a=await t.deleteRecord(n.entityName,n.recordId);a&&a.response&&s("onDeleteItem")}catch(a){console.error("Error deleting record:",a.errorMessage)}finally{}};return(a,l)=>{const c=r.resolveComponent("Button"),d=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(d,{visible:i.value,"onUpdate:visible":l[1]||(l[1]=u=>i.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(c,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=u=>i.value=!1)}),r.createVNode(c,{label:"Yes",icon:"pi pi-check",text:"",onClick:o})]),default:r.withCtx(()=>[l[2]||(l[2]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};function so(n){return n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0}function Jr(n){return!!(n&&n.constructor&&n.call&&n.apply)}function Ee(n){return!so(n)}function Cn(n,e=!0){return n instanceof Object&&n.constructor===Object&&(e||Object.keys(n).length!==0)}function rt(n,...e){return Jr(n)?n(...e):n}function gt(n,e=!0){return typeof n=="string"&&(e||n!=="")}function Rt(n){return gt(n)?n.replace(/(-|_)/g,"").toLowerCase():n}function Zr(n,e="",t={}){const i=Rt(e).split("."),s=i.shift();return s?Cn(n)?Zr(rt(n[Object.keys(n).find(o=>Rt(o)===s)||""],t),i.join("."),t):void 0:rt(n,t)}function oo(n,e=!0){return Array.isArray(n)&&(e||n.length!==0)}function Of(n){return Ee(n)&&!isNaN(n)}function vt(n,e){if(e){const t=e.test(n);return e.lastIndex=0,t}return!1}function Wn(n){return n&&n.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function ea(n){return gt(n)?n.replace(/(_)/g,"-").replace(/[A-Z]/g,(e,t)=>t===0?e:"-"+e.toLowerCase()).toLowerCase():n}function ta(n){return gt(n)?n.replace(/[A-Z]/g,(e,t)=>t===0?e:"."+e.toLowerCase()).toLowerCase():n}var vn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},Tf={AND:"and",OR:"or"};const Pf={key:0},Bf={key:1},ro={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(n){const e=r.ref(null),t=Object.assign({"/src/directives/dateFormat.js":()=>Promise.resolve().then(()=>$b),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>Ib)});async function i(){await r.nextTick();const s=t[`/src/directives/${n.column.displayFormatKey}.js`];s&&e.value&&s().then(o=>{o.default.beforeMount(e.value,{value:n.value,arg:n.column.displayFormat})})}return r.onMounted(()=>{i()}),r.onUpdated(()=>{i()}),(s,o)=>n.column.displayFormatKey?(r.openBlock(),r.createElementBlock("span",Pf,[r.createElementVNode("span",{ref_key:"el",ref:e},r.toDisplayString(n.value),513)])):(r.openBlock(),r.createElementBlock("span",Bf,r.toDisplayString(n.value),1))}},Mf={class:"my-2"},Vf={class:"flex flex-col md:flex-row md:justify-between md:items-center"},Af={class:"flex flex-row gap-2"},ao={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(n){const e=Ze(),t=n;console.log("columnsToShow",t.columnsToShow);const i=Je.useRoute(),s=r.ref(t.entityName||i.params.entityName),o=r.ref({}),a=r.ref(""),l=r.ref(!1),c=r.ref(!1),{items:d,headers:u,first:f,totalRecords:h,pageSize:m,loading:p,sortBy:g,sortDirection:y,operatorMap:b,filterToSend:_,primarayKeyColumn:w,fullTextSearch:E,listingResponse:k,onFullTextSearch:C,getDatatypeByField:S,getColumnDatatype:x,onSort:v,onPage:B,onFilter:D,fetchEntityFilterData:T,fetchEntityByName:I}=Xd(s.value),q=r.ref();let L=r.ref(!1);const A=Q=>{o.value=Q.reduce((Y,te)=>{if(!te.filterable)return Y;let ce=vn.CONTAINS;switch(te.datatype.toLowerCase()){case"string":case"uuid":ce=vn.STARTS_WITH;break;case"date":ce=vn.DATE_IS;break;case"numeric":case"int":case"integer":ce=vn.EQUALS;break;case"bool":case"boolean":ce=vn.EQUALS;break}return te.datatype=="bool"||te.datatype=="boolean"?Y[te.field]={value:null,matchMode:vn.EQUALS}:Y[te.field]={operator:Tf.AND,constraints:[{value:null,matchMode:ce}]},Y},{})},j=()=>{A(u.value),_.value=ne(o.value),D()},$=Q=>{_.value=ne(o.value),D()},P=Q=>{Q?a.value=Q[w.value.name]:a.value="",l.value=!l.value},R=()=>{l.value=!1,T(!1)},G=Q=>{a.value=Q[w.value.name],c.value=!0},se=()=>{c.value=!1,T(!1)},ne=Q=>Object.keys(Q).map(Y=>{const te=Q[Y];return te.constraints?te.constraints.filter(ce=>ce.value!==null&&ce.value!=="").map(ce=>({columnName:Y,operator:b[ce.matchMode]??ce.matchMode,value:ce.value,columnType:S(Y)})):te.value!==null&&te.value!==""?{columnName:Y,operator:b[te.matchMode]??te.matchMode,value:te.value,columnType:S(Y)}:[]}).flat();return r.watch(()=>e.globalConfigs.appId,async Q=>{Q&&I(s.value)},{immediate:!0}),r.watch(()=>u.value,Q=>{!L.value&&Q&&Q.length&&(A(Q),L.value=!0)},{immediate:!0}),(Q,Y)=>{const te=r.resolveComponent("Button"),ce=r.resolveComponent("Toolbar"),_e=r.resolveComponent("ProgressSpinner"),Qe=r.resolveComponent("InputIcon"),ze=r.resolveComponent("IconField"),ft=r.resolveComponent("DatePicker"),it=r.resolveComponent("InputNumber"),H=r.resolveComponent("Checkbox"),F=r.resolveComponent("Column"),ue=r.resolveComponent("DataTable");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(Q.$attrs)),[r.renderSlot(Q.$slots,"header"),n.showClearFilters||n.showAddButton?(r.openBlock(),r.createBlock(ce,{key:0,class:"mb-4 mt-4"},r.createSlots({_:2},[n.showClearFilters?{name:"start",fn:r.withCtx(()=>[r.createElementVNode("div",Mf,[r.createVNode(te,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:Y[0]||(Y[0]=he=>j())})])]),key:"0"}:void 0,n.showAddButton?{name:"end",fn:r.withCtx(()=>[r.createVNode(te,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:Y[1]||(Y[1]=he=>P())})]),key:"1"}:void 0]),1024)):r.createCommentVNode("",!0),r.createVNode(ue,{lazy:"",value:r.unref(d),loading:r.unref(p),ref_key:"dt",ref:q,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:n.showPagination,rows:r.unref(m),rowsPerPageOptions:[10,25,50,100],totalRecords:r.unref(h),first:r.unref(f),sortField:r.unref(g),sortOrder:r.unref(y),filters:o.value,"onUpdate:filters":Y[5]||(Y[5]=he=>o.value=he),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:r.unref(v),onPage:r.unref(B),onFilter:Y[6]||(Y[6]=he=>$()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:r.withCtx(()=>Y[9]||(Y[9]=[r.createTextVNode(" No data found. ")])),loading:r.withCtx(()=>[r.createVNode(_e)]),header:r.withCtx(()=>[r.createElementVNode("div",Vf,[r.createVNode(ze,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(Qe,{class:"pi pi-search",onClick:Y[2]||(Y[2]=he=>r.unref(C)())}),r.createVNode(r.unref(cr.InputText),{class:"w-full sm:w-auto",onKeyup:Y[3]||(Y[3]=r.withKeys(he=>r.unref(C)(),["enter"])),modelValue:r.unref(E),"onUpdate:modelValue":Y[4]||(Y[4]=he=>r.isRef(E)?E.value=he:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:r.withCtx(()=>{var he;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).filter(fe=>!t.columnsToShow||t.columnsToShow.length===0||t.columnsToShow.includes(fe.field)),fe=>(r.openBlock(),r.createBlock(F,{key:fe.field,dataType:r.unref(x)(fe.datatype),field:fe.field,header:fe.name,sortable:fe.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},r.createSlots({body:r.withCtx(({data:me})=>[r.createVNode(ro,{column:fe,value:me[fe.field]},null,8,["column","value"])]),_:2},[fe.datatype.toLowerCase()==="date"&&fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(ft,{modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:fe.datatype.toLowerCase()==="int"&&fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(it,{modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:fe.datatype.toLowerCase()==="boolean"&&fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(H,{modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,indeterminate:me.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:fe.filterable?{name:"filter",fn:r.withCtx(({filterModel:me})=>[r.createVNode(r.unref(cr.InputText),{style:{width:"150px"},type:"text",modelValue:me.value,"onUpdate:modelValue":De=>me.value=De,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((he=r.unref(d))==null?void 0:he.length)>0&&(n.editable||n.deleteable)?(r.openBlock(),r.createBlock(F,{key:0,header:"Actions"},{body:r.withCtx(({data:fe})=>[r.createElementVNode("div",Af,[n.editable?(r.openBlock(),r.createBlock(te,{key:0,onClick:me=>P(fe),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):r.createCommentVNode("",!0),n.deleteable?(r.openBlock(),r.createBlock(te,{key:1,onClick:me=>G(fe),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),r.renderSlot(Q.$slots,"footer")],16),l.value?(r.openBlock(),r.createBlock(Df,{key:0,showForm:l.value,"onUpdate:showForm":Y[7]||(Y[7]=he=>l.value=he),entityName:r.unref(k).entityName,recordId:a.value,onOnSaveDialog:R},null,8,["showForm","entityName","recordId"])):r.createCommentVNode("",!0),c.value?(r.openBlock(),r.createBlock(Nf,{key:1,showDeleteDialog:c.value,"onUpdate:showDeleteDialog":Y[8]||(Y[8]=he=>c.value=he),entityName:r.unref(k).entityName,recordId:a.value,onOnDeleteItem:se},null,8,["showDeleteDialog","entityName","recordId"])):r.createCommentVNode("",!0)],64)}}};function Ff(){const n=new Map;return{on(e,t){let i=n.get(e);return i?i.push(t):i=[t],n.set(e,i),this},off(e,t){let i=n.get(e);return i&&i.splice(i.indexOf(t)>>>0,1),this},emit(e,t){let i=n.get(e);i&&i.slice().map(s=>{s(t)})},clear(){n.clear()}}}var $f=Object.defineProperty,If=Object.defineProperties,Lf=Object.getOwnPropertyDescriptors,es=Object.getOwnPropertySymbols,na=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,sa=(n,e,t)=>e in n?$f(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,at=(n,e)=>{for(var t in e||(e={}))na.call(e,t)&&sa(n,t,e[t]);if(es)for(var t of es(e))ia.call(e,t)&&sa(n,t,e[t]);return n},lo=(n,e)=>If(n,Lf(e)),Dt=(n,e)=>{var t={};for(var i in n)na.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&es)for(var i of es(n))e.indexOf(i)<0&&ia.call(n,i)&&(t[i]=n[i]);return t},Rf=Ff(),jt=Rf;function oa(n,e){oo(n)?n.push(...e||[]):Cn(n)&&Object.assign(n,e)}function jf(n){return Cn(n)&&n.hasOwnProperty("value")&&n.hasOwnProperty("type")?n.value:n}function zf(n){return n.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function co(n="",e=""){return zf(`${gt(n,!1)&>(e,!1)?`${n}-`:n}${e}`)}function ra(n="",e=""){return`--${co(n,e)}`}function Wf(n=""){const e=(n.match(/{/g)||[]).length,t=(n.match(/}/g)||[]).length;return(e+t)%2!==0}function aa(n,e="",t="",i=[],s){if(gt(n)){const o=/{([^}]*)}/g,a=n.trim();if(Wf(a))return;if(vt(a,o)){const l=a.replaceAll(o,u=>{const h=u.replace(/{|}/g,"").split(".").filter(m=>!i.some(p=>vt(m,p)));return`var(${ra(t,ea(h.join("-")))}${Ee(s)?`, ${s}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return vt(l.replace(d,"0"),c)?`calc(${l})`:l}return a}else if(Of(n))return n}function Hf(n,e,t){gt(e,!1)&&n.push(`${e}:${t};`)}function Dn(n,e){return n?`${n}{${e}}`:""}var Hn=(...n)=>Uf(Me.getTheme(),...n),Uf=(n={},e,t,i)=>{if(e){const{variable:s,options:o}=Me.defaults||{},{prefix:a,transform:l}=(n==null?void 0:n.options)||o||{},d=vt(e,/{([^}]*)}/g)?e:`{${e}}`;return i==="value"||so(i)&&l==="strict"?Me.getTokenValue(e):aa(d,void 0,a,[s.excludedKeyRegex],t)}return""};function qf(n,e={}){const t=Me.defaults.variable,{prefix:i=t.prefix,selector:s=t.selector,excludedKeyRegex:o=t.excludedKeyRegex}=e,a=(d,u="")=>Object.entries(d).reduce((f,[h,m])=>{const p=vt(h,o)?co(u):co(u,ea(h)),g=jf(m);if(Cn(g)){const{variables:y,tokens:b}=a(g,p);oa(f.tokens,b),oa(f.variables,y)}else f.tokens.push((i?p.replace(`${i}-`,""):p).replaceAll("-",".")),Hf(f.variables,ra(p),aa(g,p,i,[o]));return f},{variables:[],tokens:[]}),{variables:l,tokens:c}=a(n,i);return{value:l,tokens:c,declarations:l.join(""),css:Dn(s,l.join(""))}}var lt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(n){return{type:"class",selector:n,matched:this.pattern.test(n.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(n){return{type:"attr",selector:`:root${n}`,matched:this.pattern.test(n.trim())}}},media:{pattern:/^@media (.*)$/,resolve(n){return{type:"media",selector:`${n}{:root{[CSS]}}`,matched:this.pattern.test(n.trim())}}},system:{pattern:/^system$/,resolve(n){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(n.trim())}}},custom:{resolve(n){return{type:"custom",selector:n,matched:!0}}}},resolve(n){const e=Object.keys(this.rules).filter(t=>t!=="custom").map(t=>this.rules[t]);return[n].flat().map(t=>{var i;return(i=e.map(s=>s.resolve(t)).find(s=>s.matched))!=null?i:this.rules.custom.resolve(t)})}},_toVariables(n,e){return qf(n,{prefix:e==null?void 0:e.prefix})},getCommon({name:n="",theme:e={},params:t,set:i,defaults:s}){var o,a,l,c,d,u,f;const{preset:h,options:m}=e;let p,g,y,b,_,w,E;if(Ee(h)&&m.transform!=="strict"){const{primitive:k,semantic:C,extend:S}=h,x=C||{},{colorScheme:v}=x,B=Dt(x,["colorScheme"]),D=S||{},{colorScheme:T}=D,I=Dt(D,["colorScheme"]),q=v||{},{dark:L}=q,A=Dt(q,["dark"]),j=T||{},{dark:$}=j,P=Dt(j,["dark"]),R=Ee(k)?this._toVariables({primitive:k},m):{},G=Ee(B)?this._toVariables({semantic:B},m):{},se=Ee(A)?this._toVariables({light:A},m):{},ne=Ee(L)?this._toVariables({dark:L},m):{},Q=Ee(I)?this._toVariables({semantic:I},m):{},Y=Ee(P)?this._toVariables({light:P},m):{},te=Ee($)?this._toVariables({dark:$},m):{},[ce,_e]=[(o=R.declarations)!=null?o:"",R.tokens],[Qe,ze]=[(a=G.declarations)!=null?a:"",G.tokens||[]],[ft,it]=[(l=se.declarations)!=null?l:"",se.tokens||[]],[H,F]=[(c=ne.declarations)!=null?c:"",ne.tokens||[]],[ue,he]=[(d=Q.declarations)!=null?d:"",Q.tokens||[]],[fe,me]=[(u=Y.declarations)!=null?u:"",Y.tokens||[]],[De,Ye]=[(f=te.declarations)!=null?f:"",te.tokens||[]];p=this.transformCSS(n,ce,"light","variable",m,i,s),g=_e;const St=this.transformCSS(n,`${Qe}${ft}`,"light","variable",m,i,s),Ae=this.transformCSS(n,`${H}`,"dark","variable",m,i,s);y=`${St}${Ae}`,b=[...new Set([...ze,...it,...F])];const Ke=this.transformCSS(n,`${ue}${fe}color-scheme:light`,"light","variable",m,i,s),st=this.transformCSS(n,`${De}color-scheme:dark`,"dark","variable",m,i,s);_=`${Ke}${st}`,w=[...new Set([...he,...me,...Ye])],E=rt(h.css,{dt:Hn})}return{primitive:{css:p,tokens:g},semantic:{css:y,tokens:b},global:{css:_,tokens:w},style:E}},getPreset({name:n="",preset:e={},options:t,params:i,set:s,defaults:o,selector:a}){var l,c,d;let u,f,h;if(Ee(e)&&t.transform!=="strict"){const m=n.replace("-directive",""),p=e,{colorScheme:g,extend:y,css:b}=p,_=Dt(p,["colorScheme","extend","css"]),w=y||{},{colorScheme:E}=w,k=Dt(w,["colorScheme"]),C=g||{},{dark:S}=C,x=Dt(C,["dark"]),v=E||{},{dark:B}=v,D=Dt(v,["dark"]),T=Ee(_)?this._toVariables({[m]:at(at({},_),k)},t):{},I=Ee(x)?this._toVariables({[m]:at(at({},x),D)},t):{},q=Ee(S)?this._toVariables({[m]:at(at({},S),B)},t):{},[L,A]=[(l=T.declarations)!=null?l:"",T.tokens||[]],[j,$]=[(c=I.declarations)!=null?c:"",I.tokens||[]],[P,R]=[(d=q.declarations)!=null?d:"",q.tokens||[]],G=this.transformCSS(m,`${L}${j}`,"light","variable",t,s,o,a),se=this.transformCSS(m,P,"dark","variable",t,s,o,a);u=`${G}${se}`,f=[...new Set([...A,...$,...R])],h=rt(b,{dt:Hn})}return{css:u,tokens:f,style:h}},getPresetC({name:n="",theme:e={},params:t,set:i,defaults:s}){var o;const{preset:a,options:l}=e,c=(o=a==null?void 0:a.components)==null?void 0:o[n];return this.getPreset({name:n,preset:c,options:l,params:t,set:i,defaults:s})},getPresetD({name:n="",theme:e={},params:t,set:i,defaults:s}){var o;const a=n.replace("-directive",""),{preset:l,options:c}=e,d=(o=l==null?void 0:l.directives)==null?void 0:o[a];return this.getPreset({name:a,preset:d,options:c,params:t,set:i,defaults:s})},applyDarkColorScheme(n){return!(n.darkModeSelector==="none"||n.darkModeSelector===!1)},getColorSchemeOption(n,e){var t;return this.applyDarkColorScheme(n)?this.regex.resolve(n.darkModeSelector===!0?e.options.darkModeSelector:(t=n.darkModeSelector)!=null?t:e.options.darkModeSelector):[]},getLayerOrder(n,e={},t,i){const{cssLayer:s}=e;return s?`@layer ${rt(s.order||"primeui",t)}`:""},getCommonStyleSheet({name:n="",theme:e={},params:t,props:i={},set:s,defaults:o}){const a=this.getCommon({name:n,theme:e,params:t,set:s,defaults:o}),l=Object.entries(i).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(a||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const f=Wn(u==null?void 0:u.css),h=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${h}" ${l}>${f}</style>`)}return c},[]).join("")},getStyleSheet({name:n="",theme:e={},params:t,props:i={},set:s,defaults:o}){var a;const l={name:n,theme:e,params:t,set:s,defaults:o},c=(a=n.includes("-directive")?this.getPresetD(l):this.getPresetC(l))==null?void 0:a.css,d=Object.entries(i).reduce((u,[f,h])=>u.push(`${f}="${h}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${n}-variables" ${d}>${Wn(c)}</style>`:""},createTokens(n={},e,t="",i="",s={}){return Object.entries(n).forEach(([o,a])=>{const l=vt(o,e.variable.excludedKeyRegex)?t:t?`${t}.${ta(o)}`:ta(o),c=i?`${i}.${o}`:o;Cn(a)?this.createTokens(a,e,l,c,s):(s[l]||(s[l]={paths:[],computed(d,u={}){var f,h;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(h=this.paths.find(m=>m.scheme===d))==null?void 0:h.computed(d,u.binding):this.paths.map(m=>m.computed(m.scheme,u[m.scheme]))}}),s[l].paths.push({path:c,value:a,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const f=/{([^}]*)}/g;let h=a;if(u.name=this.path,u.binding||(u.binding={}),vt(a,f)){const p=a.trim().replaceAll(f,b=>{var _;const w=b.replace(/{|}/g,""),E=(_=s[w])==null?void 0:_.computed(d,u);return oo(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),g=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,y=/var\([^)]+\)/g;h=vt(p.replace(y,"0"),g)?`calc(${p})`:p}return so(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:h.includes("undefined")?void 0:h}}}))}),s},getTokenValue(n,e,t){var i;const o=(c=>c.split(".").filter(u=>!vt(u.toLowerCase(),t.variable.excludedKeyRegex)).join("."))(e),a=e.includes("colorScheme.light")?"light":e.includes("colorScheme.dark")?"dark":void 0,l=[(i=n[o])==null?void 0:i.computed(a)].flat().filter(c=>c);return l.length===1?l[0].value:l.reduce((c={},d)=>{const u=d,{colorScheme:f}=u,h=Dt(u,["colorScheme"]);return c[f]=h,c},void 0)},getSelectorRule(n,e,t,i){return t==="class"||t==="attr"?Dn(Ee(e)?`${n}${e},${n} ${e}`:n,i):Dn(n,Ee(e)?Dn(e,i):i)},transformCSS(n,e,t,i,s={},o,a,l){if(Ee(e)){const{cssLayer:c}=s;if(i!=="style"){const d=this.getColorSchemeOption(s,a);e=t==="dark"?d.reduce((u,{type:f,selector:h})=>(Ee(h)&&(u+=h.includes("[CSS]")?h.replace("[CSS]",e):this.getSelectorRule(h,l,f,e)),u),""):Dn(l??":root",e)}if(c){const d={name:"primeui",order:"primeui"};Cn(c)&&(d.name=rt(c.name,{name:n,type:i})),Ee(d.name)&&(e=Dn(`@layer ${d.name}`,e),o==null||o.layerNames(d.name))}return e}return""}},Me={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(n={}){const{theme:e}=n;e&&(this._theme=lo(at({},e),{options:at(at({},this.defaults.options),e.options)}),this._tokens=lt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var n;return((n=this.theme)==null?void 0:n.preset)||{}},get options(){var n;return((n=this.theme)==null?void 0:n.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(n){this.update({theme:n}),jt.emit("theme:change",n)},getPreset(){return this.preset},setPreset(n){this._theme=lo(at({},this.theme),{preset:n}),this._tokens=lt.createTokens(n,this.defaults),this.clearLoadedStyleNames(),jt.emit("preset:change",n),jt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(n){this._theme=lo(at({},this.theme),{options:n}),this.clearLoadedStyleNames(),jt.emit("options:change",n),jt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(n){this._layerNames.add(n)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(n){return this._loadedStyleNames.has(n)},setLoadedStyleName(n){this._loadedStyleNames.add(n)},deleteLoadedStyleName(n){this._loadedStyleNames.delete(n)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(n){return lt.getTokenValue(this.tokens,n,this.defaults)},getCommon(n="",e){return lt.getCommon({name:n,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(n="",e){const t={name:n,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return lt.getPresetC(t)},getDirective(n="",e){const t={name:n,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return lt.getPresetD(t)},getCustomPreset(n="",e,t,i){const s={name:n,preset:e,options:this.options,selector:t,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return lt.getPreset(s)},getLayerOrderCSS(n=""){return lt.getLayerOrder(n,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(n="",e,t="style",i){return lt.transformCSS(n,e,i,t,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(n="",e,t={}){return lt.getCommonStyleSheet({name:n,theme:this.theme,params:e,props:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(n,e,t={}){return lt.getStyleSheet({name:n,theme:this.theme,params:e,props:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(n){this._loadingStyles.add(n)},onStyleUpdated(n){this._loadingStyles.add(n)},onStyleLoaded(n,{name:e}){this._loadingStyles.size&&(this._loadingStyles.delete(e),jt.emit(`theme:${e}:load`,n),!this._loadingStyles.size&&jt.emit("theme:load"))}};function uo(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n!==null&&n.nodeType===1&&typeof n.nodeName=="string"}function fo(n,e={}){if(uo(n)){const t=(i,s)=>{var o,a;const l=(o=n==null?void 0:n.$attrs)!=null&&o[i]?[(a=n==null?void 0:n.$attrs)==null?void 0:a[i]]:[];return[s].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const f=Array.isArray(d)?t(i,d):Object.entries(d).map(([h,m])=>i==="style"&&(m||m===0)?`${h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${m}`:m?h:void 0);c=f.length?c.concat(f.filter(h=>!!h)):c}}return c},l)};Object.entries(e).forEach(([i,s])=>{if(s!=null){const o=i.match(/^on(.+)/);o?n.addEventListener(o[1].toLowerCase(),s):i==="p-bind"||i==="pBind"?fo(n,s):(s=i==="class"?[...new Set(t("class",s))].join(" ").trim():i==="style"?t("style",s).join(";").trim():s,(n.$attrs=n.$attrs||{})&&(n.$attrs[i]=s),n.setAttribute(i,s))}})}}function Yf(n,e){return uo(n)?n.matches(e)?n:n.querySelector(e):null}function Kf(n){if(n){let e=n.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function Xf(n){return!!(n!==null&&typeof n<"u"&&n.nodeName&&Kf(n))}function la(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Gf(n,e="",t){uo(n)&&t!==null&&t!==void 0&&n.setAttribute(e,t)}var ts={};function Qf(n="pui_id_"){return ts.hasOwnProperty(n)||(ts[n]=0),ts[n]++,`${n}${ts[n]}`}var Un={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function qn(n){"@babel/helpers - typeof";return qn=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},qn(n)}function ca(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function da(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ca(Object(t),!0).forEach(function(i){Jf(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ca(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Jf(n,e,t){return(e=Zf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zf(n){var e=eh(n,"string");return qn(e)=="symbol"?e:e+""}function eh(n,e){if(qn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(qn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function th(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r.getCurrentInstance()?r.onMounted(n):e?n():r.nextTick(n)}var nh=0;function ih(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.ref(!1),i=r.ref(n),s=r.ref(null),o=la()?window.document:void 0,a=e.document,l=a===void 0?o:a,c=e.immediate,d=c===void 0?!0:c,u=e.manual,f=u===void 0?!1:u,h=e.name,m=h===void 0?"style_".concat(++nh):h,p=e.id,g=p===void 0?void 0:p,y=e.media,b=y===void 0?void 0:y,_=e.nonce,w=_===void 0?void 0:_,E=e.first,k=E===void 0?!1:E,C=e.onMounted,S=C===void 0?void 0:C,x=e.onUpdated,v=x===void 0?void 0:x,B=e.onLoad,D=B===void 0?void 0:B,T=e.props,I=T===void 0?{}:T,q=function(){},L=function($){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l){var R=da(da({},I),P),G=R.name||m,se=R.id||g,ne=R.nonce||w;s.value=l.querySelector('style[data-primevue-style-id="'.concat(G,'"]'))||l.getElementById(se)||l.createElement("style"),s.value.isConnected||(i.value=$||n,fo(s.value,{type:"text/css",id:se,media:b,nonce:ne}),k?l.head.prepend(s.value):l.head.appendChild(s.value),Gf(s.value,"data-primevue-style-id",G),fo(s.value,R),s.value.onload=function(Q){return D==null?void 0:D(Q,{name:G})},S==null||S(G)),!t.value&&(q=r.watch(i,function(Q){s.value.textContent=Q,v==null||v(G)},{immediate:!0}),t.value=!0)}},A=function(){!l||!t.value||(q(),Xf(s.value)&&l.head.removeChild(s.value),t.value=!1)};return d&&!f&&th(L),{id:g,name:m,el:s,css:i,unload:A,load:L,isLoaded:r.readonly(t)}}function Yn(n){"@babel/helpers - typeof";return Yn=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},Yn(n)}function ua(n,e){return ah(n)||rh(n,e)||oh(n,e)||sh()}function sh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
11
|
+
attempted value: ${r}
|
|
12
|
+
`+(l!==r?`result of cast: ${l}`:""))}return o}_cast(e,n){let i=e===void 0?e:this.transforms.reduce((s,o)=>o.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(n)),i}_validate(e,n={},i,s){let{path:o,originalValue:r=e,strict:l=this.spec.strict}=n,c=e;l||(c=this._cast(c,Object.assign({assert:!1},n)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:c,originalValue:r,options:n,tests:d},i,u=>{if(u.length)return s(u,c);this.runTests({path:o,value:c,originalValue:r,options:n,tests:this.tests},i,s)})}runTests(e,n,i){let s=!1,{tests:o,value:r,originalValue:l,path:c,options:d}=e,u=g=>{s||(s=!0,n(g,r))},f=g=>{s||(s=!0,i(g,r))},h=o.length,m=[];if(!h)return f([]);let p={value:r,originalValue:l,path:c,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(p,u,function(x){x&&(Array.isArray(x)?m.push(...x):m.push(x)),--h<=0&&f(m)})}}asNestedTest({key:e,index:n,parent:i,parentPath:s,originalParent:o,options:r}){const l=e??n;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=i[l];const u=Object.assign({},r,{strict:!0,parent:i,value:d,originalValue:o[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${s||""}[${c?l:`"${l}"`}]`:(s?`${s}.`:"")+e});return(f,h,m)=>this.resolve(u)._validate(d,u,h,m)}validate(e,n){var i;let s=this.resolve(Object.assign({},n,{value:e})),o=(i=n==null?void 0:n.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((r,l)=>s._validate(e,n,(c,d)=>{Ke.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new Ke(c,d,void 0,void 0,o)):r(d)}))}validateSync(e,n){var i;let s=this.resolve(Object.assign({},n,{value:e})),o,r=(i=n==null?void 0:n.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},n,{sync:!0}),(l,c)=>{throw Ke.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new Ke(l,e,void 0,void 0,r);o=c}),o}isValid(e,n){return this.validate(e,n).then(()=>!0,i=>{if(Ke.isError(i))return!1;throw i})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(i){if(Ke.isError(i))return!1;throw i}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):Vn(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const i=this.clone({nullable:e});return i.internalTests.nullable=Mn({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,n){const i=this.clone({optional:e});return i.internalTests.optionality=Mn({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=St.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=St.notNull){return this.nullability(!1,e)}required(e=St.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=St.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=Mn(n),o=n.exclusive||n.name&&i.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(i.exclusiveTests[n.name]=!!n.exclusive),i.tests=i.tests.filter(r=>!(r.OPTIONS.name===n.name&&(o||r.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let i=this.clone(),s=va(e).map(o=>new mn(o));return s.forEach(o=>{o.isSibling&&i.deps.push(o.key)}),i.conditions.push(typeof n=="function"?new fs(s,n):fs.fromOptions(s,n)),i}typeError(e){let n=this.clone();return n.internalTests.typeError=Mn({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=St.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=Mn({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,r=o.resolveAll(this.resolve);return r.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:r}})}}),i}notOneOf(e,n=St.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=Mn({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,r=o.resolveAll(this.resolve);return r.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:r}}):!0}}),i}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:o,nullable:r}=n.spec;return{meta:s,label:i,optional:o,nullable:r,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,u)=>u.findIndex(f=>f.name===c.name)===d)}}}wt.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])wt.prototype[`${t}At`]=function(e,n,i={}){const{parent:s,parentPath:o,schema:r}=Oh(this,e,n,i.context);return r[t](s&&s[o],Object.assign({},i,{parent:s,path:e}))};for(const t of["equals","is"])wt.prototype[t]=wt.prototype.oneOf;for(const t of["not","nope"])wt.prototype[t]=wt.prototype.notOneOf;const vh=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Nh(t){const e=Do(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function Do(t){var e,n;const i=vh.exec(t);return i?{year:Mt(i[1]),month:Mt(i[2],1)-1,day:Mt(i[3],1),hour:Mt(i[4]),minute:Mt(i[5]),second:Mt(i[6]),millisecond:i[7]?Mt(i[7].substring(0,3)):0,precision:(e=(n=i[7])==null?void 0:n.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Mt(i[10]),minuteOffset:Mt(i[11])}:null}function Mt(t,e=0){return Number(t)||e}let Dh=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Th=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Bh=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ph="^\\d{4}-\\d{2}-\\d{2}",Ah="\\d{2}:\\d{2}:\\d{2}",Mh="(([+-]\\d{2}(:?\\d{2})?)|Z)",Vh=new RegExp(`${Ph}T${Ah}(\\.\\d+)?${Mh}$`),Rh=t=>pn(t)||t===t.trim(),Fh={}.toString();function To(){return new Pa}class Pa extends wt{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===Fh?e:s})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||St.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=Xe.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n=Xe.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n=Xe.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,n){let i=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:i=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||Xe.matches,params:{regex:e},skipAbsent:!0,test:r=>r===""&&i||r.search(e)!==-1})}email(e=Xe.email){return this.matches(Dh,{name:"email",message:e,excludeEmptyString:!0})}url(e=Xe.url){return this.matches(Th,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Xe.uuid){return this.matches(Bh,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",i,s;return e&&(typeof e=="object"?{message:n="",allowOffset:i=!1,precision:s=void 0}=e:n=e),this.matches(Vh,{name:"datetime",message:n||Xe.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Xe.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:o=>{if(!o||i)return!0;const r=Do(o);return r?!!r.z:!1}}).test({name:"datetime_precision",message:n||Xe.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const r=Do(o);return r?r.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Xe.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Rh})}lowercase(e=Xe.lowercase){return this.transform(n=>pn(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>pn(n)||n===n.toLowerCase()})}uppercase(e=Xe.uppercase){return this.transform(n=>pn(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>pn(n)||n===n.toUpperCase()})}}To.prototype=Pa.prototype;let $h=new Date(""),Lh=t=>Object.prototype.toString.call(t)==="[object Date]";class ps extends wt{constructor(){super({type:"date",check(e){return Lh(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=Nh(e),isNaN(e)?ps.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let i;if(mn.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,n=vo.min){let i=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,n=vo.max){let i=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}ps.INVALID_DATE=$h,ps.prototype;function Ih(t,e=[]){let n=[],i=new Set,s=new Set(e.map(([r,l])=>`${r}-${l}`));function o(r,l){let c=hn.split(r)[0];i.add(c),s.has(`${l}-${c}`)||n.push([l,c])}for(const r of Object.keys(t)){let l=t[r];i.add(r),mn.isRef(l)&&l.isSibling?o(l.path,r):No(l)&&"deps"in l&&l.deps.forEach(c=>o(c,r))}return gh.array(Array.from(i),n).reverse()}function Aa(t,e){let n=1/0;return t.some((i,s)=>{var o;if((o=e.path)!=null&&o.includes(i))return n=s,!0}),n}function Ma(t){return(e,n)=>Aa(t,e)-Aa(t,n)}const jh=(t,e,n)=>{if(typeof t!="string")return t;let i=t;try{i=JSON.parse(t)}catch{}return n.isType(i)?i:t};function gs(t){if("fields"in t){const e={};for(const[n,i]of Object.entries(t.fields))e[n]=gs(i);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=gs(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(gs)}):"optional"in t?t.optional():t}const zh=(t,e)=>{const n=[...hn.normalizePath(e)];if(n.length===1)return n[0]in t;let i=n.pop(),s=hn.getter(hn.join(n),!0)(t);return!!(s&&i in s)};let Va=t=>Object.prototype.toString.call(t)==="[object Object]";function Ra(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(i=>n.indexOf(i)===-1)}const Uh=Ma([]);function Bo(t){return new Fa(t)}class Fa extends wt{constructor(e){super({type:"object",check(n){return Va(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Uh,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var i;let s=super._cast(e,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,r=(i=n.stripUnknown)!=null?i:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(s).filter(f=>!this._nodes.includes(f))),c={},d=Object.assign({},n,{parent:c,__validating:n.__validating||!1}),u=!1;for(const f of l){let h=o[f],m=f in s;if(h){let p,g=s[f];d.path=(n.path?`${n.path}.`:"")+f,h=h.resolve({value:g,context:n.context,parent:c});let y=h instanceof wt?h.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||f in s;continue}p=!n.__validating||!b?h.cast(s[f],d):s[f],p!==void 0&&(c[f]=p)}else m&&!r&&(c[f]=s[f]);(m!==f in c||c[f]!==s[f])&&(u=!0)}return u?c:s}_validate(e,n={},i,s){let{from:o=[],originalValue:r=e,recursive:l=this.spec.recursive}=n;n.from=[{schema:this,value:r},...o],n.__validating=!0,n.originalValue=r,super._validate(e,n,i,(c,d)=>{if(!l||!Va(d)){s(c,d);return}r=r||d;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||mn.isRef(h)||u.push(h.asNestedTest({options:n,key:f,parent:d,parentPath:n.path,originalParent:r}))}this.runTests({tests:u,value:d,originalValue:r,options:n},i,f=>{s(f.sort(this._sortErrors).concat(c),d)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),i=n.fields;for(let[s,o]of Object.entries(this.fields)){const r=i[s];i[s]=r===void 0?o:r}return n.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(i=>{var s;const o=this.fields[i];let r=e;(s=r)!=null&&s.value&&(r=Object.assign({},r,{parent:r.value,value:r.value[i]})),n[i]=o&&"getDefault"in o?o.getDefault(r):void 0}),n}setFields(e,n){let i=this.clone();return i.fields=e,i._nodes=Ih(e,n),i._sortErrors=Ma(Object.keys(e)),n&&(i._excludedEdges=n),i}shape(e,n=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...i._excludedEdges,...n]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[n,i]of Object.entries(this.fields))e[n]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return gs(this)}pick(e){const n={};for(const i of e)this.fields[i]&&(n[i]=this.fields[i]);return this.setFields(n,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const n=[];for(const i of Object.keys(this.fields))e.includes(i)||n.push(i);return this.pick(n)}from(e,n,i){let s=hn.getter(e,!0);return this.transform(o=>{if(!o)return o;let r=o;return zh(o,e)&&(r=Object.assign({},o),i||delete r[e],r[n]=s(o)),r})}json(){return this.transform(jh)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||us.exact,test(n){if(n==null)return!0;const i=Ra(this.schema,n);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=us.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=Ra(this.schema,s);return!e||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,n=us.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const i={};for(const s of Object.keys(n))i[e(s)]=n[s];return i})}camelCase(){return this.transformKeys(Oo.camelCase)}snakeCase(){return this.transformKeys(Oo.snakeCase)}constantCase(){return this.transformKeys(e=>Oo.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[o,r]of Object.entries(n.fields)){var s;let l=e;(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),i.fields[o]=r.describe(l)}return i}}Bo.prototype=Fa.prototype;function Po(t,e,n){const i=new kt;let s=a.ref({});const o=a.ref({}),r=a.ref({});let l=a.ref([]);const c=a.ref(null),d=a.ref([]);let u=a.ref([]),f=a.ref(!1);const h=a.ref({});let{handleSubmit:m,errors:p,setErrors:g}=Sa();const y=async()=>{var $;try{const A=await i.getEntityRecords(t);A&&A.response&&(s.value=A.response,l.value=($=A.response.entity.entityDefinition)==null?void 0:$.columns,j(),S(),v())}catch(A){toast.add({severity:"error",summary:"Error",detail:A.errorMessage,life:3e3})}finally{}},b=async()=>{var $;try{const A=await i.getRecord(t,e);A&&A.response&&(s.value=A.response,l.value=($=A.response.entity.entityDefinition)==null?void 0:$.columns,j(),o.value=JSON.parse(JSON.stringify(A.response.result[0])),v())}catch(A){console.error("Error fetching entity:",A.errorMessage)}finally{}},x=async()=>{var $,A;try{const I=await i.getRelatedEntityRecord(t,e);I&&I.response&&(s.value=I.response,l.value=(A=($=I.response.entity)==null?void 0:$.entityDefinition)==null?void 0:A.columns,j(),o.value=JSON.parse(JSON.stringify(I.response.result[0])),o.value.entityName&&delete o.value.entityName,o.value.linkedEntities&&delete o.value.linkedEntities,u.value=I.response.result[0].linkedEntities,r.value=JSON.parse(JSON.stringify(o.value)),v())}catch(I){console.error("Error fetching entity:",I.errorMessage)}finally{}},w=async $=>{try{let A=await i.addRecord(t,$);A&&A.response&&n("onSaveDialog",{entityName:t,recordId:e})}catch(A){A.validationErrors&&(d.value=JSON.parse(JSON.stringify(A.validationErrors))),console.error("Error fetching entity:",A.errorMessage)}finally{}},E=async($,A)=>{try{let I=await i.addRecord(t,A);if(I&&I.response){let Q=await i.saveRelatedEntityRecord(t,I.response.recordId,$.linkedEntities);Q&&Q.response&&n("onSaveDialog",{entityName:t,recordId:e})}}catch(I){I.validationErrors&&(d.value=JSON.parse(JSON.stringify(I.validationErrors))),console.error("Error fetching entity:",I.errorMessage)}finally{}},k=async $=>{try{const A=await i.updateRecord(t,e,$);A&&A.response&&(f.value=!1,r.value=JSON.parse(JSON.stringify(o.value)),n("onSaveDialog",{entityName:t,recordId:e}))}catch(A){A.validationErrors&&(d.value=JSON.parse(JSON.stringify(A.errvalidationErrorsors))),console.error("Error fetching entity:",A.errorMessage)}finally{}},C=async($,A,I)=>{try{let Q=await i.saveRelatedEntityRecord($,A,I);Q&&Q.response&&n("onSaveDialog",{entityName:t,enityRecordId:A})}catch(Q){Q.validationErrors&&(d.value=JSON.parse(JSON.stringify(Q.validationErrors))),console.error("Error fetching entity:",Q.errorMessage)}finally{}},S=()=>{for(let $=0;$<l.value.length;$++){let A=l.value[$];A.autoGenerated||(o.value[A.name]="")}},_=$=>{let A="";for(let I=0;I<l.value.length;I++){let Q=l.value[I];if($==Q.name){A=Q.type;break}}return A},O=()=>{const $=l.value.filter(I=>I.autoGenerated).map(I=>I.name);return Object.entries(o.value).filter(([I])=>!$.includes(I)).map(([I,Q])=>({recordColumnName:I,recordColumnValue:Q,columnType:_(I)}))},P=async($={})=>{try{await c.value.validate(o.value,{abortEarly:!1}),g({})}catch(I){const Q=I.inner.reduce((se,K)=>(se[K.path]||(se[K.path]={messages:[]}),se[K.path].messages.push(...K.errors),se),{}),ne=Object.entries(Q).reduce((se,[K,J])=>(se[K]={messages:J.messages},se),{});g(ne);return}const A={dataDefinitions:O()};e?await k(A):$.relationType=="MANY_TO_ONE"?await E($,A):await w(A)},v=()=>{c.value=Bo().shape(l.value.reduce(($,A)=>(A.autoGenerated||($[A.name]=To().nullable(!1).test({name:"custom-validation",test:function(I){const Q=[];let ne="";if(A.required&&(!I||I.trim()===""))if(A.validations){ne=T(A.validations,"VALIDATE_REQUIRED"),Q.push(ne);let se=U(A.validations,"VALIDATE_REQUIRED");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" is required.",Q.push(ne);else{if(A.maxLength&&I.length>A.maxLength)if(A.validations){ne=T(A.validations,"VALIDATE_MAXLENGTH"),Q.push(ne);let se=U(A.validations,"VALIDATE_MAXLENGTH");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" cannot exceed from "+A.maxLength+" characters",Q.push(ne);if(A.regxId&&!new RegExp(R(A.validations,"VALIDATE_REGX")).test(I))if(A.validations){ne=T(A.validations,"VALIDATE_REGX"),Q.push(ne);let se=U(A.validations,"VALIDATE_REGX");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" invalid format.",Q.push(ne)}return Q.length>0?this.createError({message:Q}):!0}})),$),{}))},T=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].message},R=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].regx},U=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].hint},Y=$=>{g({...p.value,[$]:null}),f.value=!0},L=()=>{f.value=!1;for(let $ in o.value)o.value.hasOwnProperty($)&&g({...p.value,[$]:null});o.value=JSON.parse(JSON.stringify(r.value))},j=()=>{for(let $=0;$<l.value.length;$++){const A=l.value[$];if(A.primaryKey&&A.primaryKey==!0){h.value=A;break}}};return{formData:o,columns:l,errors:p,backendErrors:d,isDataChange:f,linkedEntities:u,primarayKeyColumn:h,clearErrors:Y,saveRecord:P,fetchAllRecords:y,fetchRecord:b,getRelatedEntityRecordById:x,cancleRecord:L,saveRelatedEntityRecord:C}}const Wh={key:0,class:"surface-card"},Hh={class:"info"},qh={key:0,class:"list-none p-0"},$a={__name:"EntityFormErrors",props:{errors:Array},setup(t){let e=a.ref(!0);const n=()=>{e.value=!e.value};return(i,s)=>{var r;const o=a.resolveComponent("Message");return((r=t.errors)==null?void 0:r.length)>0?(a.openBlock(),a.createElementBlock("div",Wh,[s[1]||(s[1]=a.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),a.createElementVNode("div",Hh,[a.createElementVNode("span",{onClick:s[0]||(s[0]=l=>n()),class:"cursor-pointer underline showHideColor"},a.toDisplayString(a.unref(e)?"Hide":"Show"),1)]),a.unref(e)?(a.openBlock(),a.createElementBlock("ul",qh,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.errors,(l,c)=>(a.openBlock(),a.createElementBlock("li",{key:c,class:"mb-2"},[a.createVNode(o,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.message),1)]),_:2},1024)]))),128))])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)}}},Yh={class:"field flex flex-col mb-3"},Kh=["for"],Xh={key:0,class:"flex items-center"},Gh={key:1},Jh={class:"flex items-center"},La={__name:"RelatedEntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=new kt,s=a.ref({});let o=a.ref("");const r=e;a.onMounted(()=>{l()});const l=async()=>{try{const u=await i.getEntityRecords(n.entityName);u&&u.response&&(s.value=u.response,d())}catch{}finally{}},c=()=>{r("update:modelValue",o.value[n.relatedEntityColumn])},d=()=>{for(let u=0;u<s.value.result.length;u++){const f=s.value.result[u];if(f[n.relatedEntityColumn]==n.modelValue){o.value=f;break}}};return(u,f)=>{const h=a.resolveComponent("Select");return a.openBlock(),a.createElementBlock("div",Yh,[a.createElementVNode("label",{for:t.columnName},a.toDisplayString(t.columnName),9,Kh),a.createVNode(h,{modelValue:a.unref(o),"onUpdate:modelValue":[f[0]||(f[0]=m=>a.isRef(o)?o.value=m:o=m),c],"item-value":t.relatedEntityColumn,options:s.value.result,filter:"",optionLabel:t.relatedEntityColumn,placeholder:"Select "+t.relatedEntityColumn,class:"w-full"},{value:a.withCtx(m=>[m.value?(a.openBlock(),a.createElementBlock("div",Xh,[a.createElementVNode("div",null,a.toDisplayString(m.value[t.relatedEntityColumn]),1)])):(a.openBlock(),a.createElementBlock("span",Gh,a.toDisplayString(m.placeholder),1))]),option:a.withCtx(m=>[a.createElementVNode("div",Jh,[a.createElementVNode("div",null,a.toDisplayString(m.option[t.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},Qh={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Zh={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},em={__name:"EntityDialog",props:a.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:a.mergeModels(["onSaveDialog"],["update:showForm"]),setup(t,{emit:e}){const n=a.useModel(t,"showForm"),i=e,{formData:s,columns:o,errors:r,backendErrors:l,clearErrors:c,saveRecord:d,fetchAllRecords:u,fetchRecord:f}=Po(t.entityName,t.recordId,i);return a.onMounted(()=>{t.recordId?f():u()}),(h,m)=>{const p=a.resolveComponent("Button"),g=a.resolveComponent("Dialog");return n.value?(a.openBlock(),a.createBlock(g,{key:0,showFooter:!1,visible:n.value,"onUpdate:visible":m[2]||(m[2]=y=>n.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:a.withCtx(()=>[t.recordId?(a.openBlock(),a.createElementBlock("span",Qh,"Edit "+a.toDisplayString(t.entityName)+" record details",1)):a.createCommentVNode("",!0),t.recordId?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",Zh,"Add "+a.toDisplayString(t.entityName)+" record details",1))]),footer:a.withCtx(()=>[a.createVNode(p,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:m[0]||(m[0]=y=>n.value=!1)}),a.createVNode(p,{type:"button",icon:"",label:"Save",severity:"success",onClick:m[1]||(m[1]=y=>a.unref(d)())})]),default:a.withCtx(()=>{var y;return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(o),(b,x)=>{var w;return a.openBlock(),a.createElementBlock("div",{key:x},[!b.autoGenerated&&!b.foreignKey?(a.openBlock(),a.createBlock(os,{key:0,modelValue:a.unref(s)[b.name],"onUpdate:modelValue":E=>a.unref(s)[b.name]=E,column:b,errors:(w=a.unref(r)[b.name])==null?void 0:w.messages,onInput:a.unref(c)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):a.createCommentVNode("",!0),!b.autoGenerated&&b.foreignKey?(a.openBlock(),a.createBlock(La,{key:1,modelValue:a.unref(s)[b.name],"onUpdate:modelValue":E=>a.unref(s)[b.name]=E,entityName:b.foreignKey.referencedEntityName,columnName:b.name,relatedEntityColumn:b.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):a.createCommentVNode("",!0)])}),128)),((y=a.unref(l))==null?void 0:y.length)>0?(a.openBlock(),a.createBlock($a,{key:0,errors:a.unref(l)},null,8,["errors"])):a.createCommentVNode("",!0)]}),_:1},8,["visible"])):a.createCommentVNode("",!0)}}},tm={__name:"DeleteConfirmationDialog",props:a.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:a.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(t,{emit:e}){const n=new kt,i=a.useModel(t,"showDeleteDialog"),s=e,o=async()=>{try{const r=await n.deleteRecord(t.entityName,t.recordId);r&&r.response&&s("onDeleteItem")}catch(r){console.error("Error deleting record:",r.errorMessage)}finally{}};return(r,l)=>{const c=a.resolveComponent("Button"),d=a.resolveComponent("Dialog");return a.openBlock(),a.createBlock(d,{visible:i.value,"onUpdate:visible":l[1]||(l[1]=u=>i.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:a.withCtx(()=>[a.createVNode(c,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=u=>i.value=!1)}),a.createVNode(c,{label:"Yes",icon:"pi pi-check",text:"",onClick:o})]),default:a.withCtx(()=>[l[2]||(l[2]=a.createElementVNode("div",{class:"flex items-center justify-center"},[a.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),a.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};function Ao(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&typeof t=="object"&&Object.keys(t).length===0}function Ia(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Ce(t){return!Ao(t)}function Rn(t,e=!0){return t instanceof Object&&t.constructor===Object&&(e||Object.keys(t).length!==0)}function ft(t,...e){return Ia(t)?t(...e):t}function Et(t,e=!0){return typeof t=="string"&&(e||t!=="")}function Xt(t){return Et(t)?t.replace(/(-|_)/g,"").toLowerCase():t}function ja(t,e="",n={}){const i=Xt(e).split("."),s=i.shift();return s?Rn(t)?ja(ft(t[Object.keys(t).find(o=>Xt(o)===s)||""],n),i.join("."),n):void 0:ft(t,n)}function Mo(t,e=!0){return Array.isArray(t)&&(e||t.length!==0)}function nm(t){return Ce(t)&&!isNaN(t)}function Vt(t,e){if(e){const n=e.test(t);return e.lastIndex=0,n}return!1}function ni(t){return t&&t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function za(t){return Et(t)?t.replace(/(_)/g,"-").replace(/[A-Z]/g,(e,n)=>n===0?e:"-"+e.toLowerCase()).toLowerCase():t}function Ua(t){return Et(t)?t.replace(/[A-Z]/g,(e,n)=>n===0?e:"."+e.toLowerCase()).toLowerCase():t}var Fn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},im={AND:"and",OR:"or"};const sm={key:0},om={key:1},Vo={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(t){const e=a.ref(null),n=Object.assign({"/src/directives/dateFormat.js":()=>Promise.resolve().then(()=>lk),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>ck)});async function i(){await a.nextTick();const s=n[`/src/directives/${t.column.displayFormatKey}.js`];s&&e.value&&s().then(o=>{o.default.beforeMount(e.value,{value:t.value,arg:t.column.displayFormat})})}return a.onMounted(()=>{i()}),a.onUpdated(()=>{i()}),(s,o)=>t.column.displayFormatKey?(a.openBlock(),a.createElementBlock("span",sm,[a.createElementVNode("span",{ref_key:"el",ref:e},a.toDisplayString(t.value),513)])):(a.openBlock(),a.createElementBlock("span",om,a.toDisplayString(t.value),1))}},rm={class:"my-2"},am={class:"flex flex-col md:flex-row md:justify-between md:items-center"},lm={class:"flex flex-row gap-2"},Ro={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(t){const e=ot(),n=t;console.log("columnsToShow",n.columnsToShow);const i=Ye.useRoute(),s=a.ref(n.entityName||i.params.entityName),o=a.ref({}),r=a.ref(""),l=a.ref(!1),c=a.ref(!1),{items:d,headers:u,first:f,totalRecords:h,pageSize:m,loading:p,sortBy:g,sortDirection:y,operatorMap:b,filterToSend:x,primarayKeyColumn:w,fullTextSearch:E,listingResponse:k,onFullTextSearch:C,getDatatypeByField:S,getColumnDatatype:_,onSort:O,onPage:P,onFilter:v,fetchEntityFilterData:T,fetchEntityByName:R}=wf(s.value),U=a.ref();let Y=a.ref(!1);const L=K=>{o.value=K.reduce((J,oe)=>{if(!oe.filterable)return J;let ue=Fn.CONTAINS;switch(oe.datatype.toLowerCase()){case"string":case"uuid":ue=Fn.STARTS_WITH;break;case"date":ue=Fn.DATE_IS;break;case"numeric":case"int":case"integer":ue=Fn.EQUALS;break;case"bool":case"boolean":ue=Fn.EQUALS;break}return oe.datatype=="bool"||oe.datatype=="boolean"?J[oe.field]={value:null,matchMode:Fn.EQUALS}:J[oe.field]={operator:im.AND,constraints:[{value:null,matchMode:ue}]},J},{})},j=()=>{L(u.value),x.value=se(o.value),v()},$=K=>{x.value=se(o.value),v()},A=K=>{K?r.value=K[w.value.name]:r.value="",l.value=!l.value},I=()=>{l.value=!1,T(!1)},Q=K=>{r.value=K[w.value.name],c.value=!0},ne=()=>{c.value=!1,T(!1)},se=K=>Object.keys(K).map(J=>{const oe=K[J];return oe.constraints?oe.constraints.filter(ue=>ue.value!==null&&ue.value!=="").map(ue=>({columnName:J,operator:b[ue.matchMode]??ue.matchMode,value:ue.value,columnType:S(J)})):oe.value!==null&&oe.value!==""?{columnName:J,operator:b[oe.matchMode]??oe.matchMode,value:oe.value,columnType:S(J)}:[]}).flat();return a.watch(()=>e.globalConfigs.appId,async K=>{K&&R(s.value)},{immediate:!0}),a.watch(()=>u.value,K=>{!Y.value&&K&&K.length&&(L(K),Y.value=!0)},{immediate:!0}),(K,J)=>{const oe=a.resolveComponent("Button"),ue=a.resolveComponent("Toolbar"),ve=a.resolveComponent("ProgressSpinner"),st=a.resolveComponent("InputIcon"),qe=a.resolveComponent("IconField"),xt=a.resolveComponent("DatePicker"),ct=a.resolveComponent("InputNumber"),H=a.resolveComponent("Checkbox"),F=a.resolveComponent("Column"),he=a.resolveComponent("DataTable");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.normalizeProps(a.guardReactiveProps(K.$attrs)),[a.renderSlot(K.$slots,"header"),t.showClearFilters||t.showAddButton?(a.openBlock(),a.createBlock(ue,{key:0,class:"mb-4 mt-4"},a.createSlots({_:2},[t.showClearFilters?{name:"start",fn:a.withCtx(()=>[a.createElementVNode("div",rm,[a.createVNode(oe,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:J[0]||(J[0]=pe=>j())})])]),key:"0"}:void 0,t.showAddButton?{name:"end",fn:a.withCtx(()=>[a.createVNode(oe,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:J[1]||(J[1]=pe=>A())})]),key:"1"}:void 0]),1024)):a.createCommentVNode("",!0),a.createVNode(he,{lazy:"",value:a.unref(d),loading:a.unref(p),ref_key:"dt",ref:U,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:t.showPagination,rows:a.unref(m),rowsPerPageOptions:[10,25,50,100],totalRecords:a.unref(h),first:a.unref(f),sortField:a.unref(g),sortOrder:a.unref(y),filters:o.value,"onUpdate:filters":J[5]||(J[5]=pe=>o.value=pe),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:a.unref(O),onPage:a.unref(P),onFilter:J[6]||(J[6]=pe=>$()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:a.withCtx(()=>J[9]||(J[9]=[a.createTextVNode(" No data found. ")])),loading:a.withCtx(()=>[a.createVNode(ve)]),header:a.withCtx(()=>[a.createElementVNode("div",am,[a.createVNode(qe,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:a.withCtx(()=>[a.createVNode(st,{class:"pi pi-search",onClick:J[2]||(J[2]=pe=>a.unref(C)())}),a.createVNode(a.unref(Jr.InputText),{class:"w-full sm:w-auto",onKeyup:J[3]||(J[3]=a.withKeys(pe=>a.unref(C)(),["enter"])),modelValue:a.unref(E),"onUpdate:modelValue":J[4]||(J[4]=pe=>a.isRef(E)?E.value=pe:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:a.withCtx(()=>{var pe;return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(u).filter(me=>!n.columnsToShow||n.columnsToShow.length===0||n.columnsToShow.includes(me.field)),me=>(a.openBlock(),a.createBlock(F,{key:me.field,dataType:a.unref(_)(me.datatype),field:me.field,header:me.name,sortable:me.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},a.createSlots({body:a.withCtx(({data:ge})=>[a.createVNode(Vo,{column:me,value:ge[me.field]},null,8,["column","value"])]),_:2},[me.datatype.toLowerCase()==="date"&&me.filterable?{name:"filter",fn:a.withCtx(({filterModel:ge})=>[a.createVNode(xt,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:me.datatype.toLowerCase()==="int"&&me.filterable?{name:"filter",fn:a.withCtx(({filterModel:ge})=>[a.createVNode(ct,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:me.datatype.toLowerCase()==="boolean"&&me.filterable?{name:"filter",fn:a.withCtx(({filterModel:ge})=>[a.createVNode(H,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,indeterminate:ge.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:me.filterable?{name:"filter",fn:a.withCtx(({filterModel:ge})=>[a.createVNode(a.unref(Jr.InputText),{style:{width:"150px"},type:"text",modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((pe=a.unref(d))==null?void 0:pe.length)>0&&(t.editable||t.deleteable)?(a.openBlock(),a.createBlock(F,{key:0,header:"Actions"},{body:a.withCtx(({data:me})=>[a.createElementVNode("div",lm,[t.editable?(a.openBlock(),a.createBlock(oe,{key:0,onClick:ge=>A(me),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):a.createCommentVNode("",!0),t.deleteable?(a.openBlock(),a.createBlock(oe,{key:1,onClick:ge=>Q(me),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):a.createCommentVNode("",!0)])]),_:1})):a.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),a.renderSlot(K.$slots,"footer")],16),l.value?(a.openBlock(),a.createBlock(em,{key:0,showForm:l.value,"onUpdate:showForm":J[7]||(J[7]=pe=>l.value=pe),entityName:a.unref(k).entityName,recordId:r.value,onOnSaveDialog:I},null,8,["showForm","entityName","recordId"])):a.createCommentVNode("",!0),c.value?(a.openBlock(),a.createBlock(tm,{key:1,showDeleteDialog:c.value,"onUpdate:showDeleteDialog":J[8]||(J[8]=pe=>c.value=pe),entityName:a.unref(k).entityName,recordId:r.value,onOnDeleteItem:ne},null,8,["showDeleteDialog","entityName","recordId"])):a.createCommentVNode("",!0)],64)}}};function cm(){const t=new Map;return{on(e,n){let i=t.get(e);return i?i.push(n):i=[n],t.set(e,i),this},off(e,n){let i=t.get(e);return i&&i.splice(i.indexOf(n)>>>0,1),this},emit(e,n){let i=t.get(e);i&&i.slice().map(s=>{s(n)})},clear(){t.clear()}}}var dm=Object.defineProperty,um=Object.defineProperties,fm=Object.getOwnPropertyDescriptors,ys=Object.getOwnPropertySymbols,Wa=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,qa=(t,e,n)=>e in t?dm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ht=(t,e)=>{for(var n in e||(e={}))Wa.call(e,n)&&qa(t,n,e[n]);if(ys)for(var n of ys(e))Ha.call(e,n)&&qa(t,n,e[n]);return t},Fo=(t,e)=>um(t,fm(e)),Rt=(t,e)=>{var n={};for(var i in t)Wa.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&ys)for(var i of ys(t))e.indexOf(i)<0&&Ha.call(t,i)&&(n[i]=t[i]);return n},hm=cm(),Gt=hm;function Ya(t,e){Mo(t)?t.push(...e||[]):Rn(t)&&Object.assign(t,e)}function mm(t){return Rn(t)&&t.hasOwnProperty("value")&&t.hasOwnProperty("type")?t.value:t}function pm(t){return t.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function $o(t="",e=""){return pm(`${Et(t,!1)&&Et(e,!1)?`${t}-`:t}${e}`)}function Ka(t="",e=""){return`--${$o(t,e)}`}function gm(t=""){const e=(t.match(/{/g)||[]).length,n=(t.match(/}/g)||[]).length;return(e+n)%2!==0}function Xa(t,e="",n="",i=[],s){if(Et(t)){const o=/{([^}]*)}/g,r=t.trim();if(gm(r))return;if(Vt(r,o)){const l=r.replaceAll(o,u=>{const h=u.replace(/{|}/g,"").split(".").filter(m=>!i.some(p=>Vt(m,p)));return`var(${Ka(n,za(h.join("-")))}${Ce(s)?`, ${s}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return Vt(l.replace(d,"0"),c)?`calc(${l})`:l}return r}else if(nm(t))return t}function ym(t,e,n){Et(e,!1)&&t.push(`${e}:${n};`)}function $n(t,e){return t?`${t}{${e}}`:""}var ii=(...t)=>bm(Fe.getTheme(),...t),bm=(t={},e,n,i)=>{if(e){const{variable:s,options:o}=Fe.defaults||{},{prefix:r,transform:l}=(t==null?void 0:t.options)||o||{},d=Vt(e,/{([^}]*)}/g)?e:`{${e}}`;return i==="value"||Ao(i)&&l==="strict"?Fe.getTokenValue(e):Xa(d,void 0,r,[s.excludedKeyRegex],n)}return""};function xm(t,e={}){const n=Fe.defaults.variable,{prefix:i=n.prefix,selector:s=n.selector,excludedKeyRegex:o=n.excludedKeyRegex}=e,r=(d,u="")=>Object.entries(d).reduce((f,[h,m])=>{const p=Vt(h,o)?$o(u):$o(u,za(h)),g=mm(m);if(Rn(g)){const{variables:y,tokens:b}=r(g,p);Ya(f.tokens,b),Ya(f.variables,y)}else f.tokens.push((i?p.replace(`${i}-`,""):p).replaceAll("-",".")),ym(f.variables,Ka(p),Xa(g,p,i,[o]));return f},{variables:[],tokens:[]}),{variables:l,tokens:c}=r(t,i);return{value:l,tokens:c,declarations:l.join(""),css:$n(s,l.join(""))}}var mt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(t){return{type:"class",selector:t,matched:this.pattern.test(t.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(t){return{type:"attr",selector:`:root${t}`,matched:this.pattern.test(t.trim())}}},media:{pattern:/^@media (.*)$/,resolve(t){return{type:"media",selector:`${t}{:root{[CSS]}}`,matched:this.pattern.test(t.trim())}}},system:{pattern:/^system$/,resolve(t){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(t.trim())}}},custom:{resolve(t){return{type:"custom",selector:t,matched:!0}}}},resolve(t){const e=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[t].flat().map(n=>{var i;return(i=e.map(s=>s.resolve(n)).find(s=>s.matched))!=null?i:this.rules.custom.resolve(n)})}},_toVariables(t,e){return xm(t,{prefix:e==null?void 0:e.prefix})},getCommon({name:t="",theme:e={},params:n,set:i,defaults:s}){var o,r,l,c,d,u,f;const{preset:h,options:m}=e;let p,g,y,b,x,w,E;if(Ce(h)&&m.transform!=="strict"){const{primitive:k,semantic:C,extend:S}=h,_=C||{},{colorScheme:O}=_,P=Rt(_,["colorScheme"]),v=S||{},{colorScheme:T}=v,R=Rt(v,["colorScheme"]),U=O||{},{dark:Y}=U,L=Rt(U,["dark"]),j=T||{},{dark:$}=j,A=Rt(j,["dark"]),I=Ce(k)?this._toVariables({primitive:k},m):{},Q=Ce(P)?this._toVariables({semantic:P},m):{},ne=Ce(L)?this._toVariables({light:L},m):{},se=Ce(Y)?this._toVariables({dark:Y},m):{},K=Ce(R)?this._toVariables({semantic:R},m):{},J=Ce(A)?this._toVariables({light:A},m):{},oe=Ce($)?this._toVariables({dark:$},m):{},[ue,ve]=[(o=I.declarations)!=null?o:"",I.tokens],[st,qe]=[(r=Q.declarations)!=null?r:"",Q.tokens||[]],[xt,ct]=[(l=ne.declarations)!=null?l:"",ne.tokens||[]],[H,F]=[(c=se.declarations)!=null?c:"",se.tokens||[]],[he,pe]=[(d=K.declarations)!=null?d:"",K.tokens||[]],[me,ge]=[(u=J.declarations)!=null?u:"",J.tokens||[]],[Te,Ze]=[(f=oe.declarations)!=null?f:"",oe.tokens||[]];p=this.transformCSS(t,ue,"light","variable",m,i,s),g=ve;const Bt=this.transformCSS(t,`${st}${xt}`,"light","variable",m,i,s),Le=this.transformCSS(t,`${H}`,"dark","variable",m,i,s);y=`${Bt}${Le}`,b=[...new Set([...qe,...ct,...F])];const et=this.transformCSS(t,`${he}${me}color-scheme:light`,"light","variable",m,i,s),dt=this.transformCSS(t,`${Te}color-scheme:dark`,"dark","variable",m,i,s);x=`${et}${dt}`,w=[...new Set([...pe,...ge,...Ze])],E=ft(h.css,{dt:ii})}return{primitive:{css:p,tokens:g},semantic:{css:y,tokens:b},global:{css:x,tokens:w},style:E}},getPreset({name:t="",preset:e={},options:n,params:i,set:s,defaults:o,selector:r}){var l,c,d;let u,f,h;if(Ce(e)&&n.transform!=="strict"){const m=t.replace("-directive",""),p=e,{colorScheme:g,extend:y,css:b}=p,x=Rt(p,["colorScheme","extend","css"]),w=y||{},{colorScheme:E}=w,k=Rt(w,["colorScheme"]),C=g||{},{dark:S}=C,_=Rt(C,["dark"]),O=E||{},{dark:P}=O,v=Rt(O,["dark"]),T=Ce(x)?this._toVariables({[m]:ht(ht({},x),k)},n):{},R=Ce(_)?this._toVariables({[m]:ht(ht({},_),v)},n):{},U=Ce(S)?this._toVariables({[m]:ht(ht({},S),P)},n):{},[Y,L]=[(l=T.declarations)!=null?l:"",T.tokens||[]],[j,$]=[(c=R.declarations)!=null?c:"",R.tokens||[]],[A,I]=[(d=U.declarations)!=null?d:"",U.tokens||[]],Q=this.transformCSS(m,`${Y}${j}`,"light","variable",n,s,o,r),ne=this.transformCSS(m,A,"dark","variable",n,s,o,r);u=`${Q}${ne}`,f=[...new Set([...L,...$,...I])],h=ft(b,{dt:ii})}return{css:u,tokens:f,style:h}},getPresetC({name:t="",theme:e={},params:n,set:i,defaults:s}){var o;const{preset:r,options:l}=e,c=(o=r==null?void 0:r.components)==null?void 0:o[t];return this.getPreset({name:t,preset:c,options:l,params:n,set:i,defaults:s})},getPresetD({name:t="",theme:e={},params:n,set:i,defaults:s}){var o;const r=t.replace("-directive",""),{preset:l,options:c}=e,d=(o=l==null?void 0:l.directives)==null?void 0:o[r];return this.getPreset({name:r,preset:d,options:c,params:n,set:i,defaults:s})},applyDarkColorScheme(t){return!(t.darkModeSelector==="none"||t.darkModeSelector===!1)},getColorSchemeOption(t,e){var n;return this.applyDarkColorScheme(t)?this.regex.resolve(t.darkModeSelector===!0?e.options.darkModeSelector:(n=t.darkModeSelector)!=null?n:e.options.darkModeSelector):[]},getLayerOrder(t,e={},n,i){const{cssLayer:s}=e;return s?`@layer ${ft(s.order||"primeui",n)}`:""},getCommonStyleSheet({name:t="",theme:e={},params:n,props:i={},set:s,defaults:o}){const r=this.getCommon({name:t,theme:e,params:n,set:s,defaults:o}),l=Object.entries(i).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(r||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const f=ni(u==null?void 0:u.css),h=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${h}" ${l}>${f}</style>`)}return c},[]).join("")},getStyleSheet({name:t="",theme:e={},params:n,props:i={},set:s,defaults:o}){var r;const l={name:t,theme:e,params:n,set:s,defaults:o},c=(r=t.includes("-directive")?this.getPresetD(l):this.getPresetC(l))==null?void 0:r.css,d=Object.entries(i).reduce((u,[f,h])=>u.push(`${f}="${h}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${t}-variables" ${d}>${ni(c)}</style>`:""},createTokens(t={},e,n="",i="",s={}){return Object.entries(t).forEach(([o,r])=>{const l=Vt(o,e.variable.excludedKeyRegex)?n:n?`${n}.${Ua(o)}`:Ua(o),c=i?`${i}.${o}`:o;Rn(r)?this.createTokens(r,e,l,c,s):(s[l]||(s[l]={paths:[],computed(d,u={}){var f,h;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(h=this.paths.find(m=>m.scheme===d))==null?void 0:h.computed(d,u.binding):this.paths.map(m=>m.computed(m.scheme,u[m.scheme]))}}),s[l].paths.push({path:c,value:r,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const f=/{([^}]*)}/g;let h=r;if(u.name=this.path,u.binding||(u.binding={}),Vt(r,f)){const p=r.trim().replaceAll(f,b=>{var x;const w=b.replace(/{|}/g,""),E=(x=s[w])==null?void 0:x.computed(d,u);return Mo(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),g=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,y=/var\([^)]+\)/g;h=Vt(p.replace(y,"0"),g)?`calc(${p})`:p}return Ao(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:h.includes("undefined")?void 0:h}}}))}),s},getTokenValue(t,e,n){var i;const o=(c=>c.split(".").filter(u=>!Vt(u.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(e),r=e.includes("colorScheme.light")?"light":e.includes("colorScheme.dark")?"dark":void 0,l=[(i=t[o])==null?void 0:i.computed(r)].flat().filter(c=>c);return l.length===1?l[0].value:l.reduce((c={},d)=>{const u=d,{colorScheme:f}=u,h=Rt(u,["colorScheme"]);return c[f]=h,c},void 0)},getSelectorRule(t,e,n,i){return n==="class"||n==="attr"?$n(Ce(e)?`${t}${e},${t} ${e}`:t,i):$n(t,Ce(e)?$n(e,i):i)},transformCSS(t,e,n,i,s={},o,r,l){if(Ce(e)){const{cssLayer:c}=s;if(i!=="style"){const d=this.getColorSchemeOption(s,r);e=n==="dark"?d.reduce((u,{type:f,selector:h})=>(Ce(h)&&(u+=h.includes("[CSS]")?h.replace("[CSS]",e):this.getSelectorRule(h,l,f,e)),u),""):$n(l??":root",e)}if(c){const d={name:"primeui",order:"primeui"};Rn(c)&&(d.name=ft(c.name,{name:t,type:i})),Ce(d.name)&&(e=$n(`@layer ${d.name}`,e),o==null||o.layerNames(d.name))}return e}return""}},Fe={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(t={}){const{theme:e}=t;e&&(this._theme=Fo(ht({},e),{options:ht(ht({},this.defaults.options),e.options)}),this._tokens=mt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var t;return((t=this.theme)==null?void 0:t.preset)||{}},get options(){var t;return((t=this.theme)==null?void 0:t.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(t){this.update({theme:t}),Gt.emit("theme:change",t)},getPreset(){return this.preset},setPreset(t){this._theme=Fo(ht({},this.theme),{preset:t}),this._tokens=mt.createTokens(t,this.defaults),this.clearLoadedStyleNames(),Gt.emit("preset:change",t),Gt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(t){this._theme=Fo(ht({},this.theme),{options:t}),this.clearLoadedStyleNames(),Gt.emit("options:change",t),Gt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(t){this._layerNames.add(t)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(t){return this._loadedStyleNames.has(t)},setLoadedStyleName(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(t){return mt.getTokenValue(this.tokens,t,this.defaults)},getCommon(t="",e){return mt.getCommon({name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(t="",e){const n={name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPresetC(n)},getDirective(t="",e){const n={name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPresetD(n)},getCustomPreset(t="",e,n,i){const s={name:t,preset:e,options:this.options,selector:n,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPreset(s)},getLayerOrderCSS(t=""){return mt.getLayerOrder(t,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(t="",e,n="style",i){return mt.transformCSS(t,e,i,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(t="",e,n={}){return mt.getCommonStyleSheet({name:t,theme:this.theme,params:e,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(t,e,n={}){return mt.getStyleSheet({name:t,theme:this.theme,params:e,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(t){this._loadingStyles.add(t)},onStyleUpdated(t){this._loadingStyles.add(t)},onStyleLoaded(t,{name:e}){this._loadingStyles.size&&(this._loadingStyles.delete(e),Gt.emit(`theme:${e}:load`,t),!this._loadingStyles.size&&Gt.emit("theme:load"))}};function Lo(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}function Io(t,e={}){if(Lo(t)){const n=(i,s)=>{var o,r;const l=(o=t==null?void 0:t.$attrs)!=null&&o[i]?[(r=t==null?void 0:t.$attrs)==null?void 0:r[i]]:[];return[s].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const f=Array.isArray(d)?n(i,d):Object.entries(d).map(([h,m])=>i==="style"&&(m||m===0)?`${h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${m}`:m?h:void 0);c=f.length?c.concat(f.filter(h=>!!h)):c}}return c},l)};Object.entries(e).forEach(([i,s])=>{if(s!=null){const o=i.match(/^on(.+)/);o?t.addEventListener(o[1].toLowerCase(),s):i==="p-bind"||i==="pBind"?Io(t,s):(s=i==="class"?[...new Set(n("class",s))].join(" ").trim():i==="style"?n("style",s).join(";").trim():s,(t.$attrs=t.$attrs||{})&&(t.$attrs[i]=s),t.setAttribute(i,s))}})}}function _m(t,e){return Lo(t)?t.matches(e)?t:t.querySelector(e):null}function km(t){if(t){let e=t.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function Sm(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&km(t))}function Ga(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function wm(t,e="",n){Lo(t)&&n!==null&&n!==void 0&&t.setAttribute(e,n)}var bs={};function Em(t="pui_id_"){return bs.hasOwnProperty(t)||(bs[t]=0),bs[t]++,`${t}${bs[t]}`}var si={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};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 Ja(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function Qa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ja(Object(n),!0).forEach(function(i){Cm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ja(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Cm(t,e,n){return(e=Om(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Om(t){var e=vm(t,"string");return oi(e)=="symbol"?e:e+""}function vm(t,e){if(oi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(oi(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a.getCurrentInstance()?a.onMounted(t):e?t():a.nextTick(t)}var Dm=0;function Tm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.ref(!1),i=a.ref(t),s=a.ref(null),o=Ga()?window.document:void 0,r=e.document,l=r===void 0?o:r,c=e.immediate,d=c===void 0?!0:c,u=e.manual,f=u===void 0?!1:u,h=e.name,m=h===void 0?"style_".concat(++Dm):h,p=e.id,g=p===void 0?void 0:p,y=e.media,b=y===void 0?void 0:y,x=e.nonce,w=x===void 0?void 0:x,E=e.first,k=E===void 0?!1:E,C=e.onMounted,S=C===void 0?void 0:C,_=e.onUpdated,O=_===void 0?void 0:_,P=e.onLoad,v=P===void 0?void 0:P,T=e.props,R=T===void 0?{}:T,U=function(){},Y=function($){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l){var I=Qa(Qa({},R),A),Q=I.name||m,ne=I.id||g,se=I.nonce||w;s.value=l.querySelector('style[data-primevue-style-id="'.concat(Q,'"]'))||l.getElementById(ne)||l.createElement("style"),s.value.isConnected||(i.value=$||t,Io(s.value,{type:"text/css",id:ne,media:b,nonce:se}),k?l.head.prepend(s.value):l.head.appendChild(s.value),wm(s.value,"data-primevue-style-id",Q),Io(s.value,I),s.value.onload=function(K){return v==null?void 0:v(K,{name:Q})},S==null||S(Q)),!n.value&&(U=a.watch(i,function(K){s.value.textContent=K,O==null||O(Q)},{immediate:!0}),n.value=!0)}},L=function(){!l||!n.value||(U(),Sm(s.value)&&l.head.removeChild(s.value),n.value=!1)};return d&&!f&&Nm(Y),{id:g,name:m,el:s,css:i,unload:L,load:Y,isLoaded:a.readonly(n)}}function ri(t){"@babel/helpers - typeof";return ri=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},ri(t)}function Za(t,e){return Mm(t)||Am(t,e)||Pm(t,e)||Bm()}function Bm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pm(t,e){if(t){if(typeof t=="string")return el(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?el(t,e):void 0}}function el(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Am(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,s,o,r,l=[],c=!0,d=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(c=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&n.return!=null&&(r=n.return(),Object(r)!==r))return}finally{if(d)throw s}}return l}}function Mm(t){if(Array.isArray(t))return t}function tl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function jo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tl(Object(n),!0).forEach(function(i){Vm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Vm(t,e,n){return(e=Rm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rm(t){var e=Fm(t,"string");return ri(e)=="symbol"?e:e+""}function Fm(t,e){if(ri(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(ri(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $m=function(e){var n=e.dt;return`
|
|
14
14
|
*,
|
|
15
15
|
::before,
|
|
16
16
|
::after {
|
|
@@ -85,21 +85,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
85
85
|
|
|
86
86
|
.p-disabled,
|
|
87
87
|
.p-component:disabled {
|
|
88
|
-
opacity: `.concat(
|
|
88
|
+
opacity: `.concat(n("disabled.opacity"),`;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
.pi {
|
|
92
|
-
font-size: `).concat(
|
|
92
|
+
font-size: `).concat(n("icon.size"),`;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.p-icon {
|
|
96
|
-
width: `).concat(
|
|
97
|
-
height: `).concat(
|
|
96
|
+
width: `).concat(n("icon.size"),`;
|
|
97
|
+
height: `).concat(n("icon.size"),`;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.p-overlay-mask {
|
|
101
|
-
background: `).concat(
|
|
102
|
-
color: `).concat(
|
|
101
|
+
background: `).concat(n("mask.background"),`;
|
|
102
|
+
color: `).concat(n("mask.color"),`;
|
|
103
103
|
position: fixed;
|
|
104
104
|
top: 0;
|
|
105
105
|
left: 0;
|
|
@@ -108,11 +108,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.p-overlay-mask-enter {
|
|
111
|
-
animation: p-overlay-mask-enter-animation `).concat(
|
|
111
|
+
animation: p-overlay-mask-enter-animation `).concat(n("mask.transition.duration"),` forwards;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.p-overlay-mask-leave {
|
|
115
|
-
animation: p-overlay-mask-leave-animation `).concat(
|
|
115
|
+
animation: p-overlay-mask-leave-animation `).concat(n("mask.transition.duration"),` forwards;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
@keyframes p-overlay-mask-enter-animation {
|
|
@@ -120,18 +120,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
120
120
|
background: transparent;
|
|
121
121
|
}
|
|
122
122
|
to {
|
|
123
|
-
background: `).concat(
|
|
123
|
+
background: `).concat(n("mask.background"),`;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
@keyframes p-overlay-mask-leave-animation {
|
|
127
127
|
from {
|
|
128
|
-
background: `).concat(
|
|
128
|
+
background: `).concat(n("mask.background"),`;
|
|
129
129
|
}
|
|
130
130
|
to {
|
|
131
131
|
background: transparent;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
`)},
|
|
134
|
+
`)},Lm=function(e){var n=e.dt;return`
|
|
135
135
|
.p-hidden-accessible {
|
|
136
136
|
border: 0;
|
|
137
137
|
clip: rect(0 0 0 0);
|
|
@@ -150,28 +150,33 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
150
150
|
|
|
151
151
|
.p-overflow-hidden {
|
|
152
152
|
overflow: hidden;
|
|
153
|
-
padding-right: `.concat(
|
|
153
|
+
padding-right: `.concat(n("scrollbar.width"),`;
|
|
154
154
|
}
|
|
155
|
-
`)},
|
|
156
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(n,e){if(n){if(typeof n=="string")return ya(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ya(n,e):void 0}}function ya(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t<e;t++)i[t]=n[t];return i}function yh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,s,o,a,l=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(i=o.call(t)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}function ba(n){if(Array.isArray(n))return n}function xa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function ae(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xa(Object(t),!0).forEach(function(i){Gn(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xa(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Gn(n,e,t){return(e=bh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bh(n){var e=xh(n,"string");return Kn(e)=="symbol"?e:e+""}function xh(n,e){if(Kn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Kn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _h={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e){var t=this;e?(this._loadScopedThemeStyles(e),this._themeChangeListener(function(){return t._loadScopedThemeStyles(e)})):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,$attrSelector:void 0,beforeCreate:function(){var e,t,i,s,o,a,l,c,d,u,f,h=(e=this.pt)===null||e===void 0?void 0:e._usept,m=h?(t=this.pt)===null||t===void 0||(t=t.originalValue)===null||t===void 0?void 0:t[this.$.type.name]:void 0,p=h?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(s=p||m)===null||s===void 0||(s=s.hooks)===null||s===void 0||(o=s.onBeforeCreate)===null||o===void 0||o.call(s);var g=(a=this.$primevueConfig)===null||a===void 0||(a=a.pt)===null||a===void 0?void 0:a._usept,y=g?(l=this.$primevue)===null||l===void 0||(l=l.config)===null||l===void 0||(l=l.pt)===null||l===void 0?void 0:l.originalValue:void 0,b=g?(c=this.$primevue)===null||c===void 0||(c=c.config)===null||c===void 0||(c=c.pt)===null||c===void 0?void 0:c.value:(d=this.$primevue)===null||d===void 0||(d=d.config)===null||d===void 0?void 0:d.pt;(u=b||y)===null||u===void 0||(u=u[this.$.type.name])===null||u===void 0||(u=u.hooks)===null||u===void 0||(f=u.onBeforeCreate)===null||f===void 0||f.call(u),this.$attrSelector=Qf("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=Yf(this.$el,'[data-pc-name="'.concat(Rt(this.$.type.name),'"]')),this.rootEl&&(this.$attrSelector&&!this.rootEl.hasAttribute(this.$attrSelector)&&this.rootEl.setAttribute(this.$attrSelector,""),this.rootEl.$pc=ae({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(e){if(!this.$options.hostName){var t=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(e)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(e));t==null||t(),i==null||i()}},_mergeProps:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Jr(e)?e.apply(void 0,i):r.mergeProps.apply(void 0,i)},_loadStyles:function(){var e=this,t=function(){Un.isStyleNameLoaded("base")||(Nt.loadCSS(e.$styleOptions),e._loadGlobalStyles(),Un.setLoadedStyleName("base")),e._loadThemeStyles()};t(),this._themeChangeListener(t)},_loadCoreStyles:function(){var e,t;!Un.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(t=this.$style)!==null&&t!==void 0&&t.name&&(ma.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),Un.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);Ee(e)&&Nt.load(e,ae({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var e,t;if(!(this.isUnstyled||this.$theme==="none")){if(!Me.isStyleNameLoaded("common")){var i,s,o=((i=this.$style)===null||i===void 0||(s=i.getCommonTheme)===null||s===void 0?void 0:s.call(i))||{},a=o.primitive,l=o.semantic,c=o.global,d=o.style;Nt.load(a==null?void 0:a.css,ae({name:"primitive-variables"},this.$styleOptions)),Nt.load(l==null?void 0:l.css,ae({name:"semantic-variables"},this.$styleOptions)),Nt.load(c==null?void 0:c.css,ae({name:"global-variables"},this.$styleOptions)),Nt.loadTheme(ae({name:"global-style"},this.$styleOptions),d),Me.setLoadedStyleName("common")}if(!Me.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(t=this.$style)!==null&&t!==void 0&&t.name){var u,f,h,m,p=((u=this.$style)===null||u===void 0||(f=u.getComponentTheme)===null||f===void 0?void 0:f.call(u))||{},g=p.css,y=p.style;(h=this.$style)===null||h===void 0||h.load(g,ae({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(m=this.$style)===null||m===void 0||m.loadTheme(ae({name:"".concat(this.$style.name,"-style")},this.$styleOptions),y),Me.setLoadedStyleName(this.$style.name)}if(!Me.isStyleNameLoaded("layer-order")){var b,_,w=(b=this.$style)===null||b===void 0||(_=b.getLayerOrderThemeCSS)===null||_===void 0?void 0:_.call(b);Nt.load(w,ae({name:"layer-order",first:!0},this.$styleOptions)),Me.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(e){var t,i,s,o=((t=this.$style)===null||t===void 0||(i=t.getPresetTheme)===null||i===void 0?void 0:i.call(t,e,"[".concat(this.$attrSelector,"]")))||{},a=o.css,l=(s=this.$style)===null||s===void 0?void 0:s.load(a,ae({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=l.el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)===null||e===void 0||(e=e.value)===null||e===void 0||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};Un.clearLoadedStyleNames(),jt.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||((t=this._getHostInstance(this))===null||t===void 0?void 0:t[e])},_getOptionValue:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zr(e,t,i)},_getPTValue:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=/./g.test(i)&&!!s[i.split(".")[0]],l=this._getPropValue("ptOptions")||((e=this.$primevueConfig)===null||e===void 0?void 0:e.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o?a?this._useGlobalPT(this._getPTClassValue,i,s):this._useDefaultPT(this._getPTClassValue,i,s):void 0,m=a?void 0:this._getPTSelf(t,this._getPTClassValue,i,ae(ae({},s),{},{global:h||{}})),p=this._getPTDatasets(i);return d||!d&&m?f?this._mergeProps(f,h,m,p):ae(ae(ae({},h),m),p):ae(ae({},m),p)},_getPTSelf:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return r.mergeProps(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s="data-pc-",o=i==="root"&&Ee((e=this.pt)===null||e===void 0?void 0:e["data-pc-section"]);return i!=="transition"&&ae(ae({},i==="root"&&ae(ae(Gn({},"".concat(s,"name"),Rt(o?(t=this.pt)===null||t===void 0?void 0:t["data-pc-section"]:this.$.type.name)),o&&Gn({},"".concat(s,"extend"),Rt(this.$.type.name))),la()&&Gn({},"".concat(this.$attrSelector),""))),{},Gn({},"".concat(s,"section"),Rt(i)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return gt(e)||oo(e)?{class:e}:e},_getPT:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,o=function(l){var c,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s?s(l):l,f=Rt(i),h=Rt(t.$name);return(c=d?f!==h?u==null?void 0:u[f]:void 0:u==null?void 0:u[f])!==null&&c!==void 0?c:u};return e!=null&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e,!0)},_usePT:function(e,t,i,s){var o=function(g){return t(g,i,s)};if(e!=null&&e.hasOwnProperty("_usept")){var a,l=e._usept||((a=this.$primevueConfig)===null||a===void 0?void 0:a.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o(e.originalValue),m=o(e.value);return h===void 0&&m===void 0?void 0:gt(m)?m:gt(h)?h:d||!d&&m?f?this._mergeProps(f,h,m):ae(ae({},h),m):m}return o(e)},_useGlobalPT:function(e,t,i){return this._usePT(this.globalPT,e,t,i)},_useDefaultPT:function(e,t,i){return this._usePT(this.defaultPT,e,t,i)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,ae(ae({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r.mergeProps(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,t,ae({instance:this},i),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,ae(ae({},this.$params),t))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t){var s=this._getOptionValue(this.$style.inlineStyles,e,ae(ae({},this.$params),i)),o=this._getOptionValue(ma.inlineStyles,e,ae(ae({},this.$params),i));return[o,s]}}},computed:{globalPT:function(){var e,t=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return rt(i,{instance:t})})},defaultPT:function(){var e,t=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return t._getOptionValue(i,t.$name,ae({},t.$params))||rt(i,ae({},t.$params))})},isUnstyled:function(){var e;return this.unstyled!==void 0?this.unstyled:(e=this.$primevueConfig)===null||e===void 0?void 0:e.unstyled},$inProps:function(){var e,t=Object.keys(((e=this.$.vnode)===null||e===void 0?void 0:e.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var s=Xn(i,1),o=s[0];return t==null?void 0:t.includes(o)}))},$theme:function(){var e;return(e=this.$primevueConfig)===null||e===void 0?void 0:e.theme},$style:function(){return ae(ae({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce}},$primevueConfig:function(){var e;return(e=this.$primevue)===null||e===void 0?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e==null?void 0:e.$props,state:e==null?void 0:e.$data,attrs:e==null?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var t=Xn(e,1),i=t[0];return i==null?void 0:i.startsWith("pt:")}).reduce(function(e,t){var i=Xn(t,2),s=i[0],o=i[1],a=s.split(":"),l=ph(a),c=l.slice(1);return c==null||c.reduce(function(d,u,f,h){return!d[u]&&(d[u]=f===h.length-1?o:{}),d[u]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var t=Xn(e,1),i=t[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(e,t){var i=Xn(t,2),s=i[0],o=i[1];return e[s]=o,e},{})}}},kh={root:{position:"relative"}},Sh={root:"p-chart"},wh=Nt.extend({name:"chart",classes:Sh,inlineStyles:kh}),Eh={name:"BaseChart",extends:_h,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:wh,provide:function(){return{$pcChart:this,$parentInstance:this}}},_a={name:"Chart",extends:Eh,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var e=this;Promise.resolve().then(()=>DS).then(function(t){e.chart&&(e.chart.destroy(),e.chart=null),t&&t.default&&(e.chart=new t.default(e.$refs.canvas,{type:e.type,data:e.data,options:e.options,plugins:e.plugins})),e.$emit("loaded",e.chart)})},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(e){if(this.chart){var t=this.chart.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1);t&&t[0]&&i&&this.$emit("select",{originalEvent:e,element:t[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function Qn(n){"@babel/helpers - typeof";return Qn=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},Qn(n)}function ka(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function Sa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ka(Object(t),!0).forEach(function(i){Ch(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ka(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ch(n,e,t){return(e=vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vh(n){var e=Dh(n,"string");return Qn(e)=="symbol"?e:e+""}function Dh(n,e){if(Qn(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Qn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Nh=["width","height"];function Oh(n,e,t,i,s,o){return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:n.cx("root"),style:n.sx("root")},n.ptmi("root")),[r.createElementVNode("canvas",r.mergeProps({ref:"canvas",width:n.width,height:n.height,onClick:e[0]||(e[0]=function(a){return o.onCanvasClick(a)})},Sa(Sa({},n.canvasProps),n.ptm("canvas"))),null,16,Nh)],16)}_a.render=Oh;function Th(){const n={primary:"#0efcf1",primaryBorder:"#388E3C",secondary:"#0ec6fc",secondaryBorder:"#FBC02D",tertiary:"#f1fc0e",tertiaryBorder:"#FFA000"},e=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInBounce","easeOutBounce","easeInOutBounce","easeInOutElastic"],t=r.ref("easeInOutElastic"),i=r.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"top",labels:{font:{size:16}}},tooltip:{enabled:!0,titleFont:{size:14},bodyFont:{size:12}},zoom:{zoom:{wheel:{enabled:!0},drag:{enabled:!0},mode:"xy"},pan:{enabled:!0,mode:"xy"}}},scales:{x:{grid:{display:!1},ticks:{font:{size:14}}},y:{grid:{display:!0,color:"#e0e0e0"},ticks:{font:{size:14}}}},animation:{duration:2e3,easing:t.value,delay:500,loop:!1,animateRotate:!0,animateScale:!0},elements:{point:{radius:6,hoverRadius:10,backgroundColor:n.secondary},line:{tension:.4,borderWidth:2},bar:{borderWidth:2,borderRadius:4}}}));return{colorConfig:n,animationOptions:e,selectedAnimation:t,defaultChartOptions:i}}const Ph={components:{Chart:_a},props:{type:{type:String,required:!0},chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>({})}},setup(n){const{colorConfig:e,defaultChartOptions:t}=Th(),i=r.computed(()=>{const o=n.chartData.datasets.map((a,l)=>{const c=Object.values(e);return{...a,backgroundColor:c[l%c.length],borderColor:c[l%c.length+1]}});return{...n.chartData,datasets:o}}),s=r.computed(()=>({...t.value,maintainAspectRatio:!0,...n.chartOptions}));return{computedChartData:i,computedChartOptions:s}}},Bh={class:"chart-container"},Mh={key:0},Vh={key:1};function Ah(n,e,t,i,s,o){const a=r.resolveComponent("Chart",!0);return r.openBlock(),r.createElementBlock("div",Bh,[t.chartData?(r.openBlock(),r.createElementBlock("div",Mh,[r.createVNode(a,{type:t.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(r.openBlock(),r.createElementBlock("div",Vh,e[0]||(e[0]=[r.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const Jn=Be(Ph,[["render",Ah],["__scopeId","data-v-8e3e786b"]]);function Zn(){const n=r.ref(null),e=r.ref(!1),t=r.ref(null);return{chartData:n,fetchChartData:async({entityName:s,xaxis:o=null,yaxis:a=null})=>{e.value=!0,t.value=null;const l="https://mocki.io/v1/1ab17035-c115-4049-8ebf-a1e1b92d739a";try{const d=await(await fetch(l)).json();if(!d||!d.response||!d.response.result)throw new Error("Invalid data structure from API.");const u=d.response.result;if(!o&&!a){const f=Object.keys(u[0]);o=f[1],a=f.slice(4);const h=u.reduce((g,y)=>(a.forEach(b=>{g[b]||(g[b]=0),g[b]+=y[b]||0}),g),{}),m=Object.keys(h),p=Object.values(h);n.value={labels:m,datasets:[{label:"Default Data",data:p,borderWidth:1}]}}else{const f=u.map(p=>p[o]),m=(Array.isArray(a)?a:[a]).map(p=>({label:p,data:u.map(g=>g[p]||0),borderWidth:1}));n.value={labels:f,datasets:m}}}catch(c){t.value=c.message,n.value=null}finally{e.value=!1}},loading:e,error:t}}const Fh={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await t({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},$h={key:0,class:"chart-container"},Ih={key:1},Lh={key:0},Rh={key:1},jh={key:2};function zh(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",$h,[r.createElementVNode("h3",null,r.toDisplayString(t.title)+" , x-axis : "+r.toDisplayString(t.xaxis)+" , y-axis : "+r.toDisplayString(t.yaxis),1),r.createVNode(a,{type:"bar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Ih,[i.loading?(r.openBlock(),r.createElementBlock("p",Lh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Rh,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",jh,"No data available for the chart."))]))])}const wa=Be(Fh,[["render",zh],["__scopeId","data-v-67577a46"]]),Wh={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await t({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Hh={key:0,class:"chart-container"},Uh={key:1},qh={key:0},Yh={key:1},Kh={key:2};function Xh(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Hh,[r.createElementVNode("h3",null,r.toDisplayString(t.title)+" , x-axis : "+r.toDisplayString(t.xaxis)+" , y-axis : "+r.toDisplayString(t.yaxis),1),r.createVNode(a,{type:"line",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Uh,[i.loading?(r.openBlock(),r.createElementBlock("p",qh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Yh,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Kh,"No data available for the chart."))]))])}const Ea=Be(Wh,[["render",Xh],["__scopeId","data-v-2cfe3d4d"]]),Gh={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await t({entityName:n.entityName,xaxis:n.xaxis,yaxis:n.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Qh={key:0,class:"chart-container"},Jh={key:1},Zh={key:0},em={key:1},tm={key:2};function nm(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Qh,[r.createElementVNode("h3",null,r.toDisplayString(t.title),1),r.createVNode(a,{type:"pie",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Jh,[i.loading?(r.openBlock(),r.createElementBlock("p",Zh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",em,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",tm,"No data available for the chart."))]))])}const Ca=Be(Gh,[["render",nm],["__scopeId","data-v-27f5ea01"]]),im={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await t({entityName:n.entityName,xaxis:n.xaxis,yaxis:n.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},sm={key:0,class:"chart-container"},om={key:1},rm={key:0},am={key:1},lm={key:2};function cm(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",sm,[r.createElementVNode("h3",null,r.toDisplayString(t.title),1),r.createVNode(a,{type:"polarArea",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",om,[i.loading?(r.openBlock(),r.createElementBlock("p",rm,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",am,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",lm,"No data available for the chart."))]))])}const va=Be(im,[["render",cm],["__scopeId","data-v-941f0d0a"]]),dm={components:{chart:Jn},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(n){const{chartData:e,fetchChartData:t,loading:i,error:s}=Zn(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!n.yaxis||!n.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await t({entityName:n.entityName,yaxis:n.yaxis,xaxis:n.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",n.yaxis),console.log("Fetching data for xAxis:",n.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},um={key:0,class:"chart-container"},fm={key:1},hm={key:0},mm={key:1},pm={key:2};function gm(n,e,t,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(t.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",um,[r.createElementVNode("h3",null,r.toDisplayString(t.title)+" , x-axis : "+r.toDisplayString(t.xaxis)+" , y-axis : "+r.toDisplayString(t.yaxis),1),r.createVNode(a,{type:"radar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",fm,[i.loading?(r.openBlock(),r.createElementBlock("p",hm,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",mm,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",pm,"No data available for the chart."))]))])}const Da=Be(dm,[["render",gm],["__scopeId","data-v-80750171"]]),ym={class:"flex flex-col p-3"},bm={class:"flex justify-center flex-row mb-2 cursor-pointer"},xm={style:{"word-break":"break-all"}},_m={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(n){Je.useRoute();const e=Ze(),t=r.ref("");e.getAppId()!=null&&e.getAppId()!=""&&(t.value=e.getAppId());const i=r.ref(),s=r.ref(!1),o=r.ref(!1),a=r.ref({}),l=r.ref([{label:"Remove association",icon:"",command:f=>{c()}}]),c=()=>{console.log(a.value),console.log("Function is calling")},d=(f,h)=>{a.value=h,i.value.show(f),o.value=!0},u=()=>{a.value={},o.value=!1};return(f,h)=>{const m=r.resolveComponent("Button"),p=r.resolveComponent("ContextMenu"),g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("div",{onMouseenter:h[4]||(h[4]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[5]||(h[5]=r.withModifiers(y=>s.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[r.withDirectives(r.createVNode(m,{onClick:h[0]||(h[0]=y=>d(y,n.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:r.withCtx(()=>h[6]||(h[6]=[r.createTextVNode(" More")])),_:1},512),[[r.vShow,s.value||o.value]]),r.createVNode(p,{ref_key:"menu",ref:i,model:l.value,onMouseenter:h[1]||(h[1]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[2]||(h[2]=r.withModifiers(y=>s.value=!1,["prevent"])),onHide:h[3]||(h[3]=y=>u())},null,8,["model"]),r.createElementVNode("div",ym,[r.createElementVNode("div",bm,[r.createElementVNode("div",xm,r.toDisplayString(n.linkEntityListItem.entityName),1),r.createVNode(g,{to:{name:"entity360view",params:{entityName:n.linkEntityListItem.entityName,id:n.linkEntityListItem.id,appId:t.value}},target:"_blank"},{default:r.withCtx(()=>h[7]||(h[7]=[r.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),r.createElementVNode("div",null,"Id: "+r.toDisplayString(n.linkEntityListItem.id),1)])],32)}}},km={class:"flex flex-col mt-3"},Sm={class:"flex flex-row items-center"},wm={class:"flex items-center justify-center mt-5"},Em={key:0,class:"pi pi-caret-right"},Cm={key:1,class:"pi pi-caret-down"},vm={key:0},Dm={class:"flex flex-col mt-5"},Nm={class:"col-12"},Om={class:"flex flex-col mt-5"},Tm={class:"col-12 font-bold"},Pm={key:0},Bm={class:"flex flex-col mt-5"},Mm={class:"col-12"},Vm={class:"flex flex-col mt-5"},Am={class:"col-12"},Fm={class:"flex flex-col mt-5"},$m={class:"col-12"},Im={class:"flex flex-row justify-between items-center mt-5"},Lm={key:1,class:"mt-2"},Rm={class:"flex flex-row justify-between items-center"},jm={key:1,class:"text-red-500"},zm={class:"flex flex-col mt-5"},Wm={class:"flex flex-row justify-between items-center mt-2"},Hm={class:"flex flex-row items-center mt-5 mb-5"},Um={class:"font-bold"},qm={class:"font-bold ml-2 flex-1"},Ym={class:"flex flex-row justify-center items-center mb-2"},Km={class:"ml-2 flex-1"},Xm={key:0,class:"pi pi-exclamation-circle"},Gm={class:"flex flex-col justify-center"},Qm={class:"flex flex-row justify-between items-center"},Jm={class:"justify-start"},Zm={class:"justify-start"},ep=Be({__name:"EntityLookup",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){Je.useRoute();const e=n,t=r.useModel(n,"modelValue"),i=new sn,s=r.ref({}),o=r.ref([]),a=r.ref({}),l=r.ref([]),c=r.ref([]),d=r.ref({}),u=r.ref("id"),f=r.ref(1),h=r.ref([]),m=r.ref(25),p=r.ref(0),g=r.ref(0),y=r.ref(0);let b=r.ref([]);const _=r.ref(!1),w={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};r.onMounted(()=>{C()});const k=H=>e.linkedEntity.list.some(F=>F[d.value.name]===H),C=async()=>{try{const H={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:m.value,currentPage:p.value,columnList:null,filter:b.value,fullTextSearch:""},F=await i.searchEntityRecords(e.linkedEntity.entityName,H);F&&F.response&&(s.value=F.response,l.value=F.response.entity.entityDefinition.columns,c.value=_e(F.response.entity.entityDefinition.columns),g.value=F.response.totalRecords,await S(),await x(),v())}catch{}finally{}},S=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];!F.autoGeneerated&&F.foreignKey&&F.foreignKey.referencedEntityName.toLowerCase()==e.entity360Name.toLowerCase()&&(a.value=F)}},x=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];if(F.primaryKey&&F.primaryKey==!0){d.value=F;break}}},v=()=>{for(let H=0;H<e.linkedEntity.list.length;H++){const F=e.linkedEntity.list[H];F.is_deleted==!1&&F[a.value.name]==e.entity360Id&&o.value.push(F[d.value.name])}},B=()=>{let H=JSON.parse(JSON.stringify(o.value));H=H.filter(ue=>!k(ue));let F={linkEntityName:s.value.entityName,linkRecordIdList:[]};for(let ue=0;ue<H.length;ue++){const he=H[ue];F.linkRecordIdList.push(he)}e.saveExistingRelatedEntityRecord(F)},D=()=>{_.value=!_.value},T=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],I=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],q=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],L=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],A=[{label:"ASC",value:1},{label:"DESC",value:-1}];let j=[];const $=r.computed(()=>c.value.filter(H=>H.sortable)),P=r.computed(()=>c.value.filter(H=>H.filterable)),R=H=>c.value.filter(F=>{var ue;return F.filterable?((ue=h.value[H])==null?void 0:ue.columnName)===F.name?!0:!h.value.some((he,fe)=>fe!==H&&he.columnName===F.name):!1}).map(F=>({label:F.name,value:F.field})),G=H=>{let F="";switch(ze(H.columnName).toLowerCase()){case"string":case"uuid":F="startsWith";break;case"date":F="dateIs";break;case"numeric":case"int":case"integer":F="equals";break;case"bool":case"boolean":F="equals";break}H.operator=F,H.value=""},se=H=>{const F=ze(H.columnName);switch(F&&F.toLowerCase()){case"integer":case"int":case"numeric":j=I;break;case"date":j=L;break;case"bool":case"boolean":j=q;break;default:j=T}return j},ne=H=>{if(H&&H.columnName){const F=ze(H.columnName);return ft(F)}else return""},Q=()=>{for(let H=0;H<h.value.length;H++){const F=h.value[H];F.editing=!1}h.value.push({columnName:"",value:"",operator:"",editing:!0})},Y=H=>{h.value.splice(H,1)},te=H=>{H.editing=!H.editing},ce=()=>{let H=JSON.parse(JSON.stringify(h.value));b.value=[];for(let F=0;F<H.length;F++){const ue=H[F];delete ue.editing,ue.columnName&&ue.operator&&ue.value&&(ue.columnType=ze(ue.columnName),ue.operator=w[ue.operator],b.value.push(ue))}C()},_e=H=>H.map(F=>({field:F.name,name:F.displayName?F.displayName:F.name,filterable:F.filterable,datatype:F.type,sortable:!0,displayFormatKey:F.displayFormatKey,displayFormat:F.displayFormat})),Qe=()=>{C()},ze=H=>{const F=c.value.find(ue=>ue.field===H);return F?F.datatype:null},ft=H=>{switch(H.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},it=H=>{m.value=H.rows,p.value=H.page,y.value=H.first,C()};return(H,F)=>{var nn,_n;const ue=r.resolveComponent("InputIcon"),he=r.resolveComponent("InputText"),fe=r.resolveComponent("IconField"),me=r.resolveComponent("Select"),De=r.resolveComponent("Divider"),Ye=r.resolveComponent("InputNumber"),St=r.resolveComponent("DatePicker"),Ae=r.resolveComponent("Button"),Ke=r.resolveComponent("Checkbox"),st=r.resolveComponent("Paginator"),tn=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",km,[r.createElementVNode("div",Sm,[r.createVNode(fe,{class:"block mt-2 md:mt-0 w-full"},{default:r.withCtx(()=>[r.createVNode(ue,{onClick:F[0]||(F[0]=()=>{}),class:"pi pi-search"}),r.createVNode(he,{class:"w-full",onKeyup:F[1]||(F[1]=r.withKeys(()=>{},["enter"])),placeholder:`Search ${s.value.entityName}`},null,8,["placeholder"])]),_:1})]),r.createElementVNode("div",wm,[r.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:F[2]||(F[2]=Z=>D())},[_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Em)),_.value?(r.openBlock(),r.createElementBlock("div",Cm)):r.createCommentVNode("",!0),F[9]||(F[9]=r.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),_.value?(r.openBlock(),r.createElementBlock("div",vm,[r.createElementVNode("div",Dm,[F[10]||(F[10]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",Nm,[r.createVNode(me,{modelValue:u.value,"onUpdate:modelValue":F[3]||(F[3]=Z=>u.value=Z),options:$.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:F[4]||(F[4]=Z=>Qe(H.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",Om,[F[11]||(F[11]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",Tm,[r.createVNode(me,{modelValue:f.value,"onUpdate:modelValue":F[5]||(F[5]=Z=>f.value=Z),options:A,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F[6]||(F[6]=Z=>Qe(H.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,(Z,ht)=>(r.openBlock(),r.createElementBlock("div",{key:ht},[Z.editing?(r.openBlock(),r.createElementBlock("div",Pm,[r.createVNode(De,{class:"mt-5"}),r.createElementVNode("div",Bm,[F[12]||(F[12]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",Mm,[r.createVNode(me,{modelValue:Z.columnName,"onUpdate:modelValue":Oe=>Z.columnName=Oe,options:R(ht),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Oe=>G(Z)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",Vm,[F[13]||(F[13]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",Am,[r.createVNode(me,{modelValue:Z.operator,"onUpdate:modelValue":Oe=>Z.operator=Oe,options:se(Z),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",Fm,[F[14]||(F[14]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",$m,[ne(Z)=="numeric"?(r.openBlock(),r.createBlock(Ye,{key:0,format:!1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Oe=>Z.value=Oe,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):ne(Z)=="date"?(r.openBlock(),r.createBlock(St,{key:1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Oe=>Z.value=Oe,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(he,{key:2,modelValue:Z.value,"onUpdate:modelValue":Oe=>Z.value=Oe,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",Im,[r.createVNode(Ae,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Oe=>te(Z)},null,8,["onClick"]),r.createVNode(Ae,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Oe=>Y(ht)},null,8,["onClick"])])])):r.createCommentVNode("",!0),Z.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Lm,[r.createVNode(De),r.createElementVNode("div",Rm,[r.createElementVNode("span",null,[Z.columnName||Z.operator||Z.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!Z.columnName})},r.toDisplayString(Z.columnName?" "+Z.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!E[Z.operator]})},r.toDisplayString(Z.operator?" "+E[Z.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!Z.value})},r.toDisplayString(Z.value?" "+Z.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",jm,"Filter is empty"))]),r.createVNode(Ae,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Oe=>te(Z)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",zm,[r.createVNode(De),r.createElementVNode("div",Wm,[r.createVNode(Ae,{style:{width:"100px"},label:"Add",disabled:P.value.length===h.value.length,icon:"",severity:"success",onClick:Q},null,8,["disabled"]),r.createVNode(Ae,{style:{width:"100px"},label:"Apply",severity:"info",onClick:ce})])])])):r.createCommentVNode("",!0),r.createElementVNode("div",Hm,[r.createElementVNode("div",Um,r.toDisplayString((nn=s.value)==null?void 0:nn.totalRecords),1),r.createElementVNode("div",qm,r.toDisplayString((_n=s.value)==null?void 0:_n.entityName),1)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value.result,(Z,ht)=>(r.openBlock(),r.createElementBlock("div",{key:ht},[r.createElementVNode("div",Ym,[r.createVNode(Ke,{disabled:k(Z[d.value.name]),modelValue:o.value,"onUpdate:modelValue":F[7]||(F[7]=Oe=>o.value=Oe),value:Z[d.value.name]},null,8,["disabled","modelValue","value"]),r.createElementVNode("div",Km,[r.createTextVNode(r.toDisplayString(n.linkedEntity.entityName)+" ",1),r.createElementVNode("span",null,r.toDisplayString(Z[d.value.name]),1)]),k(Z[d.value.name])?r.withDirectives((r.openBlock(),r.createElementBlock("div",Xm,null,512)),[[tn,"This record is already associated.",void 0,{left:!0}]]):r.createCommentVNode("",!0)])]))),128)),r.createVNode(st,{rows:m.value,totalRecords:g.value,rowsPerPageOptions:[10,25,50,100],onPage:it,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),r.createElementVNode("div",Gm,[r.createVNode(De,{class:"mt-5"}),r.createElementVNode("div",Qm,[r.createElementVNode("div",Jm,[r.createVNode(Ae,{label:"Cancel",icon:"",severity:"secondary",onClick:F[8]||(F[8]=Z=>t.value=!1)})]),r.createElementVNode("div",Zm,[r.createVNode(Ae,{label:"Save",severity:"success",onClick:B})])])])],64)}}},[["__scopeId","data-v-5172abef"]]),tp={class:"field flex flex-col"},np={key:0,class:"flex items-center"},ip={key:1},sp={class:"flex items-center"},op={class:"flex flex-col justify-center"},rp={class:"flex flex-row justify-between items-center"},ap={class:"justify-start"},lp={class:"justify-start"},cp={__name:"EntityLookupObject",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){Je.useRoute();const e=n,t=r.useModel(n,"modelValue"),i=new sn,s=r.ref({}),o=r.ref({});let a=r.ref("");const l=r.ref({}),c=r.ref({});r.onMounted(async()=>{console.log("linkedEntity"),console.log(e.linkedEntity),console.log("entity360Name"),console.log(e.entity360Name),console.log("entity360Id"),console.log(e.entity360Id),await u(),await d()});const d=async()=>{try{const g=await i.getEntityRecords(e.linkedEntity.entityName);g&&g.response&&(s.value=g.response,await f(g.response.entity.entityDefinition.columns),await m(),console.log(s.value))}catch{}finally{}},u=async()=>{try{const g=await i.getRecord(e.entity360Name,e.entity360Id);g&&g.response&&(o.value=g.response,await h(g.response.entity.entityDefinition.columns),console.log(o.value))}catch{}finally{}},f=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(b.primaryKey&&b.primaryKey==!0){l.value=b;break}}},h=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(!b.autoGeneerated&&b.foreignKey&&b.foreignKey.referencedEntityName.toLowerCase()==e.linkedEntity.entityName.toLowerCase()){c.value=b;break}}},m=async()=>{for(let g=0;g<s.value.result.length;g++){const y=s.value.result[g];if(y[l.value.name]==o.value.result[0][c.value.name]){a.value=y;break}}},p=()=>{const g={linkedEntityRecordId:a.value[l.value.name],linkedEntityName:e.linkedEntity.entityName,relationType:"ManyToOne"};e.saveExistingEntityObject(g)};return(g,y)=>{const b=r.resolveComponent("Select"),_=r.resolveComponent("Divider"),w=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock("div",tp,[r.createVNode(b,{modelValue:r.unref(a),"onUpdate:modelValue":y[0]||(y[0]=E=>r.isRef(a)?a.value=E:a=E),"item-value":l.value.name,options:s.value.result,filter:"",optionLabel:l.value.name,placeholder:"Select "+l.value.name,class:"w-full"},{value:r.withCtx(E=>[E.value?(r.openBlock(),r.createElementBlock("div",np,[r.createElementVNode("div",null,r.toDisplayString(E.value[l.value.name]),1)])):(r.openBlock(),r.createElementBlock("span",ip,r.toDisplayString(E.placeholder),1))]),option:r.withCtx(E=>[r.createElementVNode("div",sp,[r.createElementVNode("div",null,r.toDisplayString(E.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),r.createElementVNode("div",op,[r.createVNode(_),r.createElementVNode("div",rp,[r.createElementVNode("div",ap,[r.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=E=>t.value=!1)})]),r.createElementVNode("div",lp,[r.createVNode(w,{label:"Save",severity:"success",onClick:p})])])])])}}},dp={style:{"font-weight":"700","font-size":"1.25rem"}},up={class:"flex flex-col"},fp={class:"flex flex-row justify-between items-center"},hp={class:"justify-start"},mp={class:"justify-start"},pp="",gp={__name:"CreateRelatedentity",props:r.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(n,{emit:e}){const t=r.useModel(n,"showCreateRelatedEntityForm");Je.useRoute();const i=n,s=i.linkedEntity.entityName,o=e,a=r.ref("Add existing");r.onMounted(()=>{m()});const{formData:l,columns:c,errors:d,backendErrors:u,clearErrors:f,saveRecord:h,fetchAllRecords:m,saveRelatedEntityRecord:p}=io(s,pp,o),g=()=>{for(let w=0;w<c.value.length;w++){const E=c.value[w];!E.autoGenerated&&E.foreignKey&&(l.value[E.name]=i.entity360Id)}const _={relationType:i.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]}};h(_)},y=_=>{var w;if(((w=_==null?void 0:_.linkRecordIdList)==null?void 0:w.length)>0){const E={entityLinkage:[{linkEntityName:_.linkEntityName,linkRecordIdList:_.linkRecordIdList}]};p(i.entity360Name,i.entity360Id,E)}},b=_=>{const w={entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]};p(_.linkedEntityName,_.linkedEntityRecordId,w)};return(_,w)=>{const E=r.resolveComponent("Tab"),k=r.resolveComponent("TabList"),C=r.resolveComponent("Divider"),S=r.resolveComponent("Button"),x=r.resolveComponent("TabPanel"),v=r.resolveComponent("TabPanels"),B=r.resolveComponent("Tabs"),D=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(D,{visible:t.value,"onUpdate:visible":w[3]||(w[3]=T=>t.value=T),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:r.withCtx(()=>[r.createElementVNode("span",dp,r.toDisplayString(a.value)+" "+r.toDisplayString(n.linkedEntity.entityName),1)]),default:r.withCtx(()=>[r.createVNode(B,{value:"1"},{default:r.withCtx(()=>[r.createVNode(k,null,{default:r.withCtx(()=>[r.createVNode(E,{value:"0"},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Create new")])),_:1}),r.createVNode(E,{value:"1"},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Add existing")])),_:1})]),_:1}),r.createVNode(v,null,{default:r.withCtx(()=>[r.createVNode(x,{value:"0"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c),(T,I)=>{var q;return r.openBlock(),r.createElementBlock("div",{key:I,class:"mt-3"},[!T.autoGenerated&&!T.foreignKey?(r.openBlock(),r.createBlock(zi,{key:0,modelValue:r.unref(l)[T.name],"onUpdate:modelValue":L=>r.unref(l)[T.name]=L,column:T,errors:(q=r.unref(d)[T.name])==null?void 0:q.messages,onInput:r.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0)])}),128)),r.createElementVNode("div",up,[r.createVNode(C),r.createElementVNode("div",fp,[r.createElementVNode("div",hp,[r.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:w[0]||(w[0]=T=>t.value=!1)})]),r.createElementVNode("div",mp,[r.createVNode(S,{label:"Save",severity:"success",onClick:g})])])])]),_:1}),r.createVNode(x,{value:"1"},{default:r.withCtx(()=>[n.linkedEntity.relationType=="ONE_TO_MANY"?(r.openBlock(),r.createBlock(ep,{key:0,modelValue:t.value,"onUpdate:modelValue":w[1]||(w[1]=T=>t.value=T),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,saveExistingRelatedEntityRecord:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0),n.linkedEntity.relationType=="MANY_TO_ONE"?(r.openBlock(),r.createBlock(cp,{key:1,modelValue:t.value,"onUpdate:modelValue":w[2]||(w[2]=T=>t.value=T),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,saveExistingEntityObject:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},yp={class:"flex flex-col border-bottom-section pb-3 pt-3"},bp={class:"flex items-center pl-3 pr-3 justify-between"},xp={key:0,class:"pi pi-caret-right"},_p={key:1,class:"pi pi-caret-down"},kp={class:"ml-3 font-bold"},Sp={class:"ml-1"},wp={class:"text-right"},Ep={key:0},Cp=Be({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(n){Je.useRoute();const e=n,t=r.ref(!1),i=r.ref(!1),s=()=>{t.value=!t.value},o=()=>{i.value=!i.value},a=()=>{i.value=!1,e.onSaveRelatedEnttity()},l=r.computed(()=>e.linkedEntity.list.filter(c=>!c.is_deleted).length);return(c,d)=>{const u=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",yp,[r.createElementVNode("div",bp,[r.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:d[0]||(d[0]=f=>s())},[t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",xp)),t.value?(r.openBlock(),r.createElementBlock("div",_p)):r.createCommentVNode("",!0),r.createElementVNode("div",kp,r.toDisplayString(n.linkedEntity.entityName),1),r.createElementVNode("div",Sp," ("+r.toDisplayString(l.value)+") ",1)]),r.createElementVNode("div",wp,[r.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:d[1]||(d[1]=f=>o())})])]),t.value?(r.openBlock(),r.createElementBlock("div",Ep,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.linkedEntity.list,(f,h)=>(r.openBlock(),r.createElementBlock("div",{class:"flex flex-col",key:h},[f.is_deleted?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(_m,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):r.createCommentVNode("",!0)]),i.value?(r.openBlock(),r.createBlock(gp,{key:0,showCreateRelatedEntityForm:i.value,"onUpdate:showCreateRelatedEntityForm":d[2]||(d[2]=f=>i.value=f),linkedEntity:n.linkedEntity,entity360Name:n.entity360Name,entity360Id:n.entity360Id,onOnSaveDialog:a},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),vp={key:0},Dp={class:"flex"},Np={class:"p-3 mt-3 flex-col items-center"},Op={key:0,class:"pi pi-caret-right"},Tp={key:1,class:"pi pi-caret-down"},Pp={class:"font-bold ml-2"},Bp={key:0,class:"flex flex-col mt-4"},Mp={class:"flex flex-col mt-2"},Vp={class:"flex flex-row flex-wrap justify-between pl-5"},Ap={class:"flex flex-col"},Fp={class:"font-bold"},$p={class:"mt-2"},Ip={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},Lp={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},Rp={key:0,class:"custom-sidebar"},jp={class:"custom-sidebar-content"},zp={class:"custom-sidebar-button"},Wp={class:"custom-sidebar-text"},Na=Be({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String},dynamicPropName:{type:String,default:"item"},linkedEntity:Array},emits:["onSaveDialog"],setup(n,{expose:e,emit:t}){var T,I;const i=Ze(),s=Je.useRoute(),o=n,a=r.ref(!0),l=r.ref(!1),c=r.ref([]);let d=(T=s==null?void 0:s.params)==null?void 0:T.entityName,u=(I=s==null?void 0:s.params)==null?void 0:I.id;o.entityName&&(d=o.entityName),o.recordId&&(u=o.recordId);const f=t,{formData:h,columns:m,errors:p,backendErrors:g,isDataChange:y,linkedEntities:b,primarayColumn:_,clearErrors:w,saveRecord:E,getRelatedEntityRecordById:k,cancleRecord:C}=io(d,u,f);r.watch(()=>i.globalConfigs.appId,async q=>{q&&k()},{immediate:!0});const S=()=>{a.value=!a.value},x=()=>{l.value=!l.value},v=()=>{k()};return e({getLists:q=>{if(!c.value||c.value.length===0)return[];const L=c.value.find(A=>A.entityName===q&&A.type==="LIST");return L&&L.list?L.list:[]},getOne:q=>{if(!c.value||c.value.length===0)return[];const L=c.value.find(A=>A.entityName===q&&A.type==="Object");return L&&L.list?L.list:[]}}),r.watch(()=>b.value,q=>{Array.isArray(q)&&q.length>0&&q[0]&&(c.value=q)},{immediate:!0,deep:!0}),(q,L)=>{var Q;const A=r.resolveComponent("SplitterPanel"),j=r.resolveComponent("Tab"),$=r.resolveComponent("TabList"),P=r.resolveComponent("TabPanel"),R=r.resolveComponent("TabPanels"),G=r.resolveComponent("Tabs"),se=r.resolveComponent("Splitter"),ne=r.resolveComponent("Button");return q.$slots["list-item-display-360"]?(r.openBlock(),r.createElementBlock("div",vp,[r.renderSlot(q.$slots,"header",{},void 0,!0),r.createElementVNode("div",null,[r.createElementVNode("p",null,"This is the Entity360 component for: "+r.toDisplayString(r.unref(d)),1),r.renderSlot(q.$slots,"list-item-display-360",r.normalizeProps({[n.dynamicPropName||""]:{formData:r.unref(h),columns:r.unref(m),linkedEntities:r.unref(b),errors:r.unref(p),recordId:r.unref(u),entityName:r.unref(d)}}),void 0,!0)]),r.renderSlot(q.$slots,"footer",{},void 0,!0)])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",Dp,[r.createVNode(se,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:r.withCtx(()=>[r.createVNode(A,{size:20,minSize:10,maxSize:20},{default:r.withCtx(()=>[r.createElementVNode("div",Np,[r.createElementVNode("div",{onClick:L[0]||(L[0]=Y=>S()),class:"section-heading cursor-pointer"},[a.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("i",Op)),a.value?(r.openBlock(),r.createElementBlock("i",Tp)):r.createCommentVNode("",!0),r.createElementVNode("span",Pp," About this "+r.toDisplayString(r.unref(d)),1)]),a.value?(r.openBlock(),r.createElementBlock("div",Bp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(m),(Y,te)=>{var ce;return r.openBlock(),r.createElementBlock("div",{key:te},[Y.autoGenerated?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(zi,{key:0,modelValue:r.unref(h)[Y.name],"onUpdate:modelValue":_e=>r.unref(h)[Y.name]=_e,column:Y,errors:(ce=r.unref(p)[Y.name])==null?void 0:ce.messages,onInput:r.unref(w)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):r.createCommentVNode("",!0)])]),_:1}),r.createVNode(A,{size:55,minSize:35,style:{height:"100%"}},{default:r.withCtx(()=>[r.createVNode(G,{value:"0"},{default:r.withCtx(()=>[r.createVNode($,null,{default:r.withCtx(()=>[r.createVNode(j,{value:"0"},{default:r.withCtx(()=>L[3]||(L[3]=[r.createTextVNode("Overview")])),_:1}),r.createVNode(j,{value:"1"},{default:r.withCtx(()=>L[4]||(L[4]=[r.createTextVNode("Activity")])),_:1})]),_:1}),r.createVNode(R,null,{default:r.withCtx(()=>[r.createVNode(P,{value:"0"},{default:r.withCtx(()=>[r.createElementVNode("div",Mp,[L[5]||(L[5]=r.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),r.createElementVNode("div",Vp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(m).filter(Y=>Y.autoGenerated),(Y,te)=>(r.openBlock(),r.createElementBlock("div",{key:te,class:"column-item"},[r.createElementVNode("div",Ap,[r.createElementVNode("div",Fp,r.toDisplayString(Y.name),1),r.createElementVNode("div",$p,[r.createVNode(ro,{column:Y,value:r.unref(h)[Y.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),r.createVNode(P,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((Q=r.unref(b))==null?void 0:Q.length)>0?(r.openBlock(),r.createElementBlock("div",Ip,[l.value?(r.openBlock(),r.createBlock(ne,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:x,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):r.createCommentVNode("",!0),l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(ne,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:x,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),l.value?(r.openBlock(),r.createElementBlock("div",Lp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(b),(Y,te)=>(r.openBlock(),r.createElementBlock("div",{key:te},[r.createVNode(Cp,{entity360Name:r.unref(d),entity360Id:r.unref(u),linkedEntity:Y,onSaveRelatedEnttity:v},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),r.unref(y)?(r.openBlock(),r.createElementBlock("div",Rp,[r.createElementVNode("div",jp,[r.createElementVNode("div",zp,[r.createVNode(ne,{severity:"primary",onClick:L[1]||(L[1]=Y=>r.unref(E)())},{default:r.withCtx(()=>L[6]||(L[6]=[r.createTextVNode("Save")])),_:1}),r.createVNode(ne,{style:{"margin-left":"10px"},severity:"secondary",onClick:L[2]||(L[2]=Y=>r.unref(C)())},{default:r.withCtx(()=>L[7]||(L[7]=[r.createTextVNode("Cancel")])),_:1})]),r.createElementVNode("div",Wp," You've changed property in the "+r.toDisplayString(r.unref(d))+". ",1)])])):r.createCommentVNode("",!0)],64))}}},[["__scopeId","data-v-afa6815a"]]);function ns(){const n=new sn;let{errors:e,setErrors:t}=Vr(),i=r.reactive({data:null});const s=C=>{i.data=C},o=async C=>{try{const S=await n.getEntityRecords(C);if(S&&S.response)return S}catch(S){return console.error("Error fetching entity:",S.errorMessage),S}finally{}},a=async(C,S)=>{try{let x=await n.addRecord(C.entityName,S);if(x)return x}catch(x){return x}finally{}},l=async(C,S,x)=>{try{const v=await n.updateRecord(C.entityName,S,x);if(v&&v.response)return v}catch(v){return v}finally{}},c=async(C,S)=>{try{S.filter==null&&(S.filter={}),Object.keys(S.filter).length===0&&(S.filter=[]);const x=await n.searchEntityRecords(C.entityName,S);if(x)return x.response.sortBy=S.sortBy,x.response.filters=S.filter,x.response.sortDirection=S.sortDirection,x.response.fullTextSearch=S.fullTextSearch,x}catch(x){return x}finally{}},d=async(C,S)=>{try{const x=await n.deleteRecord(C.entityName,S);if(x)return x}catch(x){console.error("Error on deleting record:",x.errorMessage)}finally{}},u=C=>C.result,f=C=>{var S,x;return(x=(S=C==null?void 0:C.entity)==null?void 0:S.entityDefinition)==null?void 0:x.columns},h=C=>{const S=C.entity.entityDefinition.columns;let x={};for(let v=0;v<S.length;v++){const B=S[v];if(B.primaryKey&&B.primaryKey==!0){x=B;break}}return x},m=C=>{const S=C.entity.entityDefinition.columns;let x={};for(let v=0;v<S.length;v++){let B=S[v];B.autoGenerated||(x[B.name]="")}return x},p=(C,S)=>{let x="";const v=C.entity.entityDefinition.columns;for(let B=0;B<v.length;B++){let D=v[B];if(S==D.name){x=D.type;break}}return x},g=(C,S)=>{const v=C.entity.entityDefinition.columns.filter(D=>D.autoGenerated).map(D=>D.name);return Object.entries(S).filter(([D])=>!v.includes(D)).map(([D,T])=>({recordColumnName:D,recordColumnValue:T,columnType:p(i.data,D)}))},y=()=>{const C=i.data.entity.entityDefinition.columns;return no().shape(C.reduce((x,v)=>(v.autoGenerated||(x[v.name]=to().nullable(!1).test({name:"custom-validation",test:function(B){const D=[];let T="";if(v.required&&(!B||B.trim()===""))if(v.validations){T=b(v.validations,"VALIDATE_REQUIRED"),D.push(T);let I=w(v.validations,"VALIDATE_REQUIRED");I&&(I="hint:"+I,D.push(I))}else T=v.displayName+" is required.",D.push(T);else{if(v.maxLength&&B.length>v.maxLength)if(v.validations){T=b(v.validations,"VALIDATE_MAXLENGTH"),D.push(T);let I=w(v.validations,"VALIDATE_MAXLENGTH");I&&(I="hint:"+I,D.push(I))}else T=v.displayName+" cannot exceed from "+v.maxLength+" characters",D.push(T);if(v.regxId&&!new RegExp(_(v.validations,"VALIDATE_REGX")).test(B))if(v.validations){T=b(v.validations,"VALIDATE_REGX"),D.push(T);let I=w(v.validations,"VALIDATE_REGX");I&&(I="hint:"+I,D.push(I))}else T=v.displayName+" invalid format.",D.push(T)}return D.length>0?this.createError({message:D}):!0}})),x),{}))},b=(C,S)=>{for(let x=0;x<C.length;x++)if(S==C[x].type)return C[x].message},_=(C,S)=>{for(let x=0;x<C.length;x++)if(S==C[x].type)return C[x].regx},w=(C,S)=>{for(let x=0;x<C.length;x++)if(S==C[x].type)return C[x].hint};return{state:i,setEntity:s,getEntity:o,addRecord:a,updateRecord:l,searchRecord:c,entityRecordDelete:d,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:h,getFormData:m,createDataToSave:g,createValidationSchema:y,clearErrors:C=>(t({...e.value,[C]:null}),e.value),validateData:async(C,S)=>{try{return await C.validate(S,{abortEarly:!1}),t({}),{validate:!0}}catch(x){const v=x.inner.reduce((T,I)=>(T[I.path]||(T[I.path]={messages:[]}),T[I.path].messages.push(...I.errors),T),{}),B=Object.entries(v).reduce((T,[I,q])=>(T[I]={messages:q.messages},T),{});return t(B),{validate:!1,errors:e.value}}}}}const is={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(n,{emit:e}){const t=r.useModel(n,"showDeleteDialog"),i=e,s=o=>{i("onDeleteItem",{remove:o})};return(o,a)=>{const l=r.resolveComponent("Button"),c=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(c,{visible:t.value,"onUpdate:visible":a[2]||(a[2]=d=>t.value=d),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(l,{label:"No",icon:"pi pi-times",text:"",onClick:a[0]||(a[0]=d=>s(!1))}),r.createVNode(l,{label:"Yes",icon:"pi pi-check",text:"",onClick:a[1]||(a[1]=d=>s(!0))})]),default:r.withCtx(()=>[a[3]||(a[3]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},Hp={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Up={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},ei={__name:"EntityFormDialog",props:r.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(n){const e=r.useModel(n,"showEntityForm"),t=r.inject("entityObject"),i=n;let s=r.ref([]),o=r.ref({}),a=r.ref([]),l=r.ref(null),c=r.ref({});r.onMounted(()=>{s.value=t.getEntityColumns(t.state.data),i.item?o.value=JSON.parse(JSON.stringify(i.item)):o.value=t.getFormData(t.state.data),l.value=t.createValidationSchema()});const d=async()=>{const m=await t.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p=t.getPrimaryKeyColumn(t.state.data),g=i.item[p.name],y={dataDefinitions:t.createDataToSave(t.state.data,o.value)},b=await t.updateRecord(t.state.data,g,y);if(b&&b.success){e.value=!1;const _={sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch},w=await t.searchRecord(t.state.data,_);if(w!=null&&w.response){let E=w==null?void 0:w.response;t.setEntity(E)}}else b.validationErrors&&(a.value=JSON.parse(JSON.stringify(b.errvalidationErrorsors)))},u=async()=>{const m=await t.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p={dataDefinitions:t.createDataToSave(t.state.data,o.value)},g=await t.addRecord(t.state.data,p);g&&g.success?(e.value=!1,t.state.data=await t.getEntity(t.state.data.entityName)):g.validationErrors&&(a.value=JSON.parse(JSON.stringify(g.errvalidationErrorsors)))},f=async()=>{i.item?d():u()},h=m=>{c.value=t.clearErrors(m)};return(m,p)=>{const g=r.resolveComponent("Button"),y=r.resolveComponent("Dialog");return e.value?(r.openBlock(),r.createBlock(y,{key:0,showFooter:!1,visible:e.value,"onUpdate:visible":p[2]||(p[2]=b=>e.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[n.item?(r.openBlock(),r.createElementBlock("span",Hp,"Edit "+r.toDisplayString(r.unref(t).state.data.entityName)+" record details",1)):r.createCommentVNode("",!0),n.item?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Up,"Add "+r.toDisplayString(r.unref(t).state.data.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>e.value=!1)}),r.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>f())})]),default:r.withCtx(()=>{var b;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(_,w)=>{var E;return r.openBlock(),r.createElementBlock("div",{key:w},[!_.autoGenerated&&!_.foreignKey?(r.openBlock(),r.createBlock(zi,{key:0,modelValue:r.unref(o)[_.name],"onUpdate:modelValue":k=>r.unref(o)[_.name]=k,column:_,errors:(E=r.unref(c)[_.name])==null?void 0:E.messages,onInput:h},null,8,["modelValue","onUpdate:modelValue","column","errors"])):r.createCommentVNode("",!0),!_.autoGenerated&&_.foreignKey?(r.openBlock(),r.createBlock(Qr,{key:1,modelValue:r.unref(o)[_.name],"onUpdate:modelValue":k=>r.unref(o)[_.name]=k,entityName:_.foreignKey.referencedEntityName,columnName:_.name,relatedEntityColumn:_.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((b=r.unref(a))==null?void 0:b.length)>0?(r.openBlock(),r.createBlock(Gr,{key:0,errors:r.unref(a)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},qp={class:"flex justify-between items-start"},Yp={class:"flex-grow-1"},Kp={class:"tile-grid"},Xp={class:"font-bold text-lg text-700"},Gp={class:"flex flex-col gap-2"},Qp=Be({__name:"EntityListSingleRecord",props:{item:Object},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(!1),o=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data)});const a=()=>{s.value=!0},l=()=>{o.value=!0},c=u=>{u.remove==!0?d():s.value=!1},d=async()=>{const u=t.getPrimaryKeyColumn(t.state.data),f=e.item[u.name],h=await t.entityRecordDelete(t.state.data,f);if(h!=null&&h.success){s.value=!1;const m={sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch},p=await t.searchRecord(t.state.data,m);if(p!=null&&p.response){let g=p==null?void 0:p.response;t.setEntity(g)}console.log(h)}};return(u,f)=>{const h=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",qp,[r.createElementVNode("div",Yp,[r.createElementVNode("div",Kp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[r.createElementVNode("span",Xp,r.toDisplayString(m.name)+" : ",1),r.createVNode(ro,{column:m,value:n.item[m.name]},null,8,["column","value"])]))),128))])]),r.createElementVNode("div",Gp,[r.createVNode(h,{onClick:f[0]||(f[0]=m=>l()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),r.createVNode(h,{onClick:f[1]||(f[1]=m=>a()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),o.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:o.value,"onUpdate:showEntityForm":f[2]||(f[2]=m=>o.value=m),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createBlock(is,{key:1,showDeleteDialog:s.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=m=>s.value=m),onOnDeleteItem:c},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ea3b758f"]]),Jp=Be({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(n){const e=r.inject("entityObject"),t=r.ref([]);return r.watch(()=>e.state.data,i=>{i&&(t.value=i.result,console.log("Entity state updated in child:",e))},{immediate:!0}),(i,s)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.value,(o,a)=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:Qp),r.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),Zp={};function eg(n,e){return null}const tg=Be(Zp,[["render",eg]]),ng={class:"my-2"},ig={class:"m-0"},sg={__name:"EntityListHeaderSlot",setup(n){const e=r.inject("entityObject");let t=r.ref("");return r.watch(()=>e.state.data,i=>{i&&(t.value=i.entityName)},{immediate:!0}),(i,s)=>{const o=r.resolveComponent("Toolbar");return r.openBlock(),r.createBlock(o,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",ng,[r.createElementVNode("h2",ig,"EntityName: "+r.toDisplayString(r.unref(t)),1)])]),end:r.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},og={class:"flex flex-col mb-5"},rg={class:"col-12"},ag={class:"flex flex-col mb-5"},lg={class:"col-12"},cg={key:0},dg={class:"flex flex-col mb-5"},ug={class:"col-12"},fg={class:"flex flex-col mb-5"},hg={class:"col-12"},mg={class:"flex flex-col mb-5"},pg={class:"col-12"},gg={class:"flex flex-row justify-between items-center"},yg={key:1},bg={class:"flex flex-row justify-between items-center"},xg={key:1,class:"text-red-500"},_g={class:"flex flex-col"},kg={class:"flex flex-row justify-between items-center"},Sg={__name:"FilterSortSidebar",props:r.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(n){const e=r.useModel(n,"sortBy"),t=r.useModel(n,"sortDirection"),i=r.useModel(n,"showFilter"),s=r.useModel(n,"filters"),o={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"},a=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],l=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],c=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],d=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const h=r.computed(()=>n.headers.filter(S=>S.sortable)),m=r.computed(()=>n.headers.filter(S=>S.filterable)),p=S=>n.headers.filter(x=>{var v;return x.filterable?((v=s.value[S])==null?void 0:v.columnName)===x.name?!0:!s.value.some((B,D)=>D!==S&&B.columnName===x.name):!1}).map(x=>({label:x.name,value:x.field})),g=S=>{let x="";switch(n.getDatatypeByField(S.columnName).toLowerCase()){case"string":case"uuid":x="startsWith";break;case"date":x="dateIs";break;case"numeric":case"int":case"integer":x="equals";break;case"bool":case"boolean":x="equals";break}S.operator=x,S.value=""},y=S=>{const x=n.getDatatypeByField(S.columnName);switch(x&&x.toLowerCase()){case"integer":case"int":case"numeric":f=l;break;case"date":f=d;break;case"bool":case"boolean":f=c;break;default:f=a}return f},b=S=>{if(S&&S.columnName){const x=n.getDatatypeByField(S.columnName);return n.getColumnDatatype(x)}else return""},_=()=>{for(let S=0;S<s.value.length;S++){const x=s.value[S];x.editing=!1}s.value.push({columnName:"",value:"",operator:"",editing:!0})},w=S=>{s.value.splice(S,1)},E=S=>{S.editing=!S.editing},k=()=>{let S=[],x=JSON.parse(JSON.stringify(s.value));for(let v=0;v<x.length;v++){const B=x[v];delete B.editing,B.columnName&&B.operator&&B.value&&(B.columnType=n.getDatatypeByField(B.columnName),B.operator=n.operatorMap[B.operator],S.push(B))}n.filterCallback(S)},C=()=>{n.sortCallback()};return(S,x)=>{const v=r.resolveComponent("Select"),B=r.resolveComponent("Divider"),D=r.resolveComponent("InputNumber"),T=r.resolveComponent("DatePicker"),I=r.resolveComponent("InputText"),q=r.resolveComponent("Button"),L=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(L,{visible:i.value,"onUpdate:visible":x[4]||(x[4]=A=>i.value=A),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:r.withCtx(()=>[r.createElementVNode("div",og,[x[5]||(x[5]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",rg,[r.createVNode(v,{modelValue:e.value,"onUpdate:modelValue":x[0]||(x[0]=A=>e.value=A),options:h.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:x[1]||(x[1]=A=>C(S.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",ag,[x[6]||(x[6]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",lg,[r.createVNode(v,{modelValue:t.value,"onUpdate:modelValue":x[2]||(x[2]=A=>t.value=A),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:x[3]||(x[3]=A=>C(S.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(A,j)=>(r.openBlock(),r.createElementBlock("div",{key:j},[A.editing?(r.openBlock(),r.createElementBlock("div",cg,[r.createVNode(B),r.createElementVNode("div",dg,[x[7]||(x[7]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",ug,[r.createVNode(v,{modelValue:A.columnName,"onUpdate:modelValue":$=>A.columnName=$,options:p(j),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:$=>g(A)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",fg,[x[8]||(x[8]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",hg,[r.createVNode(v,{modelValue:A.operator,"onUpdate:modelValue":$=>A.operator=$,options:y(A),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",mg,[x[9]||(x[9]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",pg,[b(A)=="numeric"?(r.openBlock(),r.createBlock(D,{key:0,format:!1,class:"w-full",modelValue:A.value,"onUpdate:modelValue":$=>A.value=$,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):b(A)=="date"?(r.openBlock(),r.createBlock(T,{key:1,class:"w-full",modelValue:A.value,"onUpdate:modelValue":$=>A.value=$,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(I,{key:2,modelValue:A.value,"onUpdate:modelValue":$=>A.value=$,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",gg,[r.createVNode(q,{label:"Hide",icon:"",severity:"warn",onClick:$=>E(A)},null,8,["onClick"]),r.createVNode(q,{label:"Delete",icon:"",severity:"danger",onClick:$=>w(j)},null,8,["onClick"])])])):r.createCommentVNode("",!0),A.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",yg,[r.createVNode(B),r.createElementVNode("div",bg,[r.createElementVNode("span",null,[A.columnName||A.operator||A.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!A.columnName})},r.toDisplayString(A.columnName?" "+A.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!o[A.operator]})},r.toDisplayString(A.operator?" "+o[A.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!A.value})},r.toDisplayString(A.value?" "+A.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",xg,"Filter is empty"))]),r.createVNode(q,{label:"Edit",icon:"",severity:"info",onClick:$=>E(A)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",_g,[r.createVNode(B),r.createElementVNode("div",kg,[r.createVNode(q,{label:"Add",disabled:m.value.length===s.value.length,icon:"",severity:"success",onClick:_},null,8,["disabled"]),r.createVNode(q,{label:"Apply",severity:"info",onClick:k})])])]),_:1},8,["visible"])}}},wg={class:"my-2"},zt={__name:"EntityListFilters",setup(n){const e=r.inject("entityObject"),t=r.ref(!1),i=r.ref([]),s=r.ref([]),o=r.ref(""),a=r.ref(1);let l=r.ref("");const c=r.ref([]),d=r.ref([]),u={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};r.watch(()=>e.state.data,E=>{if(E&&(c.value=e.getEntityColumns(E),d.value=b(c.value),o.value=="")){const k=e.getPrimaryKeyColumn(E);o.value=k.name}},{immediate:!0});const f=()=>{t.value=!t.value},h=E=>{s.value=E,m()},m=async()=>{const E={sortBy:[o.value],sortDirection:a.value===1?"ASC":"DESC",pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:s.value,fullTextSearch:l.value},k=await e.searchRecord(e.state.data,E);if(k!=null&&k.success){let C=k==null?void 0:k.response;e.setEntity(C)}},p=()=>{m()},g=()=>{i.value=[],s.value=[],m()},y=()=>{m()},b=E=>E.map(k=>({field:k.name,name:k.displayName?k.displayName:k.name,filterable:k.filterable,datatype:k.type,sortable:k.indexColumn,displayFormatKey:k.displayFormatKey,displayFormat:k.displayFormat})),_=E=>{switch(E.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},w=E=>{const k=c.value.find(C=>C.name===E);return k?k.type:null};return(E,k)=>{const C=r.resolveComponent("Button"),S=r.resolveComponent("InputIcon"),x=r.resolveComponent("InputText"),v=r.resolveComponent("IconField"),B=r.resolveComponent("Toolbar");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(B,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",wg,[r.createVNode(C,{type:"button",size:"medium",icon:"pi pi-filter",label:"Filter",severity:"info",onClick:k[0]||(k[0]=D=>f())})]),r.createVNode(C,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warn",onClick:k[1]||(k[1]=D=>g())})]),end:r.withCtx(()=>[r.createVNode(v,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(S,{onClick:k[2]||(k[2]=D=>y()),class:"pi pi-search"}),r.createVNode(x,{class:"w-full sm:w-auto",onKeyup:k[3]||(k[3]=r.withKeys(D=>y(),["enter"])),modelValue:r.unref(l),"onUpdate:modelValue":k[4]||(k[4]=D=>r.isRef(l)?l.value=D:l=D),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),r.createVNode(Sg,{sortBy:o.value,"onUpdate:sortBy":k[5]||(k[5]=D=>o.value=D),sortDirection:a.value,"onUpdate:sortDirection":k[6]||(k[6]=D=>a.value=D),showFilter:t.value,"onUpdate:showFilter":k[7]||(k[7]=D=>t.value=D),filters:i.value,"onUpdate:filters":k[8]||(k[8]=D=>i.value=D),headers:d.value,operatorMap:u,sortCallback:p,filterCallback:h,getColumnDatatype:_,getDatatypeByField:w},null,8,["sortBy","sortDirection","showFilter","filters","headers"])],64)}}},ti={__name:"EntityListPagination",setup(n){const e=r.ref(25),t=r.ref(0),i=r.ref(0),s=r.ref(0);let o=r.inject("entityObject");const a=async l=>{e.value=l.rows,t.value=l.page,s.value=l.first;const c={sortBy:o.state.data.sortBy,sortDirection:o.state.data.sortDirection,columnList:null,filter:o.state.data.filters,fullTextSearch:o.state.data.fullTextSearch,pageSize:e.value,currentPage:t.value},d=await o.searchRecord(o.state.data,c);if(d!=null&&d.success){let u=d==null?void 0:d.response;o.setEntity(u),i.value=d.response.totalRecords,s.value=t.value*e.value}};return r.watch(()=>{var l,c;return(c=(l=o==null?void 0:o.state)==null?void 0:l.data)==null?void 0:c.totalRecords},l=>{i&&(i.value=l)},{immediate:!0}),(l,c)=>{const d=r.resolveComponent("Paginator");return r.openBlock(),r.createBlock(d,{class:"my-4",rows:e.value,totalRecords:i.value,rowsPerPageOptions:[10,25,50,100],onPage:a,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Eg={class:"flex flex-row justify-end p-2 my-2"},Wt={__name:"EntityListAddButton",setup(n){const e=r.ref(!1),t=()=>{e.value=!0};return(i,s)=>{const o=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Eg,[r.createVNode(o,{label:"Add",size:"medium",icon:"pi pi-plus",onClick:s[0]||(s[0]=a=>t())})]),e.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:e.value,"onUpdate:showEntityForm":s[1]||(s[1]=a=>e.value=a)},null,8,["showEntityForm"])):r.createCommentVNode("",!0)],64)}}},Oa={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(n,{expose:e}){const t=ns(),i=Ze();r.provide("entityObject",t);const s=n;return e({props:s,reload:()=>{console.log("reload data")}}),r.watch(()=>i.globalConfigs.appId,async a=>{if(a){const l=await t.getEntity(s.entityName);l.success?t.setEntity(l.response):t.setEntity({result:[]})}},{immediate:!0}),(a,l)=>{var c,d,u;return a.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.listFilerSlot?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((u=(d=(c=r.unref(t))==null?void 0:c.state)==null?void 0:d.data)==null?void 0:u.result)||[],f=>r.renderSlot(a.$slots,"list-item-display",{item:f})),256))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listHeader||sg))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt))),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listDisplay||Jp),r.normalizeProps(r.guardReactiveProps({listItemDisplay:n.listItemDisplay})),null,16)),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||ti))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFooter||tg)))],64))}}},Cg={key:0},vg=["href"],Dg={key:1},Ng={class:"action-buttons"},Og=Be({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listClass:String,listItemClass:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(n){const e=n;console.log("props entitylistsingle record",e.item);const t=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{var h;e.linkedEntity&&e.linkedEntity.length>0?i.value=Object.keys(e.linkedEntity[0]).map(m=>({name:m})):i.value=t==null?void 0:t.getEntityColumns(t.state.data),s.value=((h=i==null?void 0:i.value)==null?void 0:h.find(m=>m.name===e.displayField))||null,s.value&&(o.value=e==null?void 0:e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=t.getPrimaryKeyColumn(t.state.data),m=e.item[h.name],p=await t.entityRecordDelete(t.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await t.searchRecord(t.state.data,{sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch});g!=null&&g.response&&t.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("ul",{class:r.normalizeClass(e.className)},[s.value?(r.openBlock(),r.createElementBlock("li",Cg,[r.createElementVNode("a",{href:`${n.baseUrl}/${n.item[n.hrefKey]}`,target:"_blank",class:"hover:underline"},r.toDisplayString(o.value),9,vg)])):(r.openBlock(),r.createElementBlock("li",Dg,[r.createElementVNode("span",null,"No matching field found for '"+r.toDisplayString(o.value)+"'.",1)])),r.createElementVNode("li",Ng,[n.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),n.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])],2),l.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(is,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ff32a72b"]]),Tg={key:0,class:"error-message"},Pg={class:"text-red-500 font-bold"},Bg={key:0},Mg={key:1},Vg={key:2},Ag={key:3},Fg={key:1},Ta=Be({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(n,{expose:e}){const t=ns(),i=Ze();r.provide("entityObject",t);const s=n,o=r.ref([]);return s.linkedEntity?r.watch(()=>s.linkedEntity,c=>{c&&(o.value=c)},{immediate:!0}):r.watch(()=>t.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c)if(s.linkedEntity&&s.linkedEntity.length>0)t.setEntity(s.linkedEntity);else{const d=await t.getEntity(s.entityName);t.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return r.openBlock(),r.createElementBlock("div",r.mergeProps(c.$attrs,{class:"flex flex-col"}),[r.renderSlot(c.$slots,"header",{},void 0,!0),c.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(n.listClass)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.linkedEntity&&n.linkedEntity.length>0?n.linkedEntity:((h=(f=(u=r.unref(t))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],m=>r.renderSlot(c.$slots,"list-item-display",{item:m,class:r.normalizeClass(n.listItemClass)},void 0,!0)),256))],2),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||ti),{key:2})):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[!n.displayField||!n.baseUrl||!n.hrefKey?(r.openBlock(),r.createElementBlock("div",Tg,[r.createElementVNode("p",Pg,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Bg,"Entity Name")),n.displayField?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Mg,"Display Field")),n.baseUrl?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Vg,"Base Url")),n.hrefKey?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Ag,"Href Key"))])])):(r.openBlock(),r.createElementBlock("div",Fg,[n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:0})):r.createCommentVNode("",!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:Og),r.mergeProps({ref_for:!0},{item:m,...s}),null,16))]))),128)),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||ti),{key:2})):r.createCommentVNode("",!0)])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)),r.renderSlot(c.$slots,"footer",{},void 0,!0)],16)}}},[["__scopeId","data-v-b216f568"]]),$g={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},Ig={class:"flex justify-between items-start gap-4"},Lg={class:"flex-grow"},Rg={class:"flex flex-col gap-2"},jg={class:"font-bold text-gray-700"},zg={class:"text-gray-600"},Wg={class:"flex flex-col gap-2"},Hg=Be({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=t.getPrimaryKeyColumn(t.state.data),m=e.item[h.name],p=await t.entityRecordDelete(t.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await t.searchRecord(t.state.data,{sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch});g!=null&&g.response&&t.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",$g,[r.createElementVNode("div",Ig,[r.createElementVNode("div",Lg,[r.createElementVNode("div",Rg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",jg,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",zg,r.toDisplayString(n.item[g.name]),1)]))),128))])]),r.createElementVNode("div",Wg,[n.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),n.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(is,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-6ec4735d"]]),Ug={class:"flex flex-wrap gap-4 p-2"},qg={key:0,class:"error-message"},Yg={class:"text-red-500 font-bold"},Kg={key:0},Xg={key:1},Gg={class:"flex flex-wrap gap-4 p-4"},Pa=Be({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,dynamicPropName:{type:String,default:"item"}},setup(n,{expose:e}){const t=ns(),i=Ze();r.provide("entityObject",t);const s=n,o=r.ref([]);return r.watch(()=>t.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await t.getEntity(s.entityName);t.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[c.$slots["list-item-display-tile"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",Ug,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((h=(f=(u=r.unref(t))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[r.renderSlot(c.$slots,"list-item-display-tile",r.normalizeProps({[n.dynamicPropName||""]:m}),void 0,!0)]))),128))]),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.entityName?(r.openBlock(),r.createElementBlock("div",Xg,[n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:0})):r.createCommentVNode("",!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",Gg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(m,p)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay!=null&&n.listItemDisplay!=""?n.listItemDisplay:Hg),r.mergeProps({key:p,ref_for:!0},{item:m,...s}),null,16))),128))]),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||ti),{key:2})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",qg,[r.createElementVNode("p",Yg,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Kg,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-705f9c5c"]]),Qg={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},Jg={class:"flex justify-between items-start gap-4"},Zg={class:"flex-grow"},ey={class:"flex flex-col gap-2"},ty={class:"font-bold text-gray-700"},ny={class:"text-gray-600"},iy={class:"flex flex-col gap-2"},sy=Be({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n){const e=n,t=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=t.getEntityColumns(t.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=t.getPrimaryKeyColumn(t.state.data),m=e.item[h.name],p=await t.entityRecordDelete(t.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await t.searchRecord(t.state.data,{sortBy:t.state.data.sortBy,sortDirection:t.state.data.sortDirection,pageSize:t.state.data.pageSize,currentPage:t.state.data.currentPage,columnList:null,filter:t.state.data.filters,fullTextSearch:t.state.data.fullTextSearch});g!=null&&g.response&&t.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Qg,[r.createElementVNode("div",Jg,[r.createElementVNode("div",Zg,[r.createElementVNode("div",ey,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",ty,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",ny,r.toDisplayString(n.item[g.name]),1)]))),128))])]),r.createElementVNode("div",iy,[n.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),n.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(ei,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:n.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(is,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7e37c710"]]);/**
|
|
155
|
+
`)},Im={},jm={},Ft={name:"base",css:Lm,theme:$m,classes:Im,inlineStyles:jm,load:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(o){return o},s=i(ft(e,{dt:ii}));return Ce(s)?Tm(ni(s),jo({name:this.name},n)):{}},loadCSS:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return this.load(this.theme,n,function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Fe.transformCSS(n.name||e.name,"".concat(s).concat(i))})},getCommonTheme:function(e){return Fe.getCommon(this.name,e)},getComponentTheme:function(e){return Fe.getComponent(this.name,e)},getDirectiveTheme:function(e){return Fe.getDirective(this.name,e)},getPresetTheme:function(e,n,i){return Fe.getCustomPreset(this.name,e,n,i)},getLayerOrderThemeCSS:function(){return Fe.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.css){var i=ft(this.css,{dt:ii})||"",s=ni("".concat(i).concat(e)),o=Object.entries(n).reduce(function(r,l){var c=Za(l,2),d=c[0],u=c[1];return r.push("".concat(d,'="').concat(u,'"'))&&r},[]).join(" ");return Ce(s)?'<style type="text/css" data-primevue-style-id="'.concat(this.name,'" ').concat(o,">").concat(s,"</style>"):""}return""},getCommonThemeStyleSheet:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Fe.getCommonStyleSheet(this.name,e,n)},getThemeStyleSheet:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[Fe.getStyleSheet(this.name,e,n)];if(this.theme){var s=this.name==="base"?"global-style":"".concat(this.name,"-style"),o=ft(this.theme,{dt:ii}),r=ni(Fe.transformCSS(s,o)),l=Object.entries(n).reduce(function(c,d){var u=Za(d,2),f=u[0],h=u[1];return c.push("".concat(f,'="').concat(h,'"'))&&c},[]).join(" ");Ce(r)&&i.push('<style type="text/css" data-primevue-style-id="'.concat(s,'" ').concat(l,">").concat(r,"</style>"))}return i.join("")},extend:function(e){return jo(jo({},this),{},{css:void 0,theme:void 0},e)}},nl=Ft.extend({name:"common"});function ai(t){"@babel/helpers - typeof";return ai=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},ai(t)}function zm(t){return rl(t)||Um(t)||sl(t)||il()}function Um(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function li(t,e){return rl(t)||Wm(t,e)||sl(t,e)||il()}function il(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
156
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sl(t,e){if(t){if(typeof t=="string")return ol(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ol(t,e):void 0}}function ol(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Wm(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,s,o,r,l=[],c=!0,d=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&n.return!=null&&(r=n.return(),Object(r)!==r))return}finally{if(d)throw s}}return l}}function rl(t){if(Array.isArray(t))return t}function al(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function ce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?al(Object(n),!0).forEach(function(i){ci(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function ci(t,e,n){return(e=Hm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hm(t){var e=qm(t,"string");return ai(e)=="symbol"?e:e+""}function qm(t,e){if(ai(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(ai(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ym={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e){var n=this;e?(this._loadScopedThemeStyles(e),this._themeChangeListener(function(){return n._loadScopedThemeStyles(e)})):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,$attrSelector:void 0,beforeCreate:function(){var e,n,i,s,o,r,l,c,d,u,f,h=(e=this.pt)===null||e===void 0?void 0:e._usept,m=h?(n=this.pt)===null||n===void 0||(n=n.originalValue)===null||n===void 0?void 0:n[this.$.type.name]:void 0,p=h?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(s=p||m)===null||s===void 0||(s=s.hooks)===null||s===void 0||(o=s.onBeforeCreate)===null||o===void 0||o.call(s);var g=(r=this.$primevueConfig)===null||r===void 0||(r=r.pt)===null||r===void 0?void 0:r._usept,y=g?(l=this.$primevue)===null||l===void 0||(l=l.config)===null||l===void 0||(l=l.pt)===null||l===void 0?void 0:l.originalValue:void 0,b=g?(c=this.$primevue)===null||c===void 0||(c=c.config)===null||c===void 0||(c=c.pt)===null||c===void 0?void 0:c.value:(d=this.$primevue)===null||d===void 0||(d=d.config)===null||d===void 0?void 0:d.pt;(u=b||y)===null||u===void 0||(u=u[this.$.type.name])===null||u===void 0||(u=u.hooks)===null||u===void 0||(f=u.onBeforeCreate)===null||f===void 0||f.call(u),this.$attrSelector=Em("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=_m(this.$el,'[data-pc-name="'.concat(Xt(this.$.type.name),'"]')),this.rootEl&&(this.$attrSelector&&!this.rootEl.hasAttribute(this.$attrSelector)&&this.rootEl.setAttribute(this.$attrSelector,""),this.rootEl.$pc=ce({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(e){if(!this.$options.hostName){var n=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(e)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(e));n==null||n(),i==null||i()}},_mergeProps:function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return Ia(e)?e.apply(void 0,i):a.mergeProps.apply(void 0,i)},_loadStyles:function(){var e=this,n=function(){si.isStyleNameLoaded("base")||(Ft.loadCSS(e.$styleOptions),e._loadGlobalStyles(),si.setLoadedStyleName("base")),e._loadThemeStyles()};n(),this._themeChangeListener(n)},_loadCoreStyles:function(){var e,n;!si.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(n=this.$style)!==null&&n!==void 0&&n.name&&(nl.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),si.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);Ce(e)&&Ft.load(e,ce({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var e,n;if(!(this.isUnstyled||this.$theme==="none")){if(!Fe.isStyleNameLoaded("common")){var i,s,o=((i=this.$style)===null||i===void 0||(s=i.getCommonTheme)===null||s===void 0?void 0:s.call(i))||{},r=o.primitive,l=o.semantic,c=o.global,d=o.style;Ft.load(r==null?void 0:r.css,ce({name:"primitive-variables"},this.$styleOptions)),Ft.load(l==null?void 0:l.css,ce({name:"semantic-variables"},this.$styleOptions)),Ft.load(c==null?void 0:c.css,ce({name:"global-variables"},this.$styleOptions)),Ft.loadTheme(ce({name:"global-style"},this.$styleOptions),d),Fe.setLoadedStyleName("common")}if(!Fe.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(n=this.$style)!==null&&n!==void 0&&n.name){var u,f,h,m,p=((u=this.$style)===null||u===void 0||(f=u.getComponentTheme)===null||f===void 0?void 0:f.call(u))||{},g=p.css,y=p.style;(h=this.$style)===null||h===void 0||h.load(g,ce({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(m=this.$style)===null||m===void 0||m.loadTheme(ce({name:"".concat(this.$style.name,"-style")},this.$styleOptions),y),Fe.setLoadedStyleName(this.$style.name)}if(!Fe.isStyleNameLoaded("layer-order")){var b,x,w=(b=this.$style)===null||b===void 0||(x=b.getLayerOrderThemeCSS)===null||x===void 0?void 0:x.call(b);Ft.load(w,ce({name:"layer-order",first:!0},this.$styleOptions)),Fe.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(e){var n,i,s,o=((n=this.$style)===null||n===void 0||(i=n.getPresetTheme)===null||i===void 0?void 0:i.call(n,e,"[".concat(this.$attrSelector,"]")))||{},r=o.css,l=(s=this.$style)===null||s===void 0?void 0:s.load(r,ce({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=l.el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)===null||e===void 0||(e=e.value)===null||e===void 0||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};si.clearLoadedStyleNames(),Gt.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var n;return this[e]||((n=this._getHostInstance(this))===null||n===void 0?void 0:n[e])},_getOptionValue:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ja(e,n,i)},_getPTValue:function(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,r=/./g.test(i)&&!!s[i.split(".")[0]],l=this._getPropValue("ptOptions")||((e=this.$primevueConfig)===null||e===void 0?void 0:e.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o?r?this._useGlobalPT(this._getPTClassValue,i,s):this._useDefaultPT(this._getPTClassValue,i,s):void 0,m=r?void 0:this._getPTSelf(n,this._getPTClassValue,i,ce(ce({},s),{},{global:h||{}})),p=this._getPTDatasets(i);return d||!d&&m?f?this._mergeProps(f,h,m,p):ce(ce(ce({},h),m),p):ce(ce({},m),p)},_getPTSelf:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return a.mergeProps(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var e,n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s="data-pc-",o=i==="root"&&Ce((e=this.pt)===null||e===void 0?void 0:e["data-pc-section"]);return i!=="transition"&&ce(ce({},i==="root"&&ce(ce(ci({},"".concat(s,"name"),Xt(o?(n=this.pt)===null||n===void 0?void 0:n["data-pc-section"]:this.$.type.name)),o&&ci({},"".concat(s,"extend"),Xt(this.$.type.name))),Ga()&&ci({},"".concat(this.$attrSelector),""))),{},ci({},"".concat(s,"section"),Xt(i)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Et(e)||Mo(e)?{class:e}:e},_getPT:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,o=function(l){var c,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s?s(l):l,f=Xt(i),h=Xt(n.$name);return(c=d?f!==h?u==null?void 0:u[f]:void 0:u==null?void 0:u[f])!==null&&c!==void 0?c:u};return e!=null&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e,!0)},_usePT:function(e,n,i,s){var o=function(g){return n(g,i,s)};if(e!=null&&e.hasOwnProperty("_usept")){var r,l=e._usept||((r=this.$primevueConfig)===null||r===void 0?void 0:r.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o(e.originalValue),m=o(e.value);return h===void 0&&m===void 0?void 0:Et(m)?m:Et(h)?h:d||!d&&m?f?this._mergeProps(f,h,m):ce(ce({},h),m):m}return o(e)},_useGlobalPT:function(e,n,i){return this._usePT(this.globalPT,e,n,i)},_useDefaultPT:function(e,n,i){return this._usePT(this.defaultPT,e,n,i)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,ce(ce({},this.$params),n))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.mergeProps(this.$_attrsWithoutPT,this.ptm(e,n))},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,n,ce({instance:this},i),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,ce(ce({},this.$params),n))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n){var s=this._getOptionValue(this.$style.inlineStyles,e,ce(ce({},this.$params),i)),o=this._getOptionValue(nl.inlineStyles,e,ce(ce({},this.$params),i));return[o,s]}}},computed:{globalPT:function(){var e,n=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return ft(i,{instance:n})})},defaultPT:function(){var e,n=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return n._getOptionValue(i,n.$name,ce({},n.$params))||ft(i,ce({},n.$params))})},isUnstyled:function(){var e;return this.unstyled!==void 0?this.unstyled:(e=this.$primevueConfig)===null||e===void 0?void 0:e.unstyled},$inProps:function(){var e,n=Object.keys(((e=this.$.vnode)===null||e===void 0?void 0:e.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var s=li(i,1),o=s[0];return n==null?void 0:n.includes(o)}))},$theme:function(){var e;return(e=this.$primevueConfig)===null||e===void 0?void 0:e.theme},$style:function(){return ce(ce({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce}},$primevueConfig:function(){var e;return(e=this.$primevue)===null||e===void 0?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e==null?void 0:e.$props,state:e==null?void 0:e.$data,attrs:e==null?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var n=li(e,1),i=n[0];return i==null?void 0:i.startsWith("pt:")}).reduce(function(e,n){var i=li(n,2),s=i[0],o=i[1],r=s.split(":"),l=zm(r),c=l.slice(1);return c==null||c.reduce(function(d,u,f,h){return!d[u]&&(d[u]=f===h.length-1?o:{}),d[u]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var n=li(e,1),i=n[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(e,n){var i=li(n,2),s=i[0],o=i[1];return e[s]=o,e},{})}}},Km={root:{position:"relative"}},Xm={root:"p-chart"},Gm=Ft.extend({name:"chart",classes:Xm,inlineStyles:Km}),Jm={name:"BaseChart",extends:Ym,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:Gm,provide:function(){return{$pcChart:this,$parentInstance:this}}},ll={name:"Chart",extends:Jm,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var e=this;Promise.resolve().then(()=>QC).then(function(n){e.chart&&(e.chart.destroy(),e.chart=null),n&&n.default&&(e.chart=new n.default(e.$refs.canvas,{type:e.type,data:e.data,options:e.options,plugins:e.plugins})),e.$emit("loaded",e.chart)})},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(e){if(this.chart){var n=this.chart.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1);n&&n[0]&&i&&this.$emit("select",{originalEvent:e,element:n[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function di(t){"@babel/helpers - typeof";return di=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},di(t)}function cl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function dl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cl(Object(n),!0).forEach(function(i){Qm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Qm(t,e,n){return(e=Zm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zm(t){var e=ep(t,"string");return di(e)=="symbol"?e:e+""}function ep(t,e){if(di(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(di(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tp=["width","height"];function np(t,e,n,i,s,o){return a.openBlock(),a.createElementBlock("div",a.mergeProps({class:t.cx("root"),style:t.sx("root")},t.ptmi("root")),[a.createElementVNode("canvas",a.mergeProps({ref:"canvas",width:t.width,height:t.height,onClick:e[0]||(e[0]=function(r){return o.onCanvasClick(r)})},dl(dl({},t.canvasProps),t.ptm("canvas"))),null,16,tp)],16)}ll.render=np;function ip(){const t={primary:"#0efcf1",primaryBorder:"#388E3C",secondary:"#0ec6fc",secondaryBorder:"#FBC02D",tertiary:"#f1fc0e",tertiaryBorder:"#FFA000"},e=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInBounce","easeOutBounce","easeInOutBounce","easeInOutElastic"],n=a.ref("easeInOutElastic"),i=a.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"top",labels:{font:{size:16}}},tooltip:{enabled:!0,titleFont:{size:14},bodyFont:{size:12}},zoom:{zoom:{wheel:{enabled:!0},drag:{enabled:!0},mode:"xy"},pan:{enabled:!0,mode:"xy"}}},scales:{x:{grid:{display:!1},ticks:{font:{size:14}}},y:{grid:{display:!0,color:"#e0e0e0"},ticks:{font:{size:14}}}},animation:{duration:2e3,easing:n.value,delay:500,loop:!1,animateRotate:!0,animateScale:!0},elements:{point:{radius:6,hoverRadius:10,backgroundColor:t.secondary},line:{tension:.4,borderWidth:2},bar:{borderWidth:2,borderRadius:4}}}));return{colorConfig:t,animationOptions:e,selectedAnimation:n,defaultChartOptions:i}}const sp={components:{Chart:ll},props:{type:{type:String,required:!0},chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>({})}},setup(t){const{colorConfig:e,defaultChartOptions:n}=ip(),i=a.computed(()=>{const o=t.chartData.datasets.map((r,l)=>{const c=Object.values(e);return{...r,backgroundColor:c[l%c.length],borderColor:c[l%c.length+1]}});return{...t.chartData,datasets:o}}),s=a.computed(()=>({...n.value,maintainAspectRatio:!0,...t.chartOptions}));return{computedChartData:i,computedChartOptions:s}}},op={class:"chart-container"},rp={key:0},ap={key:1};function lp(t,e,n,i,s,o){const r=a.resolveComponent("Chart",!0);return a.openBlock(),a.createElementBlock("div",op,[n.chartData?(a.openBlock(),a.createElementBlock("div",rp,[a.createVNode(r,{type:n.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(a.openBlock(),a.createElementBlock("div",ap,e[0]||(e[0]=[a.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const ui=De(sp,[["render",lp],["__scopeId","data-v-8e3e786b"]]);function fi(){const t=a.ref(null),e=a.ref(!1),n=a.ref(null);return{chartData:t,fetchChartData:async({entityName:s,xaxis:o=null,yaxis:r=null})=>{e.value=!0,n.value=null;const l="https://mocki.io/v1/1ab17035-c115-4049-8ebf-a1e1b92d739a";try{const d=await(await fetch(l)).json();if(!d||!d.response||!d.response.result)throw new Error("Invalid data structure from API.");const u=d.response.result;if(!o&&!r){const f=Object.keys(u[0]);o=f[1],r=f.slice(4);const h=u.reduce((g,y)=>(r.forEach(b=>{g[b]||(g[b]=0),g[b]+=y[b]||0}),g),{}),m=Object.keys(h),p=Object.values(h);t.value={labels:m,datasets:[{label:"Default Data",data:p,borderWidth:1}]}}else{const f=u.map(p=>p[o]),m=(Array.isArray(r)?r:[r]).map(p=>({label:p,data:u.map(g=>g[p]||0),borderWidth:1}));t.value={labels:f,datasets:m}}}catch(c){n.value=c.message,t.value=null}finally{e.value=!1}},loading:e,error:n}}const cp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),r=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return a.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),r()}),{chartData:e,chartOptions:o,loading:i,error:s}}},dp={key:0,class:"chart-container"},up={key:1},fp={key:0},hp={key:1},mp={key:2};function pp(t,e,n,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(n.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",dp,[a.createElementVNode("h3",null,a.toDisplayString(n.title)+" , x-axis : "+a.toDisplayString(n.xaxis)+" , y-axis : "+a.toDisplayString(n.yaxis),1),a.createVNode(r,{type:"bar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",up,[i.loading?(a.openBlock(),a.createElementBlock("p",fp,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",hp,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",mp,"No data available for the chart."))]))])}const ul=De(cp,[["render",pp],["__scopeId","data-v-67577a46"]]),gp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),r=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return a.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),r()}),{chartData:e,chartOptions:o,loading:i,error:s}}},yp={key:0,class:"chart-container"},bp={key:1},xp={key:0},_p={key:1},kp={key:2};function Sp(t,e,n,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(n.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",yp,[a.createElementVNode("h3",null,a.toDisplayString(n.title)+" , x-axis : "+a.toDisplayString(n.xaxis)+" , y-axis : "+a.toDisplayString(n.yaxis),1),a.createVNode(r,{type:"line",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",bp,[i.loading?(a.openBlock(),a.createElementBlock("p",xp,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",_p,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",kp,"No data available for the chart."))]))])}const fl=De(gp,[["render",Sp],["__scopeId","data-v-2cfe3d4d"]]),wp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),r=async()=>{await n({entityName:t.entityName,xaxis:t.xaxis,yaxis:t.yaxis})};return a.onMounted(()=>{r()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Ep={key:0,class:"chart-container"},Cp={key:1},Op={key:0},vp={key:1},Np={key:2};function Dp(t,e,n,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(n.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",Ep,[a.createElementVNode("h3",null,a.toDisplayString(n.title),1),a.createVNode(r,{type:"pie",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",Cp,[i.loading?(a.openBlock(),a.createElementBlock("p",Op,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",vp,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",Np,"No data available for the chart."))]))])}const hl=De(wp,[["render",Dp],["__scopeId","data-v-27f5ea01"]]),Tp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),r=async()=>{await n({entityName:t.entityName,xaxis:t.xaxis,yaxis:t.yaxis})};return a.onMounted(()=>{r()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Bp={key:0,class:"chart-container"},Pp={key:1},Ap={key:0},Mp={key:1},Vp={key:2};function Rp(t,e,n,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(n.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",Bp,[a.createElementVNode("h3",null,a.toDisplayString(n.title),1),a.createVNode(r,{type:"polarArea",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",Pp,[i.loading?(a.openBlock(),a.createElementBlock("p",Ap,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",Mp,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",Vp,"No data available for the chart."))]))])}const ml=De(Tp,[["render",Rp],["__scopeId","data-v-941f0d0a"]]),Fp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=a.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),r=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return a.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),r()}),{chartData:e,chartOptions:o,loading:i,error:s}}},$p={key:0,class:"chart-container"},Lp={key:1},Ip={key:0},jp={key:1},zp={key:2};function Up(t,e,n,i,s,o){const r=a.resolveComponent("chart");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("h2",null,"Entity name: "+a.toDisplayString(n.entityName),1)]),i.chartData?(a.openBlock(),a.createElementBlock("div",$p,[a.createElementVNode("h3",null,a.toDisplayString(n.title)+" , x-axis : "+a.toDisplayString(n.xaxis)+" , y-axis : "+a.toDisplayString(n.yaxis),1),a.createVNode(r,{type:"radar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(a.openBlock(),a.createElementBlock("div",Lp,[i.loading?(a.openBlock(),a.createElementBlock("p",Ip,"Loading chart data...")):i.error?(a.openBlock(),a.createElementBlock("p",jp,a.toDisplayString(i.error),1)):(a.openBlock(),a.createElementBlock("p",zp,"No data available for the chart."))]))])}const pl=De(Fp,[["render",Up],["__scopeId","data-v-80750171"]]),Wp={class:"flex flex-col p-3"},Hp={class:"flex justify-center flex-row mb-2 cursor-pointer"},qp={style:{"word-break":"break-all"}},Yp={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(t){Ye.useRoute();const e=ot(),n=a.ref("");e.getAppId()!=null&&e.getAppId()!=""&&(n.value=e.getAppId());const i=a.ref(),s=a.ref(!1),o=a.ref(!1),r=a.ref({}),l=a.ref([{label:"Remove association",icon:"",command:f=>{c()}}]),c=()=>{console.log(r.value),console.log("Function is calling")},d=(f,h)=>{r.value=h,i.value.show(f),o.value=!0},u=()=>{r.value={},o.value=!1};return(f,h)=>{const m=a.resolveComponent("Button"),p=a.resolveComponent("ContextMenu"),g=a.resolveComponent("router-link");return a.openBlock(),a.createElementBlock("div",{onMouseenter:h[4]||(h[4]=a.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[5]||(h[5]=a.withModifiers(y=>s.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[a.withDirectives(a.createVNode(m,{onClick:h[0]||(h[0]=y=>d(y,t.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:a.withCtx(()=>h[6]||(h[6]=[a.createTextVNode(" More")])),_:1},512),[[a.vShow,s.value||o.value]]),a.createVNode(p,{ref_key:"menu",ref:i,model:l.value,onMouseenter:h[1]||(h[1]=a.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[2]||(h[2]=a.withModifiers(y=>s.value=!1,["prevent"])),onHide:h[3]||(h[3]=y=>u())},null,8,["model"]),a.createElementVNode("div",Wp,[a.createElementVNode("div",Hp,[a.createElementVNode("div",qp,a.toDisplayString(t.linkEntityListItem.entityName),1),a.createVNode(g,{to:{name:"entity360view",params:{entityName:t.linkEntityListItem.entityName,id:t.linkEntityListItem.id,appId:n.value}},target:"_blank"},{default:a.withCtx(()=>h[7]||(h[7]=[a.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),a.createElementVNode("div",null,"Id: "+a.toDisplayString(t.linkEntityListItem.id),1)])],32)}}},Kp={class:"flex flex-col mt-3"},Xp={class:"flex flex-row items-center"},Gp={class:"flex items-center justify-center mt-5"},Jp={key:0,class:"pi pi-caret-right"},Qp={key:1,class:"pi pi-caret-down"},Zp={key:0},eg={class:"flex flex-col mt-5"},tg={class:"col-12"},ng={class:"flex flex-col mt-5"},ig={class:"col-12 font-bold"},sg={key:0},og={class:"flex flex-col mt-5"},rg={class:"col-12"},ag={class:"flex flex-col mt-5"},lg={class:"col-12"},cg={class:"flex flex-col mt-5"},dg={class:"col-12"},ug={class:"flex flex-row justify-between items-center mt-5"},fg={key:1,class:"mt-2"},hg={class:"flex flex-row justify-between items-center"},mg={key:1,class:"text-red-500"},pg={class:"flex flex-col mt-5"},gg={class:"flex flex-row justify-between items-center mt-2"},yg={class:"flex flex-row items-center mt-5 mb-5"},bg={class:"font-bold"},xg={class:"font-bold ml-2 flex-1"},_g={class:"flex flex-row justify-center items-center mb-2"},kg={class:"ml-2 flex-1"},Sg={key:0,class:"pi pi-exclamation-circle"},wg={class:"flex flex-col justify-center"},Eg={class:"flex flex-row justify-between items-center"},Cg={class:"justify-start"},Og={class:"justify-start"},vg=De({__name:"EntityLookup",props:a.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){Ye.useRoute();const e=t,n=a.useModel(t,"modelValue"),i=new kt,s=a.ref({}),o=a.ref([]),r=a.ref({}),l=a.ref([]),c=a.ref([]),d=a.ref({}),u=a.ref("id"),f=a.ref(1),h=a.ref([]),m=a.ref(25),p=a.ref(0),g=a.ref(0),y=a.ref(0);let b=a.ref([]);const x=a.ref(!1),w={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};a.onMounted(()=>{C()});const k=H=>e.linkedEntity.list.some(F=>F[d.value.name]===H),C=async()=>{try{const H={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:m.value,currentPage:p.value,columnList:null,filter:b.value,fullTextSearch:""},F=await i.searchEntityRecords(e.linkedEntity.entityName,H);F&&F.response&&(s.value=F.response,l.value=F.response.entity.entityDefinition.columns,c.value=ve(F.response.entity.entityDefinition.columns),g.value=F.response.totalRecords,await S(),await _(),O())}catch{}finally{}},S=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];!F.autoGeneerated&&F.foreignKey&&F.foreignKey.referencedEntityName.toLowerCase()==e.entity360Name.toLowerCase()&&(r.value=F)}},_=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];if(F.primaryKey&&F.primaryKey==!0){d.value=F;break}}},O=()=>{for(let H=0;H<e.linkedEntity.list.length;H++){const F=e.linkedEntity.list[H];F.is_deleted==!1&&F[r.value.name]==e.entity360Id&&o.value.push(F[d.value.name])}},P=()=>{let H=JSON.parse(JSON.stringify(o.value));H=H.filter(he=>!k(he));let F={linkEntityName:s.value.entityName,linkRecordIdList:[]};for(let he=0;he<H.length;he++){const pe=H[he];F.linkRecordIdList.push(pe)}e.saveExistingRelatedEntityRecord(F)},v=()=>{x.value=!x.value},T=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],R=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],U=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],Y=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],L=[{label:"ASC",value:1},{label:"DESC",value:-1}];let j=[];const $=a.computed(()=>c.value.filter(H=>H.sortable)),A=a.computed(()=>c.value.filter(H=>H.filterable)),I=H=>c.value.filter(F=>{var he;return F.filterable?((he=h.value[H])==null?void 0:he.columnName)===F.name?!0:!h.value.some((pe,me)=>me!==H&&pe.columnName===F.name):!1}).map(F=>({label:F.name,value:F.field})),Q=H=>{let F="";switch(qe(H.columnName).toLowerCase()){case"string":case"uuid":F="startsWith";break;case"date":F="dateIs";break;case"numeric":case"int":case"integer":F="equals";break;case"bool":case"boolean":F="equals";break}H.operator=F,H.value=""},ne=H=>{const F=qe(H.columnName);switch(F&&F.toLowerCase()){case"integer":case"int":case"numeric":j=R;break;case"date":j=Y;break;case"bool":case"boolean":j=U;break;default:j=T}return j},se=H=>{if(H&&H.columnName){const F=qe(H.columnName);return xt(F)}else return""},K=()=>{for(let H=0;H<h.value.length;H++){const F=h.value[H];F.editing=!1}h.value.push({columnName:"",value:"",operator:"",editing:!0})},J=H=>{h.value.splice(H,1)},oe=H=>{H.editing=!H.editing},ue=()=>{let H=JSON.parse(JSON.stringify(h.value));b.value=[];for(let F=0;F<H.length;F++){const he=H[F];delete he.editing,he.columnName&&he.operator&&he.value&&(he.columnType=qe(he.columnName),he.operator=w[he.operator],b.value.push(he))}C()},ve=H=>H.map(F=>({field:F.name,name:F.displayName?F.displayName:F.name,filterable:F.filterable,datatype:F.type,sortable:!0,displayFormatKey:F.displayFormatKey,displayFormat:F.displayFormat})),st=()=>{C()},qe=H=>{const F=c.value.find(he=>he.field===H);return F?F.datatype:null},xt=H=>{switch(H.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},ct=H=>{m.value=H.rows,p.value=H.page,y.value=H.first,C()};return(H,F)=>{var fn,Bn;const he=a.resolveComponent("InputIcon"),pe=a.resolveComponent("InputText"),me=a.resolveComponent("IconField"),ge=a.resolveComponent("Select"),Te=a.resolveComponent("Divider"),Ze=a.resolveComponent("InputNumber"),Bt=a.resolveComponent("DatePicker"),Le=a.resolveComponent("Button"),et=a.resolveComponent("Checkbox"),dt=a.resolveComponent("Paginator"),un=a.resolveDirective("tooltip");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Kp,[a.createElementVNode("div",Xp,[a.createVNode(me,{class:"block mt-2 md:mt-0 w-full"},{default:a.withCtx(()=>[a.createVNode(he,{onClick:F[0]||(F[0]=()=>{}),class:"pi pi-search"}),a.createVNode(pe,{class:"w-full",onKeyup:F[1]||(F[1]=a.withKeys(()=>{},["enter"])),placeholder:`Search ${s.value.entityName}`},null,8,["placeholder"])]),_:1})]),a.createElementVNode("div",Gp,[a.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:F[2]||(F[2]=ee=>v())},[x.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Jp)),x.value?(a.openBlock(),a.createElementBlock("div",Qp)):a.createCommentVNode("",!0),F[9]||(F[9]=a.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),x.value?(a.openBlock(),a.createElementBlock("div",Zp,[a.createElementVNode("div",eg,[F[10]||(F[10]=a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),a.createElementVNode("div",tg,[a.createVNode(ge,{modelValue:u.value,"onUpdate:modelValue":F[3]||(F[3]=ee=>u.value=ee),options:$.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:F[4]||(F[4]=ee=>st(H.event))},null,8,["modelValue","options"])])]),a.createElementVNode("div",ng,[F[11]||(F[11]=a.createElementVNode("div",{class:"col-12 font-bold"},[a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),a.createElementVNode("div",ig,[a.createVNode(ge,{modelValue:f.value,"onUpdate:modelValue":F[5]||(F[5]=ee=>f.value=ee),options:L,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F[6]||(F[6]=ee=>st(H.event))},null,8,["modelValue"])])]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(h.value,(ee,_t)=>(a.openBlock(),a.createElementBlock("div",{key:_t},[ee.editing?(a.openBlock(),a.createElementBlock("div",sg,[a.createVNode(Te,{class:"mt-5"}),a.createElementVNode("div",og,[F[12]||(F[12]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),a.createElementVNode("div",rg,[a.createVNode(ge,{modelValue:ee.columnName,"onUpdate:modelValue":Ae=>ee.columnName=Ae,options:I(_t),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Ae=>Q(ee)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),a.createElementVNode("div",ag,[F[13]||(F[13]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),a.createElementVNode("div",lg,[a.createVNode(ge,{modelValue:ee.operator,"onUpdate:modelValue":Ae=>ee.operator=Ae,options:ne(ee),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),a.createElementVNode("div",cg,[F[14]||(F[14]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),a.createElementVNode("div",dg,[se(ee)=="numeric"?(a.openBlock(),a.createBlock(Ze,{key:0,format:!1,class:"w-full",modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):se(ee)=="date"?(a.openBlock(),a.createBlock(Bt,{key:1,class:"w-full",modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(a.openBlock(),a.createBlock(pe,{key:2,modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),a.createElementVNode("div",ug,[a.createVNode(Le,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Ae=>oe(ee)},null,8,["onClick"]),a.createVNode(Le,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Ae=>J(_t)},null,8,["onClick"])])])):a.createCommentVNode("",!0),ee.editing?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",fg,[a.createVNode(Te),a.createElementVNode("div",hg,[a.createElementVNode("span",null,[ee.columnName||ee.operator||ee.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!ee.columnName})},a.toDisplayString(ee.columnName?" "+ee.columnName:" column"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!E[ee.operator]})},a.toDisplayString(ee.operator?" "+E[ee.operator]:" operator"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!ee.value})},a.toDisplayString(ee.value?" "+ee.value:" value"),3)],64)):(a.openBlock(),a.createElementBlock("span",mg,"Filter is empty"))]),a.createVNode(Le,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Ae=>oe(ee)},null,8,["onClick"])])]))]))),128)),a.createElementVNode("div",pg,[a.createVNode(Te),a.createElementVNode("div",gg,[a.createVNode(Le,{style:{width:"100px"},label:"Add",disabled:A.value.length===h.value.length,icon:"",severity:"success",onClick:K},null,8,["disabled"]),a.createVNode(Le,{style:{width:"100px"},label:"Apply",severity:"info",onClick:ue})])])])):a.createCommentVNode("",!0),a.createElementVNode("div",yg,[a.createElementVNode("div",bg,a.toDisplayString((fn=s.value)==null?void 0:fn.totalRecords),1),a.createElementVNode("div",xg,a.toDisplayString((Bn=s.value)==null?void 0:Bn.entityName),1)]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value.result,(ee,_t)=>(a.openBlock(),a.createElementBlock("div",{key:_t},[a.createElementVNode("div",_g,[a.createVNode(et,{disabled:k(ee[d.value.name]),modelValue:o.value,"onUpdate:modelValue":F[7]||(F[7]=Ae=>o.value=Ae),value:ee[d.value.name]},null,8,["disabled","modelValue","value"]),a.createElementVNode("div",kg,[a.createTextVNode(a.toDisplayString(t.linkedEntity.entityName)+" ",1),a.createElementVNode("span",null,a.toDisplayString(ee[d.value.name]),1)]),k(ee[d.value.name])?a.withDirectives((a.openBlock(),a.createElementBlock("div",Sg,null,512)),[[un,"This record is already associated.",void 0,{left:!0}]]):a.createCommentVNode("",!0)])]))),128)),a.createVNode(dt,{rows:m.value,totalRecords:g.value,rowsPerPageOptions:[10,25,50,100],onPage:ct,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),a.createElementVNode("div",wg,[a.createVNode(Te,{class:"mt-5"}),a.createElementVNode("div",Eg,[a.createElementVNode("div",Cg,[a.createVNode(Le,{label:"Cancel",icon:"",severity:"secondary",onClick:F[8]||(F[8]=ee=>n.value=!1)})]),a.createElementVNode("div",Og,[a.createVNode(Le,{label:"Save",severity:"success",onClick:P})])])])],64)}}},[["__scopeId","data-v-5172abef"]]),Ng={class:"field flex flex-col"},Dg={key:0,class:"flex items-center"},Tg={key:1},Bg={class:"flex items-center"},Pg={class:"flex flex-col justify-center"},Ag={class:"flex flex-row justify-between items-center"},Mg={class:"justify-start"},Vg={class:"justify-start"},Rg={__name:"EntityLookupObject",props:a.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){Ye.useRoute();const e=t,n=a.useModel(t,"modelValue"),i=new kt,s=a.ref({}),o=a.ref({});let r=a.ref("");const l=a.ref({}),c=a.ref({});a.onMounted(async()=>{console.log("linkedEntity"),console.log(e.linkedEntity),console.log("entity360Name"),console.log(e.entity360Name),console.log("entity360Id"),console.log(e.entity360Id),await u(),await d()});const d=async()=>{try{const g=await i.getEntityRecords(e.linkedEntity.entityName);g&&g.response&&(s.value=g.response,await f(g.response.entity.entityDefinition.columns),await m(),console.log(s.value))}catch{}finally{}},u=async()=>{try{const g=await i.getRecord(e.entity360Name,e.entity360Id);g&&g.response&&(o.value=g.response,await h(g.response.entity.entityDefinition.columns),console.log(o.value))}catch{}finally{}},f=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(b.primaryKey&&b.primaryKey==!0){l.value=b;break}}},h=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(!b.autoGeneerated&&b.foreignKey&&b.foreignKey.referencedEntityName.toLowerCase()==e.linkedEntity.entityName.toLowerCase()){c.value=b;break}}},m=async()=>{for(let g=0;g<s.value.result.length;g++){const y=s.value.result[g];if(y[l.value.name]==o.value.result[0][c.value.name]){r.value=y;break}}},p=()=>{const g={linkedEntityRecordId:r.value[l.value.name],linkedEntityName:e.linkedEntity.entityName,relationType:"ManyToOne"};e.saveExistingEntityObject(g)};return(g,y)=>{const b=a.resolveComponent("Select"),x=a.resolveComponent("Divider"),w=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock("div",Ng,[a.createVNode(b,{modelValue:a.unref(r),"onUpdate:modelValue":y[0]||(y[0]=E=>a.isRef(r)?r.value=E:r=E),"item-value":l.value.name,options:s.value.result,filter:"",optionLabel:l.value.name,placeholder:"Select "+l.value.name,class:"w-full"},{value:a.withCtx(E=>[E.value?(a.openBlock(),a.createElementBlock("div",Dg,[a.createElementVNode("div",null,a.toDisplayString(E.value[l.value.name]),1)])):(a.openBlock(),a.createElementBlock("span",Tg,a.toDisplayString(E.placeholder),1))]),option:a.withCtx(E=>[a.createElementVNode("div",Bg,[a.createElementVNode("div",null,a.toDisplayString(E.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),a.createElementVNode("div",Pg,[a.createVNode(x),a.createElementVNode("div",Ag,[a.createElementVNode("div",Mg,[a.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=E=>n.value=!1)})]),a.createElementVNode("div",Vg,[a.createVNode(w,{label:"Save",severity:"success",onClick:p})])])])])}}},Fg={style:{"font-weight":"700","font-size":"1.25rem"}},$g={class:"flex flex-col"},Lg={class:"flex flex-row justify-between items-center"},Ig={class:"justify-start"},jg={class:"justify-start"},zg="",Ug={__name:"CreateRelatedentity",props:a.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:a.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(t,{emit:e}){const n=a.useModel(t,"showCreateRelatedEntityForm");Ye.useRoute();const i=t,s=i.linkedEntity.entityName,o=e,r=a.ref("Add existing");a.onMounted(()=>{m()});const{formData:l,columns:c,errors:d,backendErrors:u,clearErrors:f,saveRecord:h,fetchAllRecords:m,saveRelatedEntityRecord:p}=Po(s,zg,o),g=()=>{for(let w=0;w<c.value.length;w++){const E=c.value[w];!E.autoGenerated&&E.foreignKey&&(l.value[E.name]=i.entity360Id)}const x={relationType:i.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]}};h(x)},y=x=>{var w;if(((w=x==null?void 0:x.linkRecordIdList)==null?void 0:w.length)>0){const E={entityLinkage:[{linkEntityName:x.linkEntityName,linkRecordIdList:x.linkRecordIdList}]};p(i.entity360Name,i.entity360Id,E)}},b=x=>{const w={entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]};p(x.linkedEntityName,x.linkedEntityRecordId,w)};return(x,w)=>{const E=a.resolveComponent("Tab"),k=a.resolveComponent("TabList"),C=a.resolveComponent("Divider"),S=a.resolveComponent("Button"),_=a.resolveComponent("TabPanel"),O=a.resolveComponent("TabPanels"),P=a.resolveComponent("Tabs"),v=a.resolveComponent("Drawer");return a.openBlock(),a.createBlock(v,{visible:n.value,"onUpdate:visible":w[3]||(w[3]=T=>n.value=T),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:a.withCtx(()=>[a.createElementVNode("span",Fg,a.toDisplayString(r.value)+" "+a.toDisplayString(t.linkedEntity.entityName),1)]),default:a.withCtx(()=>[a.createVNode(P,{value:"1"},{default:a.withCtx(()=>[a.createVNode(k,null,{default:a.withCtx(()=>[a.createVNode(E,{value:"0"},{default:a.withCtx(()=>w[4]||(w[4]=[a.createTextVNode("Create new")])),_:1}),a.createVNode(E,{value:"1"},{default:a.withCtx(()=>w[5]||(w[5]=[a.createTextVNode("Add existing")])),_:1})]),_:1}),a.createVNode(O,null,{default:a.withCtx(()=>[a.createVNode(_,{value:"0"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(c),(T,R)=>{var U;return a.openBlock(),a.createElementBlock("div",{key:R,class:"mt-3"},[!T.autoGenerated&&!T.foreignKey?(a.openBlock(),a.createBlock(os,{key:0,modelValue:a.unref(l)[T.name],"onUpdate:modelValue":Y=>a.unref(l)[T.name]=Y,column:T,errors:(U=a.unref(d)[T.name])==null?void 0:U.messages,onInput:a.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):a.createCommentVNode("",!0)])}),128)),a.createElementVNode("div",$g,[a.createVNode(C),a.createElementVNode("div",Lg,[a.createElementVNode("div",Ig,[a.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:w[0]||(w[0]=T=>n.value=!1)})]),a.createElementVNode("div",jg,[a.createVNode(S,{label:"Save",severity:"success",onClick:g})])])])]),_:1}),a.createVNode(_,{value:"1"},{default:a.withCtx(()=>[t.linkedEntity.relationType=="ONE_TO_MANY"?(a.openBlock(),a.createBlock(vg,{key:0,modelValue:n.value,"onUpdate:modelValue":w[1]||(w[1]=T=>n.value=T),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,saveExistingRelatedEntityRecord:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):a.createCommentVNode("",!0),t.linkedEntity.relationType=="MANY_TO_ONE"?(a.openBlock(),a.createBlock(Rg,{key:1,modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=T=>n.value=T),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,saveExistingEntityObject:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):a.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},Wg={class:"flex flex-col border-bottom-section pb-3 pt-3"},Hg={class:"flex items-center pl-3 pr-3 justify-between"},qg={key:0,class:"pi pi-caret-right"},Yg={key:1,class:"pi pi-caret-down"},Kg={class:"ml-3 font-bold"},Xg={class:"ml-1"},Gg={class:"text-right"},Jg={key:0},Qg=De({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(t){Ye.useRoute();const e=t,n=a.ref(!1),i=a.ref(!1),s=()=>{n.value=!n.value},o=()=>{i.value=!i.value},r=()=>{i.value=!1,e.onSaveRelatedEnttity()},l=a.computed(()=>e.linkedEntity.list.filter(c=>!c.is_deleted).length);return(c,d)=>{const u=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Wg,[a.createElementVNode("div",Hg,[a.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:d[0]||(d[0]=f=>s())},[n.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",qg)),n.value?(a.openBlock(),a.createElementBlock("div",Yg)):a.createCommentVNode("",!0),a.createElementVNode("div",Kg,a.toDisplayString(t.linkedEntity.entityName),1),a.createElementVNode("div",Xg," ("+a.toDisplayString(l.value)+") ",1)]),a.createElementVNode("div",Gg,[a.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:d[1]||(d[1]=f=>o())})])]),n.value?(a.openBlock(),a.createElementBlock("div",Jg,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.linkedEntity.list,(f,h)=>(a.openBlock(),a.createElementBlock("div",{class:"flex flex-col",key:h},[f.is_deleted?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Yp,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):a.createCommentVNode("",!0)]),i.value?(a.openBlock(),a.createBlock(Ug,{key:0,showCreateRelatedEntityForm:i.value,"onUpdate:showCreateRelatedEntityForm":d[2]||(d[2]=f=>i.value=f),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,onOnSaveDialog:r},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),Zg={key:0},ey={class:"flex"},ty={class:"p-3 mt-3 flex-col items-center"},ny={key:0,class:"pi pi-caret-right"},iy={key:1,class:"pi pi-caret-down"},sy={class:"font-bold ml-2"},oy={key:0,class:"flex flex-col mt-4"},ry={class:"flex flex-col mt-2"},ay={class:"flex flex-row flex-wrap justify-between pl-5"},ly={class:"flex flex-col"},cy={class:"font-bold"},dy={class:"mt-2"},uy={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},fy={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},hy={key:0,class:"custom-sidebar"},my={class:"custom-sidebar-content"},py={class:"custom-sidebar-button"},gy={class:"custom-sidebar-text"},gl=De({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String},variable:{type:String,default:"item"},linkedEntity:Array},emits:["onSaveDialog"],setup(t,{expose:e,emit:n}){var v,T;const i=ot(),s=Ye.useRoute(),o=t,r=a.ref(!0),l=a.ref(!1),c=a.ref([]);let d=(v=s==null?void 0:s.params)==null?void 0:v.entityName,u=(T=s==null?void 0:s.params)==null?void 0:T.id;o.entityName&&(d=o.entityName),o.recordId&&(u=o.recordId);const f=n,{formData:h,columns:m,errors:p,backendErrors:g,isDataChange:y,linkedEntities:b,primarayColumn:x,clearErrors:w,saveRecord:E,getRelatedEntityRecordById:k,cancleRecord:C}=Po(d,u,f);a.watch(()=>i.globalConfigs.appId,async R=>{R&&k()},{immediate:!0});const S=()=>{r.value=!r.value},_=()=>{l.value=!l.value},O=()=>{k()},P=R=>{if(!c.value||c.value.length===0)return[];const U=c.value.find(Y=>Y.entityName===R);return U&&U.list?U.list:(console.log("No related entity found"),[])};return e({getRelatedEntity:P}),a.watch(()=>b.value,R=>{Array.isArray(R)&&R.length>0&&R[0]&&(c.value=R)},{immediate:!0,deep:!0}),(R,U)=>{var se;const Y=a.resolveComponent("SplitterPanel"),L=a.resolveComponent("Tab"),j=a.resolveComponent("TabList"),$=a.resolveComponent("TabPanel"),A=a.resolveComponent("TabPanels"),I=a.resolveComponent("Tabs"),Q=a.resolveComponent("Splitter"),ne=a.resolveComponent("Button");return R.$slots["list-item-display-360"]?(a.openBlock(),a.createElementBlock("div",Zg,[a.renderSlot(R.$slots,"header",{},void 0,!0),a.createElementVNode("div",null,[a.renderSlot(R.$slots,"list-item-display-360",a.normalizeProps({[t.variable||""]:{formData:a.unref(h),columns:a.unref(m),linkedEntities:a.unref(b),errors:a.unref(p),recordId:a.unref(u),entityName:a.unref(d),getRelatedEntity:P}}),void 0,!0)]),a.renderSlot(R.$slots,"footer",{},void 0,!0)])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("div",ey,[a.createVNode(Q,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:a.withCtx(()=>[a.createVNode(Y,{size:20,minSize:10,maxSize:20},{default:a.withCtx(()=>[a.createElementVNode("div",ty,[a.createElementVNode("div",{onClick:U[0]||(U[0]=K=>S()),class:"section-heading cursor-pointer"},[r.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("i",ny)),r.value?(a.openBlock(),a.createElementBlock("i",iy)):a.createCommentVNode("",!0),a.createElementVNode("span",sy," About this "+a.toDisplayString(a.unref(d)),1)]),r.value?(a.openBlock(),a.createElementBlock("div",oy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(m),(K,J)=>{var oe;return a.openBlock(),a.createElementBlock("div",{key:J},[K.autoGenerated?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(os,{key:0,modelValue:a.unref(h)[K.name],"onUpdate:modelValue":ue=>a.unref(h)[K.name]=ue,column:K,errors:(oe=a.unref(p)[K.name])==null?void 0:oe.messages,onInput:a.unref(w)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):a.createCommentVNode("",!0)])]),_:1}),a.createVNode(Y,{size:55,minSize:35,style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(I,{value:"0"},{default:a.withCtx(()=>[a.createVNode(j,null,{default:a.withCtx(()=>[a.createVNode(L,{value:"0"},{default:a.withCtx(()=>U[3]||(U[3]=[a.createTextVNode("Overview")])),_:1}),a.createVNode(L,{value:"1"},{default:a.withCtx(()=>U[4]||(U[4]=[a.createTextVNode("Activity")])),_:1})]),_:1}),a.createVNode(A,null,{default:a.withCtx(()=>[a.createVNode($,{value:"0"},{default:a.withCtx(()=>[a.createElementVNode("div",ry,[U[5]||(U[5]=a.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),a.createElementVNode("div",ay,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(m).filter(K=>K.autoGenerated),(K,J)=>(a.openBlock(),a.createElementBlock("div",{key:J,class:"column-item"},[a.createElementVNode("div",ly,[a.createElementVNode("div",cy,a.toDisplayString(K.name),1),a.createElementVNode("div",dy,[a.createVNode(Vo,{column:K,value:a.unref(h)[K.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),a.createVNode($,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((se=a.unref(b))==null?void 0:se.length)>0?(a.openBlock(),a.createElementBlock("div",uy,[l.value?(a.openBlock(),a.createBlock(ne,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:_,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):a.createCommentVNode("",!0),l.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(ne,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:_,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),l.value?(a.openBlock(),a.createElementBlock("div",fy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(b),(K,J)=>(a.openBlock(),a.createElementBlock("div",{key:J},[a.createVNode(Qg,{entity360Name:a.unref(d),entity360Id:a.unref(u),linkedEntity:K,onSaveRelatedEnttity:O},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)]),a.unref(y)?(a.openBlock(),a.createElementBlock("div",hy,[a.createElementVNode("div",my,[a.createElementVNode("div",py,[a.createVNode(ne,{severity:"primary",onClick:U[1]||(U[1]=K=>a.unref(E)())},{default:a.withCtx(()=>U[6]||(U[6]=[a.createTextVNode("Save")])),_:1}),a.createVNode(ne,{style:{"margin-left":"10px"},severity:"secondary",onClick:U[2]||(U[2]=K=>a.unref(C)())},{default:a.withCtx(()=>U[7]||(U[7]=[a.createTextVNode("Cancel")])),_:1})]),a.createElementVNode("div",gy," You've changed property in the "+a.toDisplayString(a.unref(d))+". ",1)])])):a.createCommentVNode("",!0)],64))}}},[["__scopeId","data-v-6df84fdd"]]);function xs(){const t=new kt;let{errors:e,setErrors:n}=Sa(),i=a.reactive({data:null});const s=C=>{i.data=C},o=async C=>{try{const S=await t.getEntityRecords(C);if(S&&S.response)return S}catch(S){return console.error("Error fetching entity:",S.errorMessage),S}finally{}},r=async(C,S)=>{try{let _=await t.addRecord(C.entityName,S);if(_)return _}catch(_){return _}finally{}},l=async(C,S,_)=>{try{const O=await t.updateRecord(C.entityName,S,_);if(O&&O.response)return O}catch(O){return O}finally{}},c=async(C,S)=>{try{S.filter==null&&(S.filter={}),Object.keys(S.filter).length===0&&(S.filter=[]);const _=await t.searchEntityRecords(C.entityName,S);if(_)return _.response.sortBy=S.sortBy,_.response.filters=S.filter,_.response.sortDirection=S.sortDirection,_.response.fullTextSearch=S.fullTextSearch,_}catch(_){return _}finally{}},d=async(C,S)=>{try{const _=await t.deleteRecord(C.entityName,S);if(_)return _}catch(_){console.error("Error on deleting record:",_.errorMessage)}finally{}},u=C=>C.result,f=C=>{var S,_;return(_=(S=C==null?void 0:C.entity)==null?void 0:S.entityDefinition)==null?void 0:_.columns},h=C=>{const S=C.entity.entityDefinition.columns;let _={};for(let O=0;O<S.length;O++){const P=S[O];if(P.primaryKey&&P.primaryKey==!0){_=P;break}}return _},m=C=>{const S=C.entity.entityDefinition.columns;let _={};for(let O=0;O<S.length;O++){let P=S[O];P.autoGenerated||(_[P.name]="")}return _},p=(C,S)=>{let _="";const O=C.entity.entityDefinition.columns;for(let P=0;P<O.length;P++){let v=O[P];if(S==v.name){_=v.type;break}}return _},g=(C,S)=>{const O=C.entity.entityDefinition.columns.filter(v=>v.autoGenerated).map(v=>v.name);return Object.entries(S).filter(([v])=>!O.includes(v)).map(([v,T])=>({recordColumnName:v,recordColumnValue:T,columnType:p(i.data,v)}))},y=()=>{const C=i.data.entity.entityDefinition.columns;return Bo().shape(C.reduce((_,O)=>(O.autoGenerated||(_[O.name]=To().nullable(!1).test({name:"custom-validation",test:function(P){const v=[];let T="";if(O.required&&(!P||P.trim()===""))if(O.validations){T=b(O.validations,"VALIDATE_REQUIRED"),v.push(T);let R=w(O.validations,"VALIDATE_REQUIRED");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" is required.",v.push(T);else{if(O.maxLength&&P.length>O.maxLength)if(O.validations){T=b(O.validations,"VALIDATE_MAXLENGTH"),v.push(T);let R=w(O.validations,"VALIDATE_MAXLENGTH");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" cannot exceed from "+O.maxLength+" characters",v.push(T);if(O.regxId&&!new RegExp(x(O.validations,"VALIDATE_REGX")).test(P))if(O.validations){T=b(O.validations,"VALIDATE_REGX"),v.push(T);let R=w(O.validations,"VALIDATE_REGX");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" invalid format.",v.push(T)}return v.length>0?this.createError({message:v}):!0}})),_),{}))},b=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].message},x=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].regx},w=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].hint};return{state:i,setEntity:s,getEntity:o,addRecord:r,updateRecord:l,searchRecord:c,entityRecordDelete:d,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:h,getFormData:m,createDataToSave:g,createValidationSchema:y,clearErrors:C=>(n({...e.value,[C]:null}),e.value),validateData:async(C,S)=>{try{return await C.validate(S,{abortEarly:!1}),n({}),{validate:!0}}catch(_){const O=_.inner.reduce((T,R)=>(T[R.path]||(T[R.path]={messages:[]}),T[R.path].messages.push(...R.errors),T),{}),P=Object.entries(O).reduce((T,[R,U])=>(T[R]={messages:U.messages},T),{});return n(P),{validate:!1,errors:e.value}}}}}const _s={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:a.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(t,{emit:e}){const n=a.useModel(t,"showDeleteDialog"),i=e,s=o=>{i("onDeleteItem",{remove:o})};return(o,r)=>{const l=a.resolveComponent("Button"),c=a.resolveComponent("Dialog");return a.openBlock(),a.createBlock(c,{visible:n.value,"onUpdate:visible":r[2]||(r[2]=d=>n.value=d),style:{width:"450px"},header:"Confirm",modal:!0},{footer:a.withCtx(()=>[a.createVNode(l,{label:"No",icon:"pi pi-times",text:"",onClick:r[0]||(r[0]=d=>s(!1))}),a.createVNode(l,{label:"Yes",icon:"pi pi-check",text:"",onClick:r[1]||(r[1]=d=>s(!0))})]),default:a.withCtx(()=>[r[3]||(r[3]=a.createElementVNode("div",{class:"flex items-center justify-center"},[a.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),a.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},yy={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},by={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},hi={__name:"EntityFormDialog",props:a.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(t){const e=a.useModel(t,"showEntityForm"),n=a.inject("entityObject"),i=t;let s=a.ref([]),o=a.ref({}),r=a.ref([]),l=a.ref(null),c=a.ref({});a.onMounted(()=>{s.value=n.getEntityColumns(n.state.data),i.item?o.value=JSON.parse(JSON.stringify(i.item)):o.value=n.getFormData(n.state.data),l.value=n.createValidationSchema()});const d=async()=>{const m=await n.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p=n.getPrimaryKeyColumn(n.state.data),g=i.item[p.name],y={dataDefinitions:n.createDataToSave(n.state.data,o.value)},b=await n.updateRecord(n.state.data,g,y);if(b&&b.success){e.value=!1;const x={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},w=await n.searchRecord(n.state.data,x);if(w!=null&&w.response){let E=w==null?void 0:w.response;n.setEntity(E)}}else b.validationErrors&&(r.value=JSON.parse(JSON.stringify(b.errvalidationErrorsors)))},u=async()=>{const m=await n.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p={dataDefinitions:n.createDataToSave(n.state.data,o.value)},g=await n.addRecord(n.state.data,p);g&&g.success?(e.value=!1,n.state.data=await n.getEntity(n.state.data.entityName)):g.validationErrors&&(r.value=JSON.parse(JSON.stringify(g.errvalidationErrorsors)))},f=async()=>{i.item?d():u()},h=m=>{c.value=n.clearErrors(m)};return(m,p)=>{const g=a.resolveComponent("Button"),y=a.resolveComponent("Dialog");return e.value?(a.openBlock(),a.createBlock(y,{key:0,showFooter:!1,visible:e.value,"onUpdate:visible":p[2]||(p[2]=b=>e.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:a.withCtx(()=>[t.item?(a.openBlock(),a.createElementBlock("span",yy,"Edit "+a.toDisplayString(a.unref(n).state.data.entityName)+" record details",1)):a.createCommentVNode("",!0),t.item?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",by,"Add "+a.toDisplayString(a.unref(n).state.data.entityName)+" record details",1))]),footer:a.withCtx(()=>[a.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>e.value=!1)}),a.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>f())})]),default:a.withCtx(()=>{var b;return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(s),(x,w)=>{var E;return a.openBlock(),a.createElementBlock("div",{key:w},[!x.autoGenerated&&!x.foreignKey?(a.openBlock(),a.createBlock(os,{key:0,modelValue:a.unref(o)[x.name],"onUpdate:modelValue":k=>a.unref(o)[x.name]=k,column:x,errors:(E=a.unref(c)[x.name])==null?void 0:E.messages,onInput:h},null,8,["modelValue","onUpdate:modelValue","column","errors"])):a.createCommentVNode("",!0),!x.autoGenerated&&x.foreignKey?(a.openBlock(),a.createBlock(La,{key:1,modelValue:a.unref(o)[x.name],"onUpdate:modelValue":k=>a.unref(o)[x.name]=k,entityName:x.foreignKey.referencedEntityName,columnName:x.name,relatedEntityColumn:x.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):a.createCommentVNode("",!0)])}),128)),((b=a.unref(r))==null?void 0:b.length)>0?(a.openBlock(),a.createBlock($a,{key:0,errors:a.unref(r)},null,8,["errors"])):a.createCommentVNode("",!0)]}),_:1},8,["visible"])):a.createCommentVNode("",!0)}}},xy={class:"flex justify-between items-start"},_y={class:"flex-grow-1"},ky={class:"tile-grid"},Sy={class:"font-bold text-lg text-700"},wy={class:"flex flex-col gap-2"},Ey=De({__name:"EntityListSingleRecord",props:{item:Object},setup(t){const e=t,n=a.inject("entityObject"),i=a.ref([]),s=a.ref(!1),o=a.ref(!1);a.onMounted(()=>{i.value=n.getEntityColumns(n.state.data)});const r=()=>{s.value=!0},l=()=>{o.value=!0},c=u=>{u.remove==!0?d():s.value=!1},d=async()=>{const u=n.getPrimaryKeyColumn(n.state.data),f=e.item[u.name],h=await n.entityRecordDelete(n.state.data,f);if(h!=null&&h.success){s.value=!1;const m={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},p=await n.searchRecord(n.state.data,m);if(p!=null&&p.response){let g=p==null?void 0:p.response;n.setEntity(g)}console.log(h)}};return(u,f)=>{const h=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",xy,[a.createElementVNode("div",_y,[a.createElementVNode("div",ky,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(m,p)=>(a.openBlock(),a.createElementBlock("div",{key:p},[a.createElementVNode("span",Sy,a.toDisplayString(m.name)+" : ",1),a.createVNode(Vo,{column:m,value:t.item[m.name]},null,8,["column","value"])]))),128))])]),a.createElementVNode("div",wy,[a.createVNode(h,{onClick:f[0]||(f[0]=m=>l()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),a.createVNode(h,{onClick:f[1]||(f[1]=m=>r()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),o.value?(a.openBlock(),a.createBlock(hi,{key:0,showEntityForm:o.value,"onUpdate:showEntityForm":f[2]||(f[2]=m=>o.value=m),item:t.item},null,8,["showEntityForm","item"])):a.createCommentVNode("",!0),s.value?(a.openBlock(),a.createBlock(_s,{key:1,showDeleteDialog:s.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=m=>s.value=m),onOnDeleteItem:c},null,8,["showDeleteDialog"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ea3b758f"]]),Cy=De({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(t){const e=a.inject("entityObject"),n=a.ref([]);return a.watch(()=>e.state.data,i=>{i&&(n.value=i.result,console.log("Entity state updated in child:",e))},{immediate:!0}),(i,s)=>(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(o,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:Ey),a.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),Oy={};function vy(t,e){return null}const Ny=De(Oy,[["render",vy]]),Dy={class:"my-2"},Ty={class:"m-0"},By={__name:"EntityListHeaderSlot",setup(t){const e=a.inject("entityObject");let n=a.ref("");return a.watch(()=>e.state.data,i=>{i&&(n.value=i.entityName)},{immediate:!0}),(i,s)=>{const o=a.resolveComponent("Toolbar");return a.openBlock(),a.createBlock(o,{class:"p-2 my-2"},{start:a.withCtx(()=>[a.createElementVNode("div",Dy,[a.createElementVNode("h2",Ty,"EntityName: "+a.toDisplayString(a.unref(n)),1)])]),end:a.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},Py={class:"flex flex-col mb-5"},Ay={class:"col-12"},My={class:"flex flex-col mb-5"},Vy={class:"col-12"},Ry={key:0},Fy={class:"flex flex-col mb-5"},$y={class:"col-12"},Ly={class:"flex flex-col mb-5"},Iy={class:"col-12"},jy={class:"flex flex-col mb-5"},zy={class:"col-12"},Uy={class:"flex flex-row justify-between items-center"},Wy={key:1},Hy={class:"flex flex-row justify-between items-center"},qy={key:1,class:"text-red-500"},Yy={class:"flex flex-col"},Ky={class:"flex flex-row justify-between items-center"},Xy={__name:"FilterSortSidebar",props:a.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(t){const e=a.useModel(t,"sortBy"),n=a.useModel(t,"sortDirection"),i=a.useModel(t,"showFilter"),s=a.useModel(t,"filters"),o={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"},r=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],l=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],c=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],d=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const h=a.computed(()=>t.headers.filter(S=>S.sortable)),m=a.computed(()=>t.headers.filter(S=>S.filterable)),p=S=>t.headers.filter(_=>{var O;return _.filterable?((O=s.value[S])==null?void 0:O.columnName)===_.name?!0:!s.value.some((P,v)=>v!==S&&P.columnName===_.name):!1}).map(_=>({label:_.name,value:_.field})),g=S=>{let _="";switch(t.getDatatypeByField(S.columnName).toLowerCase()){case"string":case"uuid":_="startsWith";break;case"date":_="dateIs";break;case"numeric":case"int":case"integer":_="equals";break;case"bool":case"boolean":_="equals";break}S.operator=_,S.value=""},y=S=>{const _=t.getDatatypeByField(S.columnName);switch(_&&_.toLowerCase()){case"integer":case"int":case"numeric":f=l;break;case"date":f=d;break;case"bool":case"boolean":f=c;break;default:f=r}return f},b=S=>{if(S&&S.columnName){const _=t.getDatatypeByField(S.columnName);return t.getColumnDatatype(_)}else return""},x=()=>{for(let S=0;S<s.value.length;S++){const _=s.value[S];_.editing=!1}s.value.push({columnName:"",value:"",operator:"",editing:!0})},w=S=>{s.value.splice(S,1)},E=S=>{S.editing=!S.editing},k=()=>{let S=[],_=JSON.parse(JSON.stringify(s.value));for(let O=0;O<_.length;O++){const P=_[O];delete P.editing,P.columnName&&P.operator&&P.value&&(P.columnType=t.getDatatypeByField(P.columnName),P.operator=t.operatorMap[P.operator],S.push(P))}t.filterCallback(S)},C=()=>{t.sortCallback()};return(S,_)=>{const O=a.resolveComponent("Select"),P=a.resolveComponent("Divider"),v=a.resolveComponent("InputNumber"),T=a.resolveComponent("DatePicker"),R=a.resolveComponent("InputText"),U=a.resolveComponent("Button"),Y=a.resolveComponent("Drawer");return a.openBlock(),a.createBlock(Y,{visible:i.value,"onUpdate:visible":_[4]||(_[4]=L=>i.value=L),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:a.withCtx(()=>[a.createElementVNode("div",Py,[_[5]||(_[5]=a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),a.createElementVNode("div",Ay,[a.createVNode(O,{modelValue:e.value,"onUpdate:modelValue":_[0]||(_[0]=L=>e.value=L),options:h.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:_[1]||(_[1]=L=>C(S.event))},null,8,["modelValue","options"])])]),a.createElementVNode("div",My,[_[6]||(_[6]=a.createElementVNode("div",{class:"col-12 font-bold"},[a.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),a.createElementVNode("div",Vy,[a.createVNode(O,{modelValue:n.value,"onUpdate:modelValue":_[2]||(_[2]=L=>n.value=L),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:_[3]||(_[3]=L=>C(S.event))},null,8,["modelValue"])])]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,(L,j)=>(a.openBlock(),a.createElementBlock("div",{key:j},[L.editing?(a.openBlock(),a.createElementBlock("div",Ry,[a.createVNode(P),a.createElementVNode("div",Fy,[_[7]||(_[7]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),a.createElementVNode("div",$y,[a.createVNode(O,{modelValue:L.columnName,"onUpdate:modelValue":$=>L.columnName=$,options:p(j),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:$=>g(L)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),a.createElementVNode("div",Ly,[_[8]||(_[8]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),a.createElementVNode("div",Iy,[a.createVNode(O,{modelValue:L.operator,"onUpdate:modelValue":$=>L.operator=$,options:y(L),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),a.createElementVNode("div",jy,[_[9]||(_[9]=a.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),a.createElementVNode("div",zy,[b(L)=="numeric"?(a.openBlock(),a.createBlock(v,{key:0,format:!1,class:"w-full",modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):b(L)=="date"?(a.openBlock(),a.createBlock(T,{key:1,class:"w-full",modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(a.openBlock(),a.createBlock(R,{key:2,modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),a.createElementVNode("div",Uy,[a.createVNode(U,{label:"Hide",icon:"",severity:"warn",onClick:$=>E(L)},null,8,["onClick"]),a.createVNode(U,{label:"Delete",icon:"",severity:"danger",onClick:$=>w(j)},null,8,["onClick"])])])):a.createCommentVNode("",!0),L.editing?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Wy,[a.createVNode(P),a.createElementVNode("div",Hy,[a.createElementVNode("span",null,[L.columnName||L.operator||L.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!L.columnName})},a.toDisplayString(L.columnName?" "+L.columnName:" column"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!o[L.operator]})},a.toDisplayString(L.operator?" "+o[L.operator]:" operator"),3),a.createElementVNode("span",{class:a.normalizeClass({"text-red-500":!L.value})},a.toDisplayString(L.value?" "+L.value:" value"),3)],64)):(a.openBlock(),a.createElementBlock("span",qy,"Filter is empty"))]),a.createVNode(U,{label:"Edit",icon:"",severity:"info",onClick:$=>E(L)},null,8,["onClick"])])]))]))),128)),a.createElementVNode("div",Yy,[a.createVNode(P),a.createElementVNode("div",Ky,[a.createVNode(U,{label:"Add",disabled:m.value.length===s.value.length,icon:"",severity:"success",onClick:x},null,8,["disabled"]),a.createVNode(U,{label:"Apply",severity:"info",onClick:k})])])]),_:1},8,["visible"])}}},Gy={class:"my-2"},Jt={__name:"EntityListFilters",setup(t){const e=a.inject("entityObject"),n=a.ref(!1),i=a.ref([]),s=a.ref([]),o=a.ref(""),r=a.ref(1);let l=a.ref("");const c=a.ref([]),d=a.ref([]),u={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};a.watch(()=>e.state.data,E=>{if(E&&(c.value=e.getEntityColumns(E),d.value=b(c.value),o.value=="")){const k=e.getPrimaryKeyColumn(E);o.value=k.name}},{immediate:!0});const f=()=>{n.value=!n.value},h=E=>{s.value=E,m()},m=async()=>{const E={sortBy:[o.value],sortDirection:r.value===1?"ASC":"DESC",pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:s.value,fullTextSearch:l.value},k=await e.searchRecord(e.state.data,E);if(k!=null&&k.success){let C=k==null?void 0:k.response;e.setEntity(C)}},p=()=>{m()},g=()=>{i.value=[],s.value=[],m()},y=()=>{m()},b=E=>E.map(k=>({field:k.name,name:k.displayName?k.displayName:k.name,filterable:k.filterable,datatype:k.type,sortable:k.indexColumn,displayFormatKey:k.displayFormatKey,displayFormat:k.displayFormat})),x=E=>{switch(E.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},w=E=>{const k=c.value.find(C=>C.name===E);return k?k.type:null};return(E,k)=>{const C=a.resolveComponent("Button"),S=a.resolveComponent("InputIcon"),_=a.resolveComponent("InputText"),O=a.resolveComponent("IconField"),P=a.resolveComponent("Toolbar");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(P,{class:"p-2 my-2"},{start:a.withCtx(()=>[a.createElementVNode("div",Gy,[a.createVNode(C,{type:"button",size:"medium",icon:"pi pi-filter",label:"Filter",severity:"info",onClick:k[0]||(k[0]=v=>f())})]),a.createVNode(C,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warn",onClick:k[1]||(k[1]=v=>g())})]),end:a.withCtx(()=>[a.createVNode(O,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:a.withCtx(()=>[a.createVNode(S,{onClick:k[2]||(k[2]=v=>y()),class:"pi pi-search"}),a.createVNode(_,{class:"w-full sm:w-auto",onKeyup:k[3]||(k[3]=a.withKeys(v=>y(),["enter"])),modelValue:a.unref(l),"onUpdate:modelValue":k[4]||(k[4]=v=>a.isRef(l)?l.value=v:l=v),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(Xy,{sortBy:o.value,"onUpdate:sortBy":k[5]||(k[5]=v=>o.value=v),sortDirection:r.value,"onUpdate:sortDirection":k[6]||(k[6]=v=>r.value=v),showFilter:n.value,"onUpdate:showFilter":k[7]||(k[7]=v=>n.value=v),filters:i.value,"onUpdate:filters":k[8]||(k[8]=v=>i.value=v),headers:d.value,operatorMap:u,sortCallback:p,filterCallback:h,getColumnDatatype:x,getDatatypeByField:w},null,8,["sortBy","sortDirection","showFilter","filters","headers"])],64)}}},mi={__name:"EntityListPagination",setup(t){const e=a.ref(25),n=a.ref(0),i=a.ref(0),s=a.ref(0);let o=a.inject("entityObject");const r=async l=>{e.value=l.rows,n.value=l.page,s.value=l.first;const c={sortBy:o.state.data.sortBy,sortDirection:o.state.data.sortDirection,columnList:null,filter:o.state.data.filters,fullTextSearch:o.state.data.fullTextSearch,pageSize:e.value,currentPage:n.value},d=await o.searchRecord(o.state.data,c);if(d!=null&&d.success){let u=d==null?void 0:d.response;o.setEntity(u),i.value=d.response.totalRecords,s.value=n.value*e.value}};return a.watch(()=>{var l,c;return(c=(l=o==null?void 0:o.state)==null?void 0:l.data)==null?void 0:c.totalRecords},l=>{i&&(i.value=l)},{immediate:!0}),(l,c)=>{const d=a.resolveComponent("Paginator");return a.openBlock(),a.createBlock(d,{class:"my-4",rows:e.value,totalRecords:i.value,rowsPerPageOptions:[10,25,50,100],onPage:r,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Jy={class:"flex flex-row justify-end p-2 my-2"},Qt={__name:"EntityListAddButton",setup(t){const e=a.ref(!1),n=()=>{e.value=!0};return(i,s)=>{const o=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Jy,[a.createVNode(o,{label:"Add",size:"medium",icon:"pi pi-plus",onClick:s[0]||(s[0]=r=>n())})]),e.value?(a.openBlock(),a.createBlock(hi,{key:0,showEntityForm:e.value,"onUpdate:showEntityForm":s[1]||(s[1]=r=>e.value=r)},null,8,["showEntityForm"])):a.createCommentVNode("",!0)],64)}}},yl={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(t,{expose:e}){const n=xs(),i=ot();a.provide("entityObject",n);const s=t;return e({props:s,reload:()=>{console.log("reload data")}}),a.watch(()=>i.globalConfigs.appId,async r=>{if(r){const l=await n.getEntity(s.entityName);l.success?n.setEntity(l.response):n.setEntity({result:[]})}},{immediate:!0}),(r,l)=>{var c,d,u;return r.$slots["list-item-display"]?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:0})):a.createCommentVNode("",!0),t.listFilerSlot?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:1})):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(((u=(d=(c=a.unref(n))==null?void 0:c.state)==null?void 0:d.data)==null?void 0:u.result)||[],f=>a.renderSlot(r.$slots,"list-item-display",{item:f})),256))],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listHeader||By))),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt))),t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:0})):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listDisplay||Cy),a.normalizeProps(a.guardReactiveProps({listItemDisplay:t.listItemDisplay})),null,16)),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listPagination||mi))),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFooter||Ny)))],64))}}},Qy={key:0},Zy=["href"],eb={key:1},tb={class:"action-buttons"},nb=De({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listClass:String,listItemClass:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(t){const e=t;console.log("props entitylistsingle record",e.item);const n=a.inject("entityObject"),i=a.ref([]),s=a.ref(null),o=a.ref(null),r=a.ref(!1),l=a.ref(!1);a.onMounted(()=>{var h;e.linkedEntity&&e.linkedEntity.length>0?i.value=Object.keys(e.linkedEntity[0]).map(m=>({name:m})):i.value=n==null?void 0:n.getEntityColumns(n.state.data),s.value=((h=i==null?void 0:i.value)==null?void 0:h.find(m=>m.name===e.displayField))||null,s.value&&(o.value=e==null?void 0:e.item[s.value.name])});const c=()=>{r.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():r.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){r.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("ul",{class:a.normalizeClass(e.className)},[s.value?(a.openBlock(),a.createElementBlock("li",Qy,[a.createElementVNode("a",{href:`${t.baseUrl}/${t.item[t.hrefKey]}`,target:"_blank",class:"hover:underline"},a.toDisplayString(o.value),9,Zy)])):(a.openBlock(),a.createElementBlock("li",eb,[a.createElementVNode("span",null,"No matching field found for '"+a.toDisplayString(o.value)+"'.",1)])),a.createElementVNode("li",tb,[t.editable?(a.openBlock(),a.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):a.createCommentVNode("",!0),t.deletable?(a.openBlock(),a.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):a.createCommentVNode("",!0)])],2),l.value?(a.openBlock(),a.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):a.createCommentVNode("",!0),r.value?(a.openBlock(),a.createBlock(_s,{key:1,showDeleteDialog:r.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>r.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ff32a72b"]]),ib={key:0,class:"error-message"},sb={class:"text-red-500 font-bold"},ob={key:0},rb={key:1},ab={key:2},lb={key:3},cb={key:1},bl=De({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(t,{expose:e,emit:n}){const i=xs(),s=ot();a.provide("entityObject",i);const o=n,r=t,l=a.ref([]);return r.linkedEntity?a.watch(()=>r.linkedEntity,u=>{u&&(l.value=u,o("linkedEntityChanged",u))},{immediate:!0}):a.watch(()=>i.state.data,u=>{u&&(l.value=u.result,o("linkedEntityChanged",u.result))},{immediate:!0}),e({props:r,reload:()=>{console.log("reload data")},filter:u=>{console.log("filter data in unordered",u)}}),a.watch(()=>s.globalConfigs.appId,async u=>{if(u)if(r.linkedEntity&&r.linkedEntity.length>0)i.setEntity(r.linkedEntity);else{const f=await i.getEntity(r.entityName);i.setEntity(f.success?f.response:{result:[]})}},{immediate:!0}),(u,f)=>{var h,m,p;return a.openBlock(),a.createElementBlock("div",a.mergeProps(u.$attrs,{class:"flex flex-col"}),[a.renderSlot(u.$slots,"header",{},void 0,!0),u.$slots["list-item-display"]?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:0})):a.createCommentVNode("",!0),t.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:1})):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(t.listClass)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.linkedEntity&&t.linkedEntity.length>0?t.linkedEntity:((p=(m=(h=a.unref(i))==null?void 0:h.state)==null?void 0:m.data)==null?void 0:p.result)||[],g=>a.renderSlot(u.$slots,"list-item-display",{item:g,class:a.normalizeClass(t.listItemClass)},void 0,!0)),256))],2),t.showPagination?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listPagination||mi),{key:2})):a.createCommentVNode("",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[!t.displayField||!t.baseUrl||!t.hrefKey?(a.openBlock(),a.createElementBlock("div",ib,[a.createElementVNode("p",sb,[f[0]||(f[0]=a.createTextVNode(" Error: Missing required props - ")),t.entityName?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",ob,"Entity Name")),t.displayField?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",rb,"Display Field")),t.baseUrl?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",ab,"Base Url")),t.hrefKey?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",lb,"Href Key"))])])):(a.openBlock(),a.createElementBlock("div",cb,[t.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:0})):a.createCommentVNode("",!0),t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:1})):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(g,y)=>(a.openBlock(),a.createElementBlock("div",{key:y},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:nb),a.mergeProps({ref_for:!0},{item:g,...r}),null,16))]))),128)),t.showPagination?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listPagination||mi),{key:2})):a.createCommentVNode("",!0)])),a.renderSlot(u.$slots,"footer",{},void 0,!0)],64)),a.renderSlot(u.$slots,"footer",{},void 0,!0)],16)}}},[["__scopeId","data-v-36faf954"]]),db={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},ub={class:"flex justify-between items-start gap-4"},fb={class:"flex-grow"},hb={class:"flex flex-col gap-2"},mb={class:"font-bold text-gray-700"},pb={class:"text-gray-600"},gb={class:"flex flex-col gap-2"},yb=De({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t){const e=t,n=a.inject("entityObject"),i=a.ref([]),s=a.ref(null),o=a.ref(null),r=a.ref(!1),l=a.ref(!1);a.onMounted(()=>{i.value=n.getEntityColumns(n.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{r.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():r.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){r.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",db,[a.createElementVNode("div",ub,[a.createElementVNode("div",fb,[a.createElementVNode("div",hb,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(g,y)=>(a.openBlock(),a.createElementBlock("div",{key:y,class:"flex flex-col"},[a.createElementVNode("span",mb,a.toDisplayString(g.displayName||g.name)+":",1),a.createElementVNode("span",pb,a.toDisplayString(t.item[g.name]),1)]))),128))])]),a.createElementVNode("div",gb,[t.editable?(a.openBlock(),a.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):a.createCommentVNode("",!0),t.deletable?(a.openBlock(),a.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):a.createCommentVNode("",!0)])])]),l.value?(a.openBlock(),a.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):a.createCommentVNode("",!0),r.value?(a.openBlock(),a.createBlock(_s,{key:1,showDeleteDialog:r.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>r.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-6ec4735d"]]),bb={class:"flex flex-wrap gap-4 p-2"},xb={key:0,class:"error-message"},_b={class:"text-red-500 font-bold"},kb={key:0},Sb={key:1},wb={class:"flex flex-wrap gap-4 p-4"},xl=De({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,dynamicPropName:{type:String,default:"item"}},setup(t,{expose:e}){const n=xs(),i=ot();a.provide("entityObject",n);const s=t,o=a.ref([]);return a.watch(()=>n.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),a.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await n.getEntity(s.entityName);n.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return a.openBlock(),a.createElementBlock("div",a.normalizeProps(a.guardReactiveProps(c.$attrs)),[c.$slots["list-item-display-tile"]?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(c.$slots,"header",{},void 0,!0),t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:0})):a.createCommentVNode("",!0),t.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:1})):a.createCommentVNode("",!0),a.createElementVNode("div",bb,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(((h=(f=(u=a.unref(n))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],(m,p)=>(a.openBlock(),a.createElementBlock("div",{key:p,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[a.renderSlot(c.$slots,"list-item-display-tile",a.normalizeProps({[t.dynamicPropName||""]:m}),void 0,!0)]))),128))]),a.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.renderSlot(c.$slots,"header",{},void 0,!0),t.entityName?(a.openBlock(),a.createElementBlock("div",Sb,[t.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:0})):a.createCommentVNode("",!0),t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:1})):a.createCommentVNode("",!0),a.createElementVNode("div",wb,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(m,p)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:yb),a.mergeProps({key:p,ref_for:!0},{item:m,...s}),null,16))),128))]),t.showPagination?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listPagination||mi),{key:2})):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",xb,[a.createElementVNode("p",_b,[d[0]||(d[0]=a.createTextVNode(" Error: Missing required props - ")),t.entityName?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",kb,"Entity Name"))])])),a.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-705f9c5c"]]),Eb={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},Cb={class:"flex justify-between items-start gap-4"},Ob={class:"flex-grow"},vb={class:"flex flex-col gap-2"},Nb={class:"font-bold text-gray-700"},Db={class:"text-gray-600"},Tb={class:"flex flex-col gap-2"},Bb=De({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t){const e=t,n=a.inject("entityObject"),i=a.ref([]),s=a.ref(null),o=a.ref(null),r=a.ref(!1),l=a.ref(!1);a.onMounted(()=>{i.value=n.getEntityColumns(n.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{r.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():r.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){r.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=a.resolveComponent("Button");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Eb,[a.createElementVNode("div",Cb,[a.createElementVNode("div",Ob,[a.createElementVNode("div",vb,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(g,y)=>(a.openBlock(),a.createElementBlock("div",{key:y,class:"flex flex-col"},[a.createElementVNode("span",Nb,a.toDisplayString(g.displayName||g.name)+":",1),a.createElementVNode("span",Db,a.toDisplayString(t.item[g.name]),1)]))),128))])]),a.createElementVNode("div",Tb,[t.editable?(a.openBlock(),a.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):a.createCommentVNode("",!0),t.deletable?(a.openBlock(),a.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):a.createCommentVNode("",!0)])])]),l.value?(a.openBlock(),a.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):a.createCommentVNode("",!0),r.value?(a.openBlock(),a.createBlock(_s,{key:1,showDeleteDialog:r.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>r.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):a.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7e37c710"]]);/**
|
|
157
157
|
* Vue 3 Carousel 0.13.0
|
|
158
158
|
* (c) 2025
|
|
159
159
|
* @license MIT
|
|
160
|
-
*/const Ba=["viewport","carousel"],ni={"bottom-to-top":"btt","left-to-right":"ltr","right-to-left":"rtl","top-to-bottom":"ttb"},Ma=["ltr","left-to-right","rtl","right-to-left","ttb","top-to-bottom","btt","bottom-to-top"],oy={ariaGallery:"Gallery",ariaNavigateToPage:"Navigate to page {slideNumber}",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",iconArrowDown:"Arrow pointing downwards",iconArrowLeft:"Arrow pointing to the left",iconArrowRight:"Arrow pointing to the right",iconArrowUp:"Arrow pointing upwards",itemXofY:"Item {currentSlide} of {slidesCount}"};Object.values(ni);const Va=["slide","fade"],Aa=["center","start","end","center-even","center-odd"],Pe={autoplay:0,breakpointMode:Ba[0],breakpoints:void 0,dir:Ma[0],enabled:!0,gap:0,height:"auto",i18n:oy,ignoreAnimations:!1,itemsToScroll:1,itemsToShow:1,modelValue:0,mouseDrag:!0,pauseAutoplayOnHover:!1,preventExcessiveDragging:!1,slideEffect:Va[0],snapAlign:Aa[0],touchDrag:!0,transition:300,wrapAround:!1},ln=Symbol("carousel"),ry=n=>{const e=r.shallowReactive([]),t=i=>{i!==void 0?e.slice(i).forEach((s,o)=>{var a;(a=s.exposed)===null||a===void 0||a.setIndex(i+o)}):e.forEach((s,o)=>{var a;(a=s.exposed)===null||a===void 0||a.setIndex(o)})};return{cleanup:()=>{e.splice(0,e.length)},getSlides:()=>e,registerSlide:(i,s)=>{if(!i||i.props.isClone)return;const o=s??e.length;e.splice(o,0,i),t(o),n("slide-registered",{slide:i,index:o})},unregisterSlide:i=>{const s=e.indexOf(i);s!==-1&&(n("slide-unregistered",{slide:i,index:s}),e.splice(s,1),t(s))}}};function ay(n){return n.length===0?0:n.reduce((t,i)=>t+i,0)/n.length}function Fa({slides:n,position:e,toShow:t}){const i=[],s=e==="before",o=s?-t:0,a=s?0:t;if(n.length<=0)return i;for(let l=o;l<a;l++){const d={index:s?l:l+n.length,isClone:!0,position:e,id:void 0,key:`clone-${e}-${l}`},u=n[(l%n.length+n.length)%n.length].vnode,f=r.cloneVNode(u,d);f.el=null,i.push(f)}return i}const ly='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';function $a(n){if(!n.el||!(n.el instanceof Element))return;const e=n.el.querySelectorAll(ly);for(const t of e)t instanceof HTMLElement&&!t.hasAttribute("disabled")&&t.getAttribute("aria-hidden")!=="true"&&t.setAttribute("tabindex","-1")}function cy(n,e){return Object.keys(n).filter(t=>!e.includes(t)).reduce((t,i)=>(t[i]=n[i],t),{})}function dy(n){const{isVertical:e,isReversed:t,dragged:i,effectiveSlideSize:s}=n,o=e?i.y:i.x;if(o===0)return 0;const a=Math.round(o/s);return t?a:-a}function Ot({val:n,max:e,min:t}){return e<t?n:Math.min(Math.max(n,isNaN(t)?n:t),isNaN(e)?n:e)}function uy(n){const{transform:e}=window.getComputedStyle(n);return e.split(/[(,)]/).slice(1,-1).map(t=>parseFloat(t))}function fy(n){let e=1,t=1;return n.forEach(i=>{const s=uy(i);s.length===6&&(e/=s[0],t/=s[3])}),{widthMultiplier:e,heightMultiplier:t}}function hy(n,e){switch(n){case"start":return 0;case"center":case"center-odd":return(e-1)/2;case"center-even":return(e-2)/2;case"end":return e-1;default:return 0}}function my(n,e,t){switch(n){case"start":return 0;case"center":case"center-odd":return(t-e)/2;case"center-even":return t/2-e;case"end":return t-e;default:return 0}}function mo({slideSize:n,viewportSize:e,align:t,itemsToShow:i}){return i!==void 0?hy(t,i):n!==void 0&&e!==void 0?my(t,n,e):0}function Ia(n="",e={}){return Object.entries(e).reduce((t,[i,s])=>t.replace(`{${i}}`,String(s)),n)}function La({val:n,max:e,min:t=0}){const i=e-t+1;return((n-t)%i+i)%i+t}function po(n,e=0){let t=!1,i=0,s=null;function o(...a){if(t)return;t=!0;const l=()=>{s=requestAnimationFrame(c=>{c-i>e?(i=c,n(...a),t=!1):l()})};l()}return o.cancel=()=>{s&&(cancelAnimationFrame(s),s=null,t=!1)},o}function ss(n,e="px"){if(!(n==null||n===""))return typeof n=="number"||parseFloat(n).toString()===n?`${n}${e}`:n}const py=r.defineComponent({name:"CarouselAria",setup(){const n=r.inject(ln);return n?()=>r.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},Ia(n.config.i18n.itemXofY,{currentSlide:n.currentSlide+1,slidesCount:n.slidesCount})):()=>""}}),gy={autoplay:{default:Pe.autoplay,type:Number},breakpoints:{default:Pe.breakpoints,type:Object},breakpointMode:{default:Pe.breakpointMode,validator(n){return Ba.includes(n)}},enabled:{default:Pe.enabled,type:Boolean},gap:{default:Pe.gap,type:Number},height:{default:Pe.height,type:[Number,String]},ignoreAnimations:{default:!1,type:[Array,Boolean,String]},itemsToScroll:{default:Pe.itemsToScroll,type:Number},itemsToShow:{default:Pe.itemsToShow,type:[Number,String]},i18n:{default:Pe.i18n,type:Object},modelValue:{default:void 0,type:Number},mouseDrag:{default:Pe.mouseDrag,type:Boolean},touchDrag:{default:Pe.touchDrag,type:Boolean},pauseAutoplayOnHover:{default:Pe.pauseAutoplayOnHover,type:Boolean},preventExcessiveDragging:{default:!1,type:Boolean,validator(n,e){return n&&e.wrapAround&&console.warn('[vue3-carousel warn]: "preventExcessiveDragging" cannot be used with wrapAround. The setting will be ignored.'),!0}},snapAlign:{default:Pe.snapAlign,validator(n){return Aa.includes(n)}},slideEffect:{type:String,default:Pe.slideEffect,validator(n){return Va.includes(n)}},transition:{default:Pe.transition,type:Number},dir:{type:String,default:Pe.dir,validator(n,e){if(!Ma.includes(n))return!1;const t=n in ni?ni[n]:n;return["ttb","btt"].includes(t)&&(!e.height||e.height==="auto")&&console.warn(`[vue3-carousel warn]: The dir "${n}" is not supported with height "auto".`),!0}},wrapAround:{default:Pe.wrapAround,type:Boolean}},Ra=r.defineComponent({name:"VueCarousel",props:gy,emits:["before-init","drag","init","loop","slide-end","slide-registered","slide-start","slide-unregistered","update:modelValue"],setup(n,{slots:e,emit:t,expose:i}){var s;const o=ry(t),a=o.getSlides(),l=r.computed(()=>a.length),c=r.ref(null),d=r.ref(null),u=r.ref(0),f=r.computed(()=>Object.assign(Object.assign(Object.assign({},Pe),cy(n,["breakpoints","modelValue"])),{i18n:Object.assign(Object.assign({},Pe.i18n),n.i18n)})),h=r.shallowReactive(Object.assign({},f.value)),m=r.ref((s=n.modelValue)!==null&&s!==void 0?s:0),p=r.ref(m.value);r.watch(m,M=>p.value=M);const g=r.ref(0),y=r.computed(()=>Math.ceil((l.value-1)/2)),b=r.computed(()=>l.value-1),_=r.computed(()=>0);let w=null,E=null,k=null;const C=r.computed(()=>u.value+h.gap),S=r.computed(()=>{const M=h.dir||"ltr";return M in ni?ni[M]:M}),x=r.computed(()=>["rtl","btt"].includes(S.value)),v=r.computed(()=>["ttb","btt"].includes(S.value)),B=r.computed(()=>h.itemsToShow==="auto"),D=r.computed(()=>v.value?"height":"width");function T(){var M;if(!Y.value)return;const W=(f.value.breakpointMode==="carousel"?(M=c.value)===null||M===void 0?void 0:M.getBoundingClientRect().width:typeof window<"u"?window.innerWidth:0)||0,X=Object.keys(n.breakpoints||{}).map(ie=>Number(ie)).sort((ie,ye)=>+ye-+ie),K={};X.some(ie=>W>=ie?(Object.assign(K,n.breakpoints[ie]),K.i18n&&Object.assign(K.i18n,f.value.i18n,n.breakpoints[ie].i18n),!0):!1),Object.assign(h,f.value,K)}const I=po(()=>{T(),R(),P()}),q=r.shallowReactive(new Set),L=r.ref([]);function A({widthMultiplier:M,heightMultiplier:W}){L.value=a.map(X=>{var K;const ie=(K=X.exposed)===null||K===void 0?void 0:K.getBoundingRect();return{width:ie.width*M,height:ie.height*W}})}const j=r.ref({width:0,height:0});function $({widthMultiplier:M,heightMultiplier:W}){var X;const K=((X=d.value)===null||X===void 0?void 0:X.getBoundingClientRect())||{width:0,height:0};j.value={width:K.width*M,height:K.height*W}}function P(){if(!d.value)return;const M=fy(q);if($(M),A(M),B.value)u.value=ay(L.value.map(W=>W[D.value]));else{const W=Number(h.itemsToShow),X=(W-1)*h.gap;u.value=(j.value[D.value]-X)/W}}function R(){!h.wrapAround&&l.value>0&&(m.value=Ot({val:m.value,max:b.value,min:_.value})),B.value||(h.itemsToShow=Ot({val:Number(h.itemsToShow),max:l.value,min:1}))}const G=r.computed(()=>typeof n.ignoreAnimations=="string"?n.ignoreAnimations.split(","):Array.isArray(n.ignoreAnimations)?n.ignoreAnimations:n.ignoreAnimations?!1:[]);r.watchEffect(()=>R()),r.watchEffect(()=>{P()});let se;const ne=M=>{const W=M.target;if(!(!(W!=null&&W.contains(c.value))||Array.isArray(G.value)&&G.value.includes(M.animationName))&&(q.add(W),!se)){const X=()=>{se=requestAnimationFrame(()=>{P(),X()})};X()}},Q=M=>{const W=M.target;W&&q.delete(W),se&&q.size===0&&(cancelAnimationFrame(se),P())},Y=r.ref(!1);typeof document<"u"&&r.watchEffect(()=>{Y.value&&G.value!==!1?(document.addEventListener("animationstart",ne),document.addEventListener("animationend",Q)):(document.removeEventListener("animationstart",ne),document.removeEventListener("animationend",Q))}),r.onMounted(()=>{Y.value=!0,T(),De(),c.value&&(k=new ResizeObserver(I),k.observe(c.value)),t("init")}),r.onBeforeUnmount(()=>{Y.value=!1,o.cleanup(),E&&clearTimeout(E),se&&cancelAnimationFrame(se),w&&clearInterval(w),k&&(k.disconnect(),k=null),typeof document<"u"&&ue(),c.value&&(c.value.removeEventListener("transitionend",P),c.value.removeEventListener("animationiteration",P))});let te=!1;const ce={x:0,y:0},_e=r.reactive({x:0,y:0}),Qe=r.ref(!1),ze=r.ref(!1),ft=()=>{Qe.value=!0},it=()=>{Qe.value=!1},H=po(M=>{if(!M.ctrlKey)switch(M.key){case"ArrowLeft":case"ArrowUp":v.value===M.key.endsWith("Up")&&(x.value?st(!0):tn(!0));break;case"ArrowRight":case"ArrowDown":v.value===M.key.endsWith("Down")&&(x.value?tn(!0):st(!0));break}},200),F=()=>{document.addEventListener("keydown",H)},ue=()=>{document.removeEventListener("keydown",H)};function he(M){const W=M.target.tagName;if(["INPUT","TEXTAREA","SELECT"].includes(W)||Ae.value||(te=M.type==="touchstart",!te&&(M.preventDefault(),M.button!==0)))return;ce.x="touches"in M?M.touches[0].clientX:M.clientX,ce.y="touches"in M?M.touches[0].clientY:M.clientY;const X=te?"touchmove":"mousemove",K=te?"touchend":"mouseup";document.addEventListener(X,fe,{passive:!1}),document.addEventListener(K,me,{passive:!0})}const fe=po(M=>{ze.value=!0;const W="touches"in M?M.touches[0].clientX:M.clientX,X="touches"in M?M.touches[0].clientY:M.clientY;_e.x=W-ce.x,_e.y=X-ce.y;const K=dy({isVertical:v.value,isReversed:x.value,dragged:_e,effectiveSlideSize:C.value});p.value=h.wrapAround?m.value+K:Ot({val:m.value+K,max:b.value,min:_.value}),t("drag",{deltaX:_e.x,deltaY:_e.y})});function me(){if(fe.cancel(),p.value!==m.value&&!te){const X=K=>{K.preventDefault(),window.removeEventListener("click",X)};window.addEventListener("click",X)}Ke(p.value),_e.x=0,_e.y=0,ze.value=!1;const M=te?"touchmove":"mousemove",W=te?"touchend":"mouseup";document.removeEventListener(M,fe),document.removeEventListener(W,me)}function De(){!h.autoplay||h.autoplay<=0||(w=setInterval(()=>{h.pauseAutoplayOnHover&&Qe.value||st()},h.autoplay))}function Ye(){w&&(clearInterval(w),w=null)}function St(){Ye(),De()}const Ae=r.ref(!1);function Ke(M,W=!1){if(!W&&Ae.value)return;let X=M,K=M;g.value=m.value,h.wrapAround?K=La({val:X,max:b.value,min:_.value}):X=Ot({val:X,max:b.value,min:_.value}),t("slide-start",{slidingToIndex:M,currentSlideIndex:m.value,prevSlideIndex:g.value,slidesCount:l.value}),Ye(),Ae.value=!0,m.value=X,K!==X&&_n.pause(),t("update:modelValue",K),E=setTimeout(()=>{h.wrapAround&&K!==X&&(_n.resume(),m.value=K,t("loop",{currentSlideIndex:m.value,slidingToIndex:M})),t("slide-end",{currentSlideIndex:m.value,prevSlideIndex:g.value,slidesCount:l.value}),Ae.value=!1,St()},h.transition)}function st(M=!1){Ke(m.value+h.itemsToScroll,M)}function tn(M=!1){Ke(m.value-h.itemsToScroll,M)}function nn(){T(),R(),P(),St()}r.watch(()=>[f.value,n.breakpoints],()=>T(),{deep:!0}),r.watch(()=>n.autoplay,()=>St());const _n=r.watch(()=>n.modelValue,M=>{M!==m.value&&Ke(Number(M),!0)});t("before-init");const Z=r.computed(()=>{if(!h.wrapAround)return{before:0,after:0};if(B.value)return{before:a.length,after:a.length};const M=Number(h.itemsToShow),W=Math.ceil(M+(h.itemsToScroll-1)),X=W-p.value,K=W-(l.value-(p.value+1));return{before:Math.max(0,X),after:Math.max(0,K)}}),ht=r.computed(()=>Z.value.before?B.value?L.value.slice(-1*Z.value.before).reduce((M,W)=>M+W[D.value]+h.gap,0)*-1:Z.value.before*C.value*-1:0),Oe=r.computed(()=>{var M;if(B.value){const W=(m.value%a.length+a.length)%a.length;return mo({slideSize:(M=L.value[W])===null||M===void 0?void 0:M[D.value],viewportSize:j.value[D.value],align:h.snapAlign})}return mo({align:h.snapAlign,itemsToShow:+h.itemsToShow})}),N=r.computed(()=>{let M=0;if(B.value){if(m.value<0?M=L.value.slice(m.value).reduce((W,X)=>W+X[D.value]+h.gap,0)*-1:M=L.value.slice(0,m.value).reduce((W,X)=>W+X[D.value]+h.gap,0),M-=Oe.value,!h.wrapAround){const W=L.value.reduce((X,K)=>X+K[D.value]+h.gap,0)-j.value[D.value]-h.gap;M=Ot({val:M,max:W,min:0})}}else{let W=m.value-Oe.value;h.wrapAround||(W=Ot({val:W,max:l.value-+h.itemsToShow,min:0})),M=W*C.value}return M*(x.value?1:-1)}),O=r.computed(()=>{var M,W;if(!B.value){const ie=m.value-Oe.value;return h.wrapAround?{min:Math.floor(ie),max:Math.ceil(ie+Number(h.itemsToShow)-1)}:{min:Math.floor(Ot({val:ie,max:l.value-Number(h.itemsToShow),min:0})),max:Math.ceil(Ot({val:ie+Number(h.itemsToShow)-1,max:l.value-1,min:0}))}}let X=0;{let ie=0,ye=0-Z.value.before;const ve=Math.abs(N.value+ht.value);for(;ie<=ve;){const Le=(ye%a.length+a.length)%a.length;ie+=((M=L.value[Le])===null||M===void 0?void 0:M[D.value])+h.gap,ye++}X=ye-1}let K=0;{let ie=X,ye=0;for(ie<0?ye=L.value.slice(0,ie).reduce((ve,Le)=>ve+Le[D.value]+h.gap,0)-Math.abs(N.value+ht.value):ye=L.value.slice(0,ie).reduce((ve,Le)=>ve+Le[D.value]+h.gap,0)-Math.abs(N.value);ye<j.value[D.value];){const ve=(ie%a.length+a.length)%a.length;ye+=((W=L.value[ve])===null||W===void 0?void 0:W[D.value])+h.gap,ie++}K=ie-1}return{min:Math.floor(X),max:Math.ceil(K)}}),V=r.computed(()=>{if(h.slideEffect==="fade")return;const M=v.value?"Y":"X",W=v.value?_e.y:_e.x;let X=N.value+W;if(!h.wrapAround&&h.preventExcessiveDragging){let K=0;B.value?K=L.value.reduce((ve,Le)=>ve+Le[D.value],0):K=(l.value-Number(h.itemsToShow))*C.value;const ie=x.value?0:-1*K,ye=x.value?K:0;X=Ot({val:X,min:ie,max:ye})}return`translate${M}(${X}px)`}),U=r.computed(()=>({"--vc-transition-duration":Ae.value?ss(h.transition,"ms"):void 0,"--vc-slide-gap":ss(h.gap),"--vc-carousel-height":ss(h.height),"--vc-cloned-offset":ss(ht.value)})),ee={slideTo:Ke,next:st,prev:tn},re=r.reactive({activeSlide:p,config:h,currentSlide:m,isSliding:Ae,isVertical:v,maxSlide:b,minSlide:_,nav:ee,normalizedDir:S,slideRegistry:o,slideSize:u,slides:a,slidesCount:l,viewport:d,visibleRange:O});r.provide(ln,re);const J=r.reactive({config:h,currentSlide:m,maxSlide:b,middleSlide:y,minSlide:_,slideSize:u,slidesCount:l});return i({data:J,nav:ee,next:st,prev:tn,restartCarousel:nn,slideTo:Ke,updateBreakpointsConfig:T,updateSlideSize:P,updateSlidesData:R}),()=>{var M;const W=e.default||e.slides,X=(W==null?void 0:W(J))||[],{before:K,after:ie}=Z.value,ye=Fa({slides:a,position:"before",toShow:K}),ve=Fa({slides:a,position:"after",toShow:ie}),Le=[...ye,...X,...ve];if(!h.enabled||!Le.length)return r.h("section",{ref:c,class:["carousel","is-disabled"]},Le);const $i=((M=e.addons)===null||M===void 0?void 0:M.call(e,J))||[],Ii=r.h("ol",{class:"carousel__track",style:{transform:V.value},onMousedownCapture:h.mouseDrag?he:null,onTouchstartPassiveCapture:h.touchDrag?he:null},Le),Li=r.h("div",{class:"carousel__viewport",ref:d},Ii);return r.h("section",{ref:c,class:["carousel",`is-${S.value}`,`is-effect-${h.slideEffect}`,{"is-vertical":v.value,"is-sliding":Ae.value,"is-dragging":ze.value,"is-hover":Qe.value}],dir:S.value,style:U.value,"aria-label":h.i18n.ariaGallery,tabindex:"0",onFocus:F,onBlur:ue,onMouseenter:ft,onMouseleave:it},[Li,$i,r.h(py)])}}});var go;(function(n){n.arrowDown="arrowDown",n.arrowLeft="arrowLeft",n.arrowRight="arrowRight",n.arrowUp="arrowUp"})(go||(go={}));const ja=n=>`icon${n.charAt(0).toUpperCase()+n.slice(1)}`,yy={arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"};function by(n){return n in go}const za=n=>n&&by(n),Wa=r.defineComponent({props:{name:{type:String,required:!0,validator:za},title:{type:String,default:n=>n.name?Pe.i18n[ja(n.name)]:""}},setup(n){const e=r.inject(ln,null);return()=>{const t=n.name;if(!t||!za(t))return;const i=yy[t],s=r.h("path",{d:i}),o=(e==null?void 0:e.config.i18n[ja(t)])||n.title,a=r.h("title",o);return r.h("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":o},[a,s])}}}),Ha=r.defineComponent({name:"CarouselNavigation",inheritAttrs:!1,setup(n,{slots:e,attrs:t}){const i=r.inject(ln);if(!i)return()=>"";const{next:s,prev:o}=e,a=()=>({btt:"arrowDown",ltr:"arrowLeft",rtl:"arrowRight",ttb:"arrowUp"})[i.normalizedDir],l=()=>({btt:"arrowUp",ltr:"arrowRight",rtl:"arrowLeft",ttb:"arrowDown"})[i.normalizedDir],c=r.computed(()=>!i.config.wrapAround&&i.currentSlide<=i.minSlide),d=r.computed(()=>!i.config.wrapAround&&i.currentSlide>=i.maxSlide);return()=>{const{i18n:u}=i.config,f=r.h("button",Object.assign(Object.assign({type:"button",disabled:c.value,"aria-label":u.ariaPreviousSlide,title:u.ariaPreviousSlide,onClick:i.nav.prev},t),{class:["carousel__prev",{"carousel__prev--disabled":c.value},t.class]}),(o==null?void 0:o())||r.h(Wa,{name:a()})),h=r.h("button",Object.assign(Object.assign({type:"button",disabled:d.value,"aria-label":u.ariaNextSlide,title:u.ariaNextSlide,onClick:i.nav.next},t),{class:["carousel__next",{"carousel__next--disabled":d.value},t.class]}),(s==null?void 0:s())||r.h(Wa,{name:l()}));return[f,h]}}});r.defineComponent({name:"CarouselPagination",props:{disableOnClick:{type:Boolean},paginateByItemsToShow:{type:Boolean}},setup(n){const e=r.inject(ln);if(!e)return()=>"";const t=r.computed(()=>e.config.itemsToShow),i=r.computed(()=>mo({align:e.config.snapAlign,itemsToShow:t.value})),s=r.computed(()=>n.paginateByItemsToShow&&t.value>1),o=r.computed(()=>Math.ceil((e.activeSlide-i.value)/t.value)),a=r.computed(()=>Math.ceil(e.slidesCount/t.value)),l=c=>La(s.value?{val:o.value,max:a.value-1,min:0}:{val:e.activeSlide,max:e.maxSlide,min:e.minSlide})===c;return()=>{var c,d;const u=[];for(let f=s.value?0:e.minSlide;f<=(s.value?a.value-1:e.maxSlide);f++){const h=Ia(e.config.i18n[s.value?"ariaNavigateToPage":"ariaNavigateToSlide"],{slideNumber:f+1}),m=l(f),p=r.h("button",{type:"button",class:{"carousel__pagination-button":!0,"carousel__pagination-button--active":m},"aria-label":h,"aria-pressed":m,"aria-controls":(d=(c=e.slides[f])===null||c===void 0?void 0:c.exposed)===null||d===void 0?void 0:d.id,title:h,disabled:n.disableOnClick,onClick:()=>e.nav.slideTo(s.value?Math.floor(f*+e.config.itemsToShow+i.value):f)}),g=r.h("li",{class:"carousel__pagination-item",key:f},p);u.push(g)}return r.h("ol",{class:"carousel__pagination"},u)}}});const Ua=r.defineComponent({name:"CarouselSlide",props:{id:{type:String,default:n=>n.isClone?void 0:r.useId()},index:{type:Number,default:void 0},isClone:{type:Boolean,default:!1},position:{type:String,default:void 0}},setup(n,{attrs:e,slots:t,expose:i}){const s=r.inject(ln);if(r.provide(ln,void 0),!s)return()=>"";const o=r.ref(n.index),a=p=>{o.value=p},l=r.getCurrentInstance(),c=()=>{const p=l.vnode.el;return p?p.getBoundingClientRect():{width:0,height:0}};i({id:n.id,setIndex:a,getBoundingRect:c});const d=r.computed(()=>o.value===s.activeSlide),u=r.computed(()=>o.value===s.activeSlide-1),f=r.computed(()=>o.value===s.activeSlide+1),h=r.computed(()=>o.value>=s.visibleRange.min&&o.value<=s.visibleRange.max),m=r.computed(()=>{if(s.config.itemsToShow==="auto")return;const p=s.config.itemsToShow,g=s.config.gap>0&&p>1?`calc(${100/p}% - ${s.config.gap*(p-1)/p}px)`:`${100/p}%`;return s.isVertical?{height:g}:{width:g}});return s.slideRegistry.registerSlide(l,n.index),r.onUnmounted(()=>{s.slideRegistry.unregisterSlide(l)}),n.isClone&&(r.onMounted(()=>{$a(l.vnode)}),r.onUpdated(()=>{$a(l.vnode)})),()=>{var p,g;return s.config.enabled?r.h("li",{style:[e.style,Object.assign({},m.value)],class:{carousel__slide:!0,"carousel__slide--clone":n.isClone,"carousel__slide--visible":h.value,"carousel__slide--active":d.value,"carousel__slide--prev":u.value,"carousel__slide--next":f.value,"carousel__slide--sliding":s.isSliding},onFocusin:()=>{s.viewport&&(s.viewport.scrollLeft=0),s.nav.slideTo(o.value)},id:n.isClone?void 0:n.id,"aria-hidden":n.isClone||void 0},(g=t.default)===null||g===void 0?void 0:g.call(t,{currentIndex:o.value,isActive:d.value,isClone:n.isClone,isPrev:u.value,isNext:f.value,isSliding:s.isSliding,isVisible:h.value})):(p=t.default)===null||p===void 0?void 0:p.call(t)}}}),xy={class:"p-4 mb-4 flex flex-wrap gap-2 border border-gray-300 shadow-md rounded-lg"},_y={key:0,class:"error-message"},ky={class:"text-red-500 font-bold"},Sy={key:0},wy={key:1,class:"mb-4 mt-4"},qa=Be({__name:"EntityListingCarousel",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(n,{expose:e}){const t=ns(),i=Ze();r.provide("entityObject",t);const s=n,o=r.ref([]);return r.watch(()=>t.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await t.getEntity(s.entityName);t.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[c.$slots["list-item-display-carousel"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:0})):r.createCommentVNode("",!0),n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),o.value.length>1?(r.openBlock(),r.createBlock(r.unref(Ra),{key:2,"items-to-show":5,"wrap-around":!0,autoplay:2e3,pauseAutoplayOnHover:!0,transition:500},{addons:r.withCtx(()=>[r.createVNode(r.unref(Ha))]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(u,f)=>(r.openBlock(),r.createBlock(r.unref(Ua),{key:f},{default:r.withCtx(()=>[r.createElementVNode("div",xy,[r.renderSlot(c.$slots,"list-item-display-carousel",{item:u},void 0,!0)])]),_:2},1024))),128))]),_:3})):r.createCommentVNode("",!0),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),n.entityName?(r.openBlock(),r.createElementBlock("div",wy,[n.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:0})):r.createCommentVNode("",!0),n.showAddButton?(r.openBlock(),r.createBlock(Wt,{key:1})):r.createCommentVNode("",!0),o.value.length?(r.openBlock(),r.createBlock(r.unref(Ra),{key:2,"items-to-show":3,"wrap-around":!1,mouseDrag:!0,pauseAutoplayOnHover:!0,breakpoints:{1024:{itemsToShow:3},950:{itemsToShow:2},768:{itemsToShow:1},340:{itemsToShow:1}}},{addons:r.withCtx(()=>[r.createVNode(r.unref(Ha))]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(u,f)=>(r.openBlock(),r.createBlock(r.unref(Ua),{key:f},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listItemDisplay&&n.listItemDisplay!==""?n.listItemDisplay:sy),r.mergeProps({ref_for:!0},{item:u,...s}),null,16))]),_:2},1024))),128))]),_:1})):r.createCommentVNode("",!0),n.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listPagination||ti),{key:3})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",_y,[r.createElementVNode("p",ky,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Sy,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16))}},[["__scopeId","data-v-84369e22"]]);class Ey{constructor(){this.httpService=new gr}async getEntities(){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity`)}getEntity(e){}saveEntity(){}async getAppId(){const e=Ze();this.appId=e.getAppId()}}const Ya=pr("entitiesStore",{state:()=>({entities:[],entityService:new Ey}),actions:{async fetchEntities(){try{return await this.entityService.getEntities()}catch(n){console.error("Error fetching entities:",n)}finally{}},async getEntities(){if(this.entities.length===0){const n=await this.fetchEntities();return this.setEntities(n.response),this.entities}else return this.entities},setEntities(n){this.entities=n}},getters:{}}),Cy={class:"field flex flex-col w-full"},vy={key:0,class:"flex items-center"},Dy={key:1},Ny={class:"flex items-center"},yo={__name:"EntitySelection",props:{entityName:String,onEntityChangeCallback:Function},setup(n){const e=Ze(),t=r.ref(""),i=Ya(),s=r.ref([]),o=async()=>{s.value=await i.getEntities(),a()},a=()=>{for(let c=0;c<s.value.length;c++){const d=s.value[c];d.name.toLowerCase()==n.entityName.toLowerCase()&&(t.value=d)}},l=()=>{n.onEntityChangeCallback(t.value.name)};return r.watch(()=>e.globalConfigs.appId,async c=>{c&&await o()},{immediate:!0}),(c,d)=>{const u=r.resolveComponent("Select");return r.openBlock(),r.createElementBlock("div",Cy,[r.createVNode(u,{modelValue:t.value,"onUpdate:modelValue":[d[0]||(d[0]=f=>t.value=f),l],options:s.value,filter:"",optionLabel:"name",placeholder:"Select entity",class:"w-full"},{value:r.withCtx(f=>[f.value?(r.openBlock(),r.createElementBlock("div",vy,[r.createElementVNode("div",null,r.toDisplayString(f.value.name),1)])):(r.openBlock(),r.createElementBlock("span",Dy,r.toDisplayString(f.placeholder),1))]),option:r.withCtx(f=>[r.createElementVNode("div",Ny,[r.createElementVNode("div",null,r.toDisplayString(f.option.name),1)])]),_:1},8,["modelValue","options"])])}}},Ka={__name:"FieldExpression",props:["value"],setup(n){return(e,t)=>(r.openBlock(),r.createElementBlock("span",null,r.toDisplayString(n.value),1))}},Oy={class:"flex flex-col w-full"},Ty={class:"w-1/4"},Py={class:"w-full mt-5"},Xa={__name:"EntityExplorer",props:{entityName:String},setup(n){const e=n,t=r.ref(e.entityName);r.watch(t,s=>{console.log("Entity changed to:",s)});const i=s=>{t.value=s};return(s,o)=>(r.openBlock(),r.createElementBlock("div",Oy,[r.createElementVNode("div",Ty,[(r.openBlock(),r.createBlock(yo,{key:t.value,entityName:t.value,onEntityChangeCallback:i},null,8,["entityName"]))]),r.createElementVNode("div",Py,[(r.openBlock(),r.createBlock(ao,{key:t.value,entityName:t.value},null,8,["entityName"]))])]))}},By={install(n,e){n.component("CSEntityGrid",ao),n.component("csentitygrid",ao),n.component("CSEntityList",Oa),n.component("csentitylist",Oa),n.component("CSFieldExpression",Ka),n.component("csfieldexpression",Ka),n.component("CSEntityBarChart",wa),n.component("csentitybarchart",wa),n.component("CSEntityLineChart",Ea),n.component("csentitylinechart",Ea),n.component("CSEntityPieChart",Ca),n.component("csentitypiechart",Ca),n.component("CSEntityPolarChart",va),n.component("csentitypolarchart",va),n.component("CSEntityRadarChart",Da),n.component("csentityradarchart",Da),n.component("CSEntity360View",Na),n.component("csentity360view",Na),n.component("CSEntityListing",Ta),n.component("csentitylisting",Ta),n.component("CSEntityListingTile",Pa),n.component("csentitylistingtile",Pa),n.component("CSEntityListingCarousel",qa),n.component("csentitylistingcarousel",qa),n.component("CSEntitySelection",yo),n.component("csentityselection",yo),n.component("CSEntityExplorer",Xa),n.component("csentityexplorer",Xa)}},Ga=6048e5,My=864e5,Qa=Symbol.for("constructDateFrom");function Ht(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&Qa in n?n[Qa](e):n instanceof Date?new n.constructor(e):new Date(e)}function ct(n,e){return Ht(e||n,n)}let Vy={};function os(){return Vy}function ii(n,e){var l,c,d,u;const t=os(),i=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((u=(d=t.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,e==null?void 0:e.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function rs(n,e){return ii(n,{...e,weekStartsOn:1})}function Ja(n,e){const t=ct(n,e==null?void 0:e.in),i=t.getFullYear(),s=Ht(t,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=rs(s),a=Ht(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=rs(a);return t.getTime()>=o.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Za(n){const e=ct(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function Ay(n,...e){const t=Ht.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function el(n,e){const t=ct(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Fy(n,e,t){const[i,s]=Ay(t==null?void 0:t.in,n,e),o=el(i),a=el(s),l=+o-Za(o),c=+a-Za(a);return Math.round((l-c)/My)}function $y(n,e){const t=Ja(n,e),i=Ht(n,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),rs(i)}function Iy(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ly(n){return!(!Iy(n)&&typeof n!="number"||isNaN(+ct(n)))}function Ry(n,e){const t=ct(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const jy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},zy=(n,e,t)=>{let i;const s=jy[n];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function bo(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const Wy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Hy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qy={date:bo({formats:Wy,defaultWidth:"full"}),time:bo({formats:Hy,defaultWidth:"full"}),dateTime:bo({formats:Uy,defaultWidth:"full"})},Yy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ky=(n,e,t,i)=>Yy[n];function si(n){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=t!=null&&t.width?String(t.width):a;s=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=t!=null&&t.width?String(t.width):n.defaultWidth;s=n.values[l]||n.values[a]}const o=n.argumentCallback?n.argumentCallback(e):e;return s[o]}}const Xy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Jy={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Zy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},eb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},tb={ordinalNumber:(n,e)=>{const t=Number(n),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:si({values:Xy,defaultWidth:"wide"}),quarter:si({values:Gy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:si({values:Qy,defaultWidth:"wide"}),day:si({values:Jy,defaultWidth:"wide"}),dayPeriod:si({values:Zy,defaultWidth:"wide",formattingValues:eb,defaultFormattingWidth:"wide"})};function oi(n){return(e,t={})=>{const i=t.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?ib(l,f=>f.test(a)):nb(l,f=>f.test(a));let d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function nb(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function ib(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function sb(n){return(e,t={})=>{const i=e.match(n.matchPattern);if(!i)return null;const s=i[0],o=e.match(n.parsePattern);if(!o)return null;let a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const ob=/^(\d+)(th|st|nd|rd)?/i,rb=/\d+/i,ab={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},lb={any:[/^b/i,/^(a|c)/i]},cb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},db={any:[/1/i,/2/i,/3/i,/4/i]},ub={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},fb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},mb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},gb={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yb={ordinalNumber:sb({matchPattern:ob,parsePattern:rb,valueCallback:n=>parseInt(n,10)}),era:oi({matchPatterns:ab,defaultMatchWidth:"wide",parsePatterns:lb,defaultParseWidth:"any"}),quarter:oi({matchPatterns:cb,defaultMatchWidth:"wide",parsePatterns:db,defaultParseWidth:"any",valueCallback:n=>n+1}),month:oi({matchPatterns:ub,defaultMatchWidth:"wide",parsePatterns:fb,defaultParseWidth:"any"}),day:oi({matchPatterns:hb,defaultMatchWidth:"wide",parsePatterns:mb,defaultParseWidth:"any"}),dayPeriod:oi({matchPatterns:pb,defaultMatchWidth:"any",parsePatterns:gb,defaultParseWidth:"any"})},bb={code:"en-US",formatDistance:zy,formatLong:qy,formatRelative:Ky,localize:tb,match:yb,options:{weekStartsOn:0,firstWeekContainsDate:1}};function xb(n,e){const t=ct(n,e==null?void 0:e.in);return Fy(t,Ry(t))+1}function _b(n,e){const t=ct(n,e==null?void 0:e.in),i=+rs(t)-+$y(t);return Math.round(i/Ga)+1}function tl(n,e){var u,f,h,m;const t=ct(n,e==null?void 0:e.in),i=t.getFullYear(),s=os(),o=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ht((e==null?void 0:e.in)||n,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const l=ii(a,e),c=Ht((e==null?void 0:e.in)||n,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);const d=ii(c,e);return+t>=+l?i+1:+t>=+d?i:i-1}function kb(n,e){var l,c,d,u;const t=os(),i=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(d=t.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=tl(n,e),o=Ht((e==null?void 0:e.in)||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),ii(o,e)}function Sb(n,e){const t=ct(n,e==null?void 0:e.in),i=+ii(t,e)-+kb(t,e);return Math.round(i/Ga)+1}function pe(n,e){const t=n<0?"-":"",i=Math.abs(n).toString().padStart(e,"0");return t+i}const Ut={y(n,e){const t=n.getFullYear(),i=t>0?t:1-t;return pe(e==="yy"?i%100:i,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):pe(t+1,2)},d(n,e){return pe(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return pe(n.getHours()%12||12,e.length)},H(n,e){return pe(n.getHours(),e.length)},m(n,e){return pe(n.getMinutes(),e.length)},s(n,e){return pe(n.getSeconds(),e.length)},S(n,e){const t=e.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,t-3));return pe(s,e.length)}},Nn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nl={G:function(n,e,t){const i=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return t.ordinalNumber(s,{unit:"year"})}return Ut.y(n,e)},Y:function(n,e,t,i){const s=tl(n,i),o=s>0?s:1-s;if(e==="YY"){const a=o%100;return pe(a,2)}return e==="Yo"?t.ordinalNumber(o,{unit:"year"}):pe(o,e.length)},R:function(n,e){const t=Ja(n);return pe(t,e.length)},u:function(n,e){const t=n.getFullYear();return pe(t,e.length)},Q:function(n,e,t){const i=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return pe(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,e,t){const i=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return pe(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,e,t){const i=n.getMonth();switch(e){case"M":case"MM":return Ut.M(n,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(n,e,t){const i=n.getMonth();switch(e){case"L":return String(i+1);case"LL":return pe(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(n,e,t,i){const s=Sb(n,i);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):pe(s,e.length)},I:function(n,e,t){const i=_b(n);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):pe(i,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Ut.d(n,e)},D:function(n,e,t){const i=xb(n);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):pe(i,e.length)},E:function(n,e,t){const i=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(n,e,t,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return pe(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(s,{width:"short",context:"formatting"});case"eeee":default:return t.day(s,{width:"wide",context:"formatting"})}},c:function(n,e,t,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return pe(o,e.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(s,{width:"narrow",context:"standalone"});case"cccccc":return t.day(s,{width:"short",context:"standalone"});case"cccc":default:return t.day(s,{width:"wide",context:"standalone"})}},i:function(n,e,t){const i=n.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return pe(s,e.length);case"io":return t.ordinalNumber(s,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(n,e,t){const s=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,e,t){const i=n.getHours();let s;switch(i===12?s=Nn.noon:i===0?s=Nn.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,e,t){const i=n.getHours();let s;switch(i>=17?s=Nn.evening:i>=12?s=Nn.afternoon:i>=4?s=Nn.morning:s=Nn.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let i=n.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return Ut.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Ut.H(n,e)},K:function(n,e,t){const i=n.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):pe(i,e.length)},k:function(n,e,t){let i=n.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):pe(i,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ut.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Ut.s(n,e)},S:function(n,e){return Ut.S(n,e)},X:function(n,e,t){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return sl(i);case"XXXX":case"XX":return cn(i);case"XXXXX":case"XXX":default:return cn(i,":")}},x:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"x":return sl(i);case"xxxx":case"xx":return cn(i);case"xxxxx":case"xxx":default:return cn(i,":")}},O:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+il(i,":");case"OOOO":default:return"GMT"+cn(i,":")}},z:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+il(i,":");case"zzzz":default:return"GMT"+cn(i,":")}},t:function(n,e,t){const i=Math.trunc(+n/1e3);return pe(i,e.length)},T:function(n,e,t){return pe(+n,e.length)}};function il(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),o=i%60;return o===0?t+String(s):t+String(s)+e+pe(o,2)}function sl(n,e){return n%60===0?(n>0?"-":"+")+pe(Math.abs(n)/60,2):cn(n,e)}function cn(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),s=pe(Math.trunc(i/60),2),o=pe(i%60,2);return t+s+e+o}const ol=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},rl=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},wb={p:rl,P:(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],i=t[1],s=t[2];if(!s)return ol(n,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",ol(i,e)).replace("{{time}}",rl(s,e))}},Eb=/^D+$/,Cb=/^Y+$/,vb=["D","DD","YY","YYYY"];function Db(n){return Eb.test(n)}function Nb(n){return Cb.test(n)}function Ob(n,e,t){const i=Tb(n,e,t);if(console.warn(i),vb.includes(n))throw new RangeError(i)}function Tb(n,e,t){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Pb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mb=/^'([^]*?)'?$/,Vb=/''/g,Ab=/[a-zA-Z]/;function al(n,e,t){var u,f,h,m;const i=os(),s=i.locale??bb,o=i.firstWeekContainsDate??((f=(u=i.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=i.weekStartsOn??((m=(h=i.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=ct(n,t==null?void 0:t.in);if(!Ly(l))throw new RangeError("Invalid time value");let c=e.match(Bb).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=wb[g];return y(p,s.formatLong)}return p}).join("").match(Pb).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:Fb(p)};if(nl[g])return{isToken:!0,value:p};if(g.match(Ab))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(Nb(g)||Db(g))&&Ob(g,e,String(n));const y=nl[g[0]];return y(l,g,s.localize,d)}).join("")}function Fb(n){const e=n.match(Mb);return e?e[1].replace(Vb,"'"):n}const $b=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(n,e){const{value:t,arg:i}=e;if(n&&t){const s=al(new Date(t),i||"yyyy-MM-dd");n.textContent=s}},updated(n,e){const{value:t,arg:i}=e;if(n&&t){const s=al(new Date(t),i||"yyyy-MM-dd");n.textContent=s}}}},Symbol.toStringTag,{value:"Module"})),Ib=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(n,e){const{value:t,arg:i}=e;t&&(n.textContent=n.textContent.toUpperCase())},updated(n,e){const{value:t,arg:i}=e;t&&(n.textContent=n.textContent.toUpperCase())}}},Symbol.toStringTag,{value:"Module"}));/*!
|
|
160
|
+
*/const _l=["viewport","carousel"],pi={"bottom-to-top":"btt","left-to-right":"ltr","right-to-left":"rtl","top-to-bottom":"ttb"},kl=["ltr","left-to-right","rtl","right-to-left","ttb","top-to-bottom","btt","bottom-to-top"],Pb={ariaGallery:"Gallery",ariaNavigateToPage:"Navigate to page {slideNumber}",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",iconArrowDown:"Arrow pointing downwards",iconArrowLeft:"Arrow pointing to the left",iconArrowRight:"Arrow pointing to the right",iconArrowUp:"Arrow pointing upwards",itemXofY:"Item {currentSlide} of {slidesCount}"};Object.values(pi);const Sl=["slide","fade"],wl=["center","start","end","center-even","center-odd"],Re={autoplay:0,breakpointMode:_l[0],breakpoints:void 0,dir:kl[0],enabled:!0,gap:0,height:"auto",i18n:Pb,ignoreAnimations:!1,itemsToScroll:1,itemsToShow:1,modelValue:0,mouseDrag:!0,pauseAutoplayOnHover:!1,preventExcessiveDragging:!1,slideEffect:Sl[0],snapAlign:wl[0],touchDrag:!0,transition:300,wrapAround:!1},gn=Symbol("carousel"),Ab=t=>{const e=a.shallowReactive([]),n=i=>{i!==void 0?e.slice(i).forEach((s,o)=>{var r;(r=s.exposed)===null||r===void 0||r.setIndex(i+o)}):e.forEach((s,o)=>{var r;(r=s.exposed)===null||r===void 0||r.setIndex(o)})};return{cleanup:()=>{e.splice(0,e.length)},getSlides:()=>e,registerSlide:(i,s)=>{if(!i||i.props.isClone)return;const o=s??e.length;e.splice(o,0,i),n(o),t("slide-registered",{slide:i,index:o})},unregisterSlide:i=>{const s=e.indexOf(i);s!==-1&&(t("slide-unregistered",{slide:i,index:s}),e.splice(s,1),n(s))}}};function Mb(t){return t.length===0?0:t.reduce((n,i)=>n+i,0)/t.length}function El({slides:t,position:e,toShow:n}){const i=[],s=e==="before",o=s?-n:0,r=s?0:n;if(t.length<=0)return i;for(let l=o;l<r;l++){const d={index:s?l:l+t.length,isClone:!0,position:e,id:void 0,key:`clone-${e}-${l}`},u=t[(l%t.length+t.length)%t.length].vnode,f=a.cloneVNode(u,d);f.el=null,i.push(f)}return i}const Vb='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';function Cl(t){if(!t.el||!(t.el instanceof Element))return;const e=t.el.querySelectorAll(Vb);for(const n of e)n instanceof HTMLElement&&!n.hasAttribute("disabled")&&n.getAttribute("aria-hidden")!=="true"&&n.setAttribute("tabindex","-1")}function Rb(t,e){return Object.keys(t).filter(n=>!e.includes(n)).reduce((n,i)=>(n[i]=t[i],n),{})}function Fb(t){const{isVertical:e,isReversed:n,dragged:i,effectiveSlideSize:s}=t,o=e?i.y:i.x;if(o===0)return 0;const r=Math.round(o/s);return n?r:-r}function $t({val:t,max:e,min:n}){return e<n?t:Math.min(Math.max(t,isNaN(n)?t:n),isNaN(e)?t:e)}function $b(t){const{transform:e}=window.getComputedStyle(t);return e.split(/[(,)]/).slice(1,-1).map(n=>parseFloat(n))}function Lb(t){let e=1,n=1;return t.forEach(i=>{const s=$b(i);s.length===6&&(e/=s[0],n/=s[3])}),{widthMultiplier:e,heightMultiplier:n}}function Ib(t,e){switch(t){case"start":return 0;case"center":case"center-odd":return(e-1)/2;case"center-even":return(e-2)/2;case"end":return e-1;default:return 0}}function jb(t,e,n){switch(t){case"start":return 0;case"center":case"center-odd":return(n-e)/2;case"center-even":return n/2-e;case"end":return n-e;default:return 0}}function zo({slideSize:t,viewportSize:e,align:n,itemsToShow:i}){return i!==void 0?Ib(n,i):t!==void 0&&e!==void 0?jb(n,t,e):0}function Ol(t="",e={}){return Object.entries(e).reduce((n,[i,s])=>n.replace(`{${i}}`,String(s)),t)}function vl({val:t,max:e,min:n=0}){const i=e-n+1;return((t-n)%i+i)%i+n}function Uo(t,e=0){let n=!1,i=0,s=null;function o(...r){if(n)return;n=!0;const l=()=>{s=requestAnimationFrame(c=>{c-i>e?(i=c,t(...r),n=!1):l()})};l()}return o.cancel=()=>{s&&(cancelAnimationFrame(s),s=null,n=!1)},o}function ks(t,e="px"){if(!(t==null||t===""))return typeof t=="number"||parseFloat(t).toString()===t?`${t}${e}`:t}const zb=a.defineComponent({name:"CarouselAria",setup(){const t=a.inject(gn);return t?()=>a.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},Ol(t.config.i18n.itemXofY,{currentSlide:t.currentSlide+1,slidesCount:t.slidesCount})):()=>""}}),Ub={autoplay:{default:Re.autoplay,type:Number},breakpoints:{default:Re.breakpoints,type:Object},breakpointMode:{default:Re.breakpointMode,validator(t){return _l.includes(t)}},enabled:{default:Re.enabled,type:Boolean},gap:{default:Re.gap,type:Number},height:{default:Re.height,type:[Number,String]},ignoreAnimations:{default:!1,type:[Array,Boolean,String]},itemsToScroll:{default:Re.itemsToScroll,type:Number},itemsToShow:{default:Re.itemsToShow,type:[Number,String]},i18n:{default:Re.i18n,type:Object},modelValue:{default:void 0,type:Number},mouseDrag:{default:Re.mouseDrag,type:Boolean},touchDrag:{default:Re.touchDrag,type:Boolean},pauseAutoplayOnHover:{default:Re.pauseAutoplayOnHover,type:Boolean},preventExcessiveDragging:{default:!1,type:Boolean,validator(t,e){return t&&e.wrapAround&&console.warn('[vue3-carousel warn]: "preventExcessiveDragging" cannot be used with wrapAround. The setting will be ignored.'),!0}},snapAlign:{default:Re.snapAlign,validator(t){return wl.includes(t)}},slideEffect:{type:String,default:Re.slideEffect,validator(t){return Sl.includes(t)}},transition:{default:Re.transition,type:Number},dir:{type:String,default:Re.dir,validator(t,e){if(!kl.includes(t))return!1;const n=t in pi?pi[t]:t;return["ttb","btt"].includes(n)&&(!e.height||e.height==="auto")&&console.warn(`[vue3-carousel warn]: The dir "${t}" is not supported with height "auto".`),!0}},wrapAround:{default:Re.wrapAround,type:Boolean}},Nl=a.defineComponent({name:"VueCarousel",props:Ub,emits:["before-init","drag","init","loop","slide-end","slide-registered","slide-start","slide-unregistered","update:modelValue"],setup(t,{slots:e,emit:n,expose:i}){var s;const o=Ab(n),r=o.getSlides(),l=a.computed(()=>r.length),c=a.ref(null),d=a.ref(null),u=a.ref(0),f=a.computed(()=>Object.assign(Object.assign(Object.assign({},Re),Rb(t,["breakpoints","modelValue"])),{i18n:Object.assign(Object.assign({},Re.i18n),t.i18n)})),h=a.shallowReactive(Object.assign({},f.value)),m=a.ref((s=t.modelValue)!==null&&s!==void 0?s:0),p=a.ref(m.value);a.watch(m,M=>p.value=M);const g=a.ref(0),y=a.computed(()=>Math.ceil((l.value-1)/2)),b=a.computed(()=>l.value-1),x=a.computed(()=>0);let w=null,E=null,k=null;const C=a.computed(()=>u.value+h.gap),S=a.computed(()=>{const M=h.dir||"ltr";return M in pi?pi[M]:M}),_=a.computed(()=>["rtl","btt"].includes(S.value)),O=a.computed(()=>["ttb","btt"].includes(S.value)),P=a.computed(()=>h.itemsToShow==="auto"),v=a.computed(()=>O.value?"height":"width");function T(){var M;if(!J.value)return;const W=(f.value.breakpointMode==="carousel"?(M=c.value)===null||M===void 0?void 0:M.getBoundingClientRect().width:typeof window<"u"?window.innerWidth:0)||0,G=Object.keys(t.breakpoints||{}).map(ie=>Number(ie)).sort((ie,xe)=>+xe-+ie),X={};G.some(ie=>W>=ie?(Object.assign(X,t.breakpoints[ie]),X.i18n&&Object.assign(X.i18n,f.value.i18n,t.breakpoints[ie].i18n),!0):!1),Object.assign(h,f.value,X)}const R=Uo(()=>{T(),I(),A()}),U=a.shallowReactive(new Set),Y=a.ref([]);function L({widthMultiplier:M,heightMultiplier:W}){Y.value=r.map(G=>{var X;const ie=(X=G.exposed)===null||X===void 0?void 0:X.getBoundingRect();return{width:ie.width*M,height:ie.height*W}})}const j=a.ref({width:0,height:0});function $({widthMultiplier:M,heightMultiplier:W}){var G;const X=((G=d.value)===null||G===void 0?void 0:G.getBoundingClientRect())||{width:0,height:0};j.value={width:X.width*M,height:X.height*W}}function A(){if(!d.value)return;const M=Lb(U);if($(M),L(M),P.value)u.value=Mb(Y.value.map(W=>W[v.value]));else{const W=Number(h.itemsToShow),G=(W-1)*h.gap;u.value=(j.value[v.value]-G)/W}}function I(){!h.wrapAround&&l.value>0&&(m.value=$t({val:m.value,max:b.value,min:x.value})),P.value||(h.itemsToShow=$t({val:Number(h.itemsToShow),max:l.value,min:1}))}const Q=a.computed(()=>typeof t.ignoreAnimations=="string"?t.ignoreAnimations.split(","):Array.isArray(t.ignoreAnimations)?t.ignoreAnimations:t.ignoreAnimations?!1:[]);a.watchEffect(()=>I()),a.watchEffect(()=>{A()});let ne;const se=M=>{const W=M.target;if(!(!(W!=null&&W.contains(c.value))||Array.isArray(Q.value)&&Q.value.includes(M.animationName))&&(U.add(W),!ne)){const G=()=>{ne=requestAnimationFrame(()=>{A(),G()})};G()}},K=M=>{const W=M.target;W&&U.delete(W),ne&&U.size===0&&(cancelAnimationFrame(ne),A())},J=a.ref(!1);typeof document<"u"&&a.watchEffect(()=>{J.value&&Q.value!==!1?(document.addEventListener("animationstart",se),document.addEventListener("animationend",K)):(document.removeEventListener("animationstart",se),document.removeEventListener("animationend",K))}),a.onMounted(()=>{J.value=!0,T(),Te(),c.value&&(k=new ResizeObserver(R),k.observe(c.value)),n("init")}),a.onBeforeUnmount(()=>{J.value=!1,o.cleanup(),E&&clearTimeout(E),ne&&cancelAnimationFrame(ne),w&&clearInterval(w),k&&(k.disconnect(),k=null),typeof document<"u"&&he(),c.value&&(c.value.removeEventListener("transitionend",A),c.value.removeEventListener("animationiteration",A))});let oe=!1;const ue={x:0,y:0},ve=a.reactive({x:0,y:0}),st=a.ref(!1),qe=a.ref(!1),xt=()=>{st.value=!0},ct=()=>{st.value=!1},H=Uo(M=>{if(!M.ctrlKey)switch(M.key){case"ArrowLeft":case"ArrowUp":O.value===M.key.endsWith("Up")&&(_.value?dt(!0):un(!0));break;case"ArrowRight":case"ArrowDown":O.value===M.key.endsWith("Down")&&(_.value?un(!0):dt(!0));break}},200),F=()=>{document.addEventListener("keydown",H)},he=()=>{document.removeEventListener("keydown",H)};function pe(M){const W=M.target.tagName;if(["INPUT","TEXTAREA","SELECT"].includes(W)||Le.value||(oe=M.type==="touchstart",!oe&&(M.preventDefault(),M.button!==0)))return;ue.x="touches"in M?M.touches[0].clientX:M.clientX,ue.y="touches"in M?M.touches[0].clientY:M.clientY;const G=oe?"touchmove":"mousemove",X=oe?"touchend":"mouseup";document.addEventListener(G,me,{passive:!1}),document.addEventListener(X,ge,{passive:!0})}const me=Uo(M=>{qe.value=!0;const W="touches"in M?M.touches[0].clientX:M.clientX,G="touches"in M?M.touches[0].clientY:M.clientY;ve.x=W-ue.x,ve.y=G-ue.y;const X=Fb({isVertical:O.value,isReversed:_.value,dragged:ve,effectiveSlideSize:C.value});p.value=h.wrapAround?m.value+X:$t({val:m.value+X,max:b.value,min:x.value}),n("drag",{deltaX:ve.x,deltaY:ve.y})});function ge(){if(me.cancel(),p.value!==m.value&&!oe){const G=X=>{X.preventDefault(),window.removeEventListener("click",G)};window.addEventListener("click",G)}et(p.value),ve.x=0,ve.y=0,qe.value=!1;const M=oe?"touchmove":"mousemove",W=oe?"touchend":"mouseup";document.removeEventListener(M,me),document.removeEventListener(W,ge)}function Te(){!h.autoplay||h.autoplay<=0||(w=setInterval(()=>{h.pauseAutoplayOnHover&&st.value||dt()},h.autoplay))}function Ze(){w&&(clearInterval(w),w=null)}function Bt(){Ze(),Te()}const Le=a.ref(!1);function et(M,W=!1){if(!W&&Le.value)return;let G=M,X=M;g.value=m.value,h.wrapAround?X=vl({val:G,max:b.value,min:x.value}):G=$t({val:G,max:b.value,min:x.value}),n("slide-start",{slidingToIndex:M,currentSlideIndex:m.value,prevSlideIndex:g.value,slidesCount:l.value}),Ze(),Le.value=!0,m.value=G,X!==G&&Bn.pause(),n("update:modelValue",X),E=setTimeout(()=>{h.wrapAround&&X!==G&&(Bn.resume(),m.value=X,n("loop",{currentSlideIndex:m.value,slidingToIndex:M})),n("slide-end",{currentSlideIndex:m.value,prevSlideIndex:g.value,slidesCount:l.value}),Le.value=!1,Bt()},h.transition)}function dt(M=!1){et(m.value+h.itemsToScroll,M)}function un(M=!1){et(m.value-h.itemsToScroll,M)}function fn(){T(),I(),A(),Bt()}a.watch(()=>[f.value,t.breakpoints],()=>T(),{deep:!0}),a.watch(()=>t.autoplay,()=>Bt());const Bn=a.watch(()=>t.modelValue,M=>{M!==m.value&&et(Number(M),!0)});n("before-init");const ee=a.computed(()=>{if(!h.wrapAround)return{before:0,after:0};if(P.value)return{before:r.length,after:r.length};const M=Number(h.itemsToShow),W=Math.ceil(M+(h.itemsToScroll-1)),G=W-p.value,X=W-(l.value-(p.value+1));return{before:Math.max(0,G),after:Math.max(0,X)}}),_t=a.computed(()=>ee.value.before?P.value?Y.value.slice(-1*ee.value.before).reduce((M,W)=>M+W[v.value]+h.gap,0)*-1:ee.value.before*C.value*-1:0),Ae=a.computed(()=>{var M;if(P.value){const W=(m.value%r.length+r.length)%r.length;return zo({slideSize:(M=Y.value[W])===null||M===void 0?void 0:M[v.value],viewportSize:j.value[v.value],align:h.snapAlign})}return zo({align:h.snapAlign,itemsToShow:+h.itemsToShow})}),N=a.computed(()=>{let M=0;if(P.value){if(m.value<0?M=Y.value.slice(m.value).reduce((W,G)=>W+G[v.value]+h.gap,0)*-1:M=Y.value.slice(0,m.value).reduce((W,G)=>W+G[v.value]+h.gap,0),M-=Ae.value,!h.wrapAround){const W=Y.value.reduce((G,X)=>G+X[v.value]+h.gap,0)-j.value[v.value]-h.gap;M=$t({val:M,max:W,min:0})}}else{let W=m.value-Ae.value;h.wrapAround||(W=$t({val:W,max:l.value-+h.itemsToShow,min:0})),M=W*C.value}return M*(_.value?1:-1)}),D=a.computed(()=>{var M,W;if(!P.value){const ie=m.value-Ae.value;return h.wrapAround?{min:Math.floor(ie),max:Math.ceil(ie+Number(h.itemsToShow)-1)}:{min:Math.floor($t({val:ie,max:l.value-Number(h.itemsToShow),min:0})),max:Math.ceil($t({val:ie+Number(h.itemsToShow)-1,max:l.value-1,min:0}))}}let G=0;{let ie=0,xe=0-ee.value.before;const Ne=Math.abs(N.value+_t.value);for(;ie<=Ne;){const ze=(xe%r.length+r.length)%r.length;ie+=((M=Y.value[ze])===null||M===void 0?void 0:M[v.value])+h.gap,xe++}G=xe-1}let X=0;{let ie=G,xe=0;for(ie<0?xe=Y.value.slice(0,ie).reduce((Ne,ze)=>Ne+ze[v.value]+h.gap,0)-Math.abs(N.value+_t.value):xe=Y.value.slice(0,ie).reduce((Ne,ze)=>Ne+ze[v.value]+h.gap,0)-Math.abs(N.value);xe<j.value[v.value];){const Ne=(ie%r.length+r.length)%r.length;xe+=((W=Y.value[Ne])===null||W===void 0?void 0:W[v.value])+h.gap,ie++}X=ie-1}return{min:Math.floor(G),max:Math.ceil(X)}}),V=a.computed(()=>{if(h.slideEffect==="fade")return;const M=O.value?"Y":"X",W=O.value?ve.y:ve.x;let G=N.value+W;if(!h.wrapAround&&h.preventExcessiveDragging){let X=0;P.value?X=Y.value.reduce((Ne,ze)=>Ne+ze[v.value],0):X=(l.value-Number(h.itemsToShow))*C.value;const ie=_.value?0:-1*X,xe=_.value?X:0;G=$t({val:G,min:ie,max:xe})}return`translate${M}(${G}px)`}),q=a.computed(()=>({"--vc-transition-duration":Le.value?ks(h.transition,"ms"):void 0,"--vc-slide-gap":ks(h.gap),"--vc-carousel-height":ks(h.height),"--vc-cloned-offset":ks(_t.value)})),te={slideTo:et,next:dt,prev:un},le=a.reactive({activeSlide:p,config:h,currentSlide:m,isSliding:Le,isVertical:O,maxSlide:b,minSlide:x,nav:te,normalizedDir:S,slideRegistry:o,slideSize:u,slides:r,slidesCount:l,viewport:d,visibleRange:D});a.provide(gn,le);const Z=a.reactive({config:h,currentSlide:m,maxSlide:b,middleSlide:y,minSlide:x,slideSize:u,slidesCount:l});return i({data:Z,nav:te,next:dt,prev:un,restartCarousel:fn,slideTo:et,updateBreakpointsConfig:T,updateSlideSize:A,updateSlidesData:I}),()=>{var M;const W=e.default||e.slides,G=(W==null?void 0:W(Z))||[],{before:X,after:ie}=ee.value,xe=El({slides:r,position:"before",toShow:X}),Ne=El({slides:r,position:"after",toShow:ie}),ze=[...xe,...G,...Ne];if(!h.enabled||!ze.length)return a.h("section",{ref:c,class:["carousel","is-disabled"]},ze);const es=((M=e.addons)===null||M===void 0?void 0:M.call(e,Z))||[],ts=a.h("ol",{class:"carousel__track",style:{transform:V.value},onMousedownCapture:h.mouseDrag?pe:null,onTouchstartPassiveCapture:h.touchDrag?pe:null},ze),ns=a.h("div",{class:"carousel__viewport",ref:d},ts);return a.h("section",{ref:c,class:["carousel",`is-${S.value}`,`is-effect-${h.slideEffect}`,{"is-vertical":O.value,"is-sliding":Le.value,"is-dragging":qe.value,"is-hover":st.value}],dir:S.value,style:q.value,"aria-label":h.i18n.ariaGallery,tabindex:"0",onFocus:F,onBlur:he,onMouseenter:xt,onMouseleave:ct},[ns,es,a.h(zb)])}}});var Wo;(function(t){t.arrowDown="arrowDown",t.arrowLeft="arrowLeft",t.arrowRight="arrowRight",t.arrowUp="arrowUp"})(Wo||(Wo={}));const Dl=t=>`icon${t.charAt(0).toUpperCase()+t.slice(1)}`,Wb={arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"};function Hb(t){return t in Wo}const Tl=t=>t&&Hb(t),Bl=a.defineComponent({props:{name:{type:String,required:!0,validator:Tl},title:{type:String,default:t=>t.name?Re.i18n[Dl(t.name)]:""}},setup(t){const e=a.inject(gn,null);return()=>{const n=t.name;if(!n||!Tl(n))return;const i=Wb[n],s=a.h("path",{d:i}),o=(e==null?void 0:e.config.i18n[Dl(n)])||t.title,r=a.h("title",o);return a.h("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":o},[r,s])}}}),Pl=a.defineComponent({name:"CarouselNavigation",inheritAttrs:!1,setup(t,{slots:e,attrs:n}){const i=a.inject(gn);if(!i)return()=>"";const{next:s,prev:o}=e,r=()=>({btt:"arrowDown",ltr:"arrowLeft",rtl:"arrowRight",ttb:"arrowUp"})[i.normalizedDir],l=()=>({btt:"arrowUp",ltr:"arrowRight",rtl:"arrowLeft",ttb:"arrowDown"})[i.normalizedDir],c=a.computed(()=>!i.config.wrapAround&&i.currentSlide<=i.minSlide),d=a.computed(()=>!i.config.wrapAround&&i.currentSlide>=i.maxSlide);return()=>{const{i18n:u}=i.config,f=a.h("button",Object.assign(Object.assign({type:"button",disabled:c.value,"aria-label":u.ariaPreviousSlide,title:u.ariaPreviousSlide,onClick:i.nav.prev},n),{class:["carousel__prev",{"carousel__prev--disabled":c.value},n.class]}),(o==null?void 0:o())||a.h(Bl,{name:r()})),h=a.h("button",Object.assign(Object.assign({type:"button",disabled:d.value,"aria-label":u.ariaNextSlide,title:u.ariaNextSlide,onClick:i.nav.next},n),{class:["carousel__next",{"carousel__next--disabled":d.value},n.class]}),(s==null?void 0:s())||a.h(Bl,{name:l()}));return[f,h]}}});a.defineComponent({name:"CarouselPagination",props:{disableOnClick:{type:Boolean},paginateByItemsToShow:{type:Boolean}},setup(t){const e=a.inject(gn);if(!e)return()=>"";const n=a.computed(()=>e.config.itemsToShow),i=a.computed(()=>zo({align:e.config.snapAlign,itemsToShow:n.value})),s=a.computed(()=>t.paginateByItemsToShow&&n.value>1),o=a.computed(()=>Math.ceil((e.activeSlide-i.value)/n.value)),r=a.computed(()=>Math.ceil(e.slidesCount/n.value)),l=c=>vl(s.value?{val:o.value,max:r.value-1,min:0}:{val:e.activeSlide,max:e.maxSlide,min:e.minSlide})===c;return()=>{var c,d;const u=[];for(let f=s.value?0:e.minSlide;f<=(s.value?r.value-1:e.maxSlide);f++){const h=Ol(e.config.i18n[s.value?"ariaNavigateToPage":"ariaNavigateToSlide"],{slideNumber:f+1}),m=l(f),p=a.h("button",{type:"button",class:{"carousel__pagination-button":!0,"carousel__pagination-button--active":m},"aria-label":h,"aria-pressed":m,"aria-controls":(d=(c=e.slides[f])===null||c===void 0?void 0:c.exposed)===null||d===void 0?void 0:d.id,title:h,disabled:t.disableOnClick,onClick:()=>e.nav.slideTo(s.value?Math.floor(f*+e.config.itemsToShow+i.value):f)}),g=a.h("li",{class:"carousel__pagination-item",key:f},p);u.push(g)}return a.h("ol",{class:"carousel__pagination"},u)}}});const Al=a.defineComponent({name:"CarouselSlide",props:{id:{type:String,default:t=>t.isClone?void 0:a.useId()},index:{type:Number,default:void 0},isClone:{type:Boolean,default:!1},position:{type:String,default:void 0}},setup(t,{attrs:e,slots:n,expose:i}){const s=a.inject(gn);if(a.provide(gn,void 0),!s)return()=>"";const o=a.ref(t.index),r=p=>{o.value=p},l=a.getCurrentInstance(),c=()=>{const p=l.vnode.el;return p?p.getBoundingClientRect():{width:0,height:0}};i({id:t.id,setIndex:r,getBoundingRect:c});const d=a.computed(()=>o.value===s.activeSlide),u=a.computed(()=>o.value===s.activeSlide-1),f=a.computed(()=>o.value===s.activeSlide+1),h=a.computed(()=>o.value>=s.visibleRange.min&&o.value<=s.visibleRange.max),m=a.computed(()=>{if(s.config.itemsToShow==="auto")return;const p=s.config.itemsToShow,g=s.config.gap>0&&p>1?`calc(${100/p}% - ${s.config.gap*(p-1)/p}px)`:`${100/p}%`;return s.isVertical?{height:g}:{width:g}});return s.slideRegistry.registerSlide(l,t.index),a.onUnmounted(()=>{s.slideRegistry.unregisterSlide(l)}),t.isClone&&(a.onMounted(()=>{Cl(l.vnode)}),a.onUpdated(()=>{Cl(l.vnode)})),()=>{var p,g;return s.config.enabled?a.h("li",{style:[e.style,Object.assign({},m.value)],class:{carousel__slide:!0,"carousel__slide--clone":t.isClone,"carousel__slide--visible":h.value,"carousel__slide--active":d.value,"carousel__slide--prev":u.value,"carousel__slide--next":f.value,"carousel__slide--sliding":s.isSliding},onFocusin:()=>{s.viewport&&(s.viewport.scrollLeft=0),s.nav.slideTo(o.value)},id:t.isClone?void 0:t.id,"aria-hidden":t.isClone||void 0},(g=n.default)===null||g===void 0?void 0:g.call(n,{currentIndex:o.value,isActive:d.value,isClone:t.isClone,isPrev:u.value,isNext:f.value,isSliding:s.isSliding,isVisible:h.value})):(p=n.default)===null||p===void 0?void 0:p.call(n)}}}),qb={class:"p-4 mb-4 flex flex-wrap gap-2 border border-gray-300 shadow-md rounded-lg"},Yb={key:0,class:"error-message"},Kb={class:"text-red-500 font-bold"},Xb={key:0},Gb={key:1,class:"mb-4 mt-4"},Ml=De({__name:"EntityListingCarousel",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t,{expose:e}){const n=xs(),i=ot();a.provide("entityObject",n);const s=t,o=a.ref([]);return a.watch(()=>n.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),a.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await n.getEntity(s.entityName);n.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>(a.openBlock(),a.createElementBlock("div",a.normalizeProps(a.guardReactiveProps(c.$attrs)),[c.$slots["list-item-display-carousel"]?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(c.$slots,"header",{},void 0,!0),t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:0})):a.createCommentVNode("",!0),t.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:1})):a.createCommentVNode("",!0),o.value.length>1?(a.openBlock(),a.createBlock(a.unref(Nl),{key:2,"items-to-show":5,"wrap-around":!0,autoplay:2e3,pauseAutoplayOnHover:!0,transition:500},{addons:a.withCtx(()=>[a.createVNode(a.unref(Pl))]),default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(u,f)=>(a.openBlock(),a.createBlock(a.unref(Al),{key:f},{default:a.withCtx(()=>[a.createElementVNode("div",qb,[a.renderSlot(c.$slots,"list-item-display-carousel",{item:u},void 0,!0)])]),_:2},1024))),128))]),_:3})):a.createCommentVNode("",!0),a.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.renderSlot(c.$slots,"header",{},void 0,!0),t.entityName?(a.openBlock(),a.createElementBlock("div",Gb,[t.showFilters?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listFilter||Jt),{key:0})):a.createCommentVNode("",!0),t.showAddButton?(a.openBlock(),a.createBlock(Qt,{key:1})):a.createCommentVNode("",!0),o.value.length?(a.openBlock(),a.createBlock(a.unref(Nl),{key:2,"items-to-show":3,"wrap-around":!1,mouseDrag:!0,pauseAutoplayOnHover:!0,breakpoints:{1024:{itemsToShow:3},950:{itemsToShow:2},768:{itemsToShow:1},340:{itemsToShow:1}}},{addons:a.withCtx(()=>[a.createVNode(a.unref(Pl))]),default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(u,f)=>(a.openBlock(),a.createBlock(a.unref(Al),{key:f},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listItemDisplay&&t.listItemDisplay!==""?t.listItemDisplay:Bb),a.mergeProps({ref_for:!0},{item:u,...s}),null,16))]),_:2},1024))),128))]),_:1})):a.createCommentVNode("",!0),t.showPagination?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.listPagination||mi),{key:3})):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",Yb,[a.createElementVNode("p",Kb,[d[0]||(d[0]=a.createTextVNode(" Error: Missing required props - ")),t.entityName?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",Xb,"Entity Name"))])])),a.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16))}},[["__scopeId","data-v-84369e22"]]);class Jb{constructor(){this.httpService=new sa}async getEntities(){return await this.getAppId(),await this.httpService.get(`/api/app/v1/${this.appId}/entity`)}getEntity(e){}saveEntity(){}async getAppId(){const e=ot();this.appId=e.getAppId()}}const Vl=ia("entitiesStore",{state:()=>({entities:[],entityService:new Jb}),actions:{async fetchEntities(){try{return await this.entityService.getEntities()}catch(t){console.error("Error fetching entities:",t)}finally{}},async getEntities(){if(this.entities.length===0){const t=await this.fetchEntities();return this.setEntities(t.response),this.entities}else return this.entities},setEntities(t){this.entities=t}},getters:{}}),Qb={class:"field flex flex-col w-full"},Zb={key:0,class:"flex items-center"},e0={key:1},t0={class:"flex items-center"},Ho={__name:"EntitySelection",props:{entityName:String,onEntityChangeCallback:Function},setup(t){const e=ot(),n=a.ref(""),i=Vl(),s=a.ref([]),o=async()=>{s.value=await i.getEntities(),r()},r=()=>{for(let c=0;c<s.value.length;c++){const d=s.value[c];d.name.toLowerCase()==t.entityName.toLowerCase()&&(n.value=d)}},l=()=>{t.onEntityChangeCallback(n.value.name)};return a.watch(()=>e.globalConfigs.appId,async c=>{c&&await o()},{immediate:!0}),(c,d)=>{const u=a.resolveComponent("Select");return a.openBlock(),a.createElementBlock("div",Qb,[a.createVNode(u,{modelValue:n.value,"onUpdate:modelValue":[d[0]||(d[0]=f=>n.value=f),l],options:s.value,filter:"",optionLabel:"name",placeholder:"Select entity",class:"w-full"},{value:a.withCtx(f=>[f.value?(a.openBlock(),a.createElementBlock("div",Zb,[a.createElementVNode("div",null,a.toDisplayString(f.value.name),1)])):(a.openBlock(),a.createElementBlock("span",e0,a.toDisplayString(f.placeholder),1))]),option:a.withCtx(f=>[a.createElementVNode("div",t0,[a.createElementVNode("div",null,a.toDisplayString(f.option.name),1)])]),_:1},8,["modelValue","options"])])}}},Rl={__name:"FieldExpression",props:["value"],setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",null,a.toDisplayString(t.value),1))}},n0={class:"flex flex-col w-full"},i0={class:"w-1/4"},s0={class:"w-full mt-5"},Fl={__name:"EntityExplorer",props:{entityName:String},setup(t){const e=t,n=a.ref(e.entityName);a.watch(n,s=>{console.log("Entity changed to:",s)});const i=s=>{n.value=s};return(s,o)=>(a.openBlock(),a.createElementBlock("div",n0,[a.createElementVNode("div",i0,[(a.openBlock(),a.createBlock(Ho,{key:n.value,entityName:n.value,onEntityChangeCallback:i},null,8,["entityName"]))]),a.createElementVNode("div",s0,[(a.openBlock(),a.createBlock(Ro,{key:n.value,entityName:n.value},null,8,["entityName"]))])]))}};function $l(t,e){return function(){return t.apply(e,arguments)}}const{toString:o0}=Object.prototype,{getPrototypeOf:qo}=Object,Ss=(t=>e=>{const n=o0.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pt=t=>(t=t.toLowerCase(),e=>Ss(e)===t),ws=t=>e=>typeof e===t,{isArray:Ln}=Array,gi=ws("undefined");function r0(t){return t!==null&&!gi(t)&&t.constructor!==null&&!gi(t.constructor)&&tt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ll=pt("ArrayBuffer");function a0(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ll(t.buffer),e}const l0=ws("string"),tt=ws("function"),Il=ws("number"),Es=t=>t!==null&&typeof t=="object",c0=t=>t===!0||t===!1,Cs=t=>{if(Ss(t)!=="object")return!1;const e=qo(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},d0=pt("Date"),u0=pt("File"),f0=pt("Blob"),h0=pt("FileList"),m0=t=>Es(t)&&tt(t.pipe),p0=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||tt(t.append)&&((e=Ss(t))==="formdata"||e==="object"&&tt(t.toString)&&t.toString()==="[object FormData]"))},g0=pt("URLSearchParams"),[y0,b0,x0,_0]=["ReadableStream","Request","Response","Headers"].map(pt),k0=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yi(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,s;if(typeof t!="object"&&(t=[t]),Ln(t))for(i=0,s=t.length;i<s;i++)e.call(null,t[i],i,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),r=o.length;let l;for(i=0;i<r;i++)l=o[i],e.call(null,t[l],l,t)}}function jl(t,e){e=e.toLowerCase();const n=Object.keys(t);let i=n.length,s;for(;i-- >0;)if(s=n[i],e===s.toLowerCase())return s;return null}const yn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zl=t=>!gi(t)&&t!==yn;function Yo(){const{caseless:t}=zl(this)&&this||{},e={},n=(i,s)=>{const o=t&&jl(e,s)||s;Cs(e[o])&&Cs(i)?e[o]=Yo(e[o],i):Cs(i)?e[o]=Yo({},i):Ln(i)?e[o]=i.slice():e[o]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&yi(arguments[i],n);return e}const S0=(t,e,n,{allOwnKeys:i}={})=>(yi(e,(s,o)=>{n&&tt(s)?t[o]=$l(s,n):t[o]=s},{allOwnKeys:i}),t),w0=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),E0=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},C0=(t,e,n,i)=>{let s,o,r;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)r=s[o],(!i||i(r,t,e))&&!l[r]&&(e[r]=t[r],l[r]=!0);t=n!==!1&&qo(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},O0=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},v0=t=>{if(!t)return null;if(Ln(t))return t;let e=t.length;if(!Il(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},N0=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qo(Uint8Array)),D0=(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=i.next())&&!s.done;){const o=s.value;e.call(t,o[0],o[1])}},T0=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},B0=pt("HTMLFormElement"),P0=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),Ul=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),A0=pt("RegExp"),Wl=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};yi(n,(s,o)=>{let r;(r=e(s,o,t))!==!1&&(i[o]=r||s)}),Object.defineProperties(t,i)},M0=t=>{Wl(t,(e,n)=>{if(tt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(tt(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},V0=(t,e)=>{const n={},i=s=>{s.forEach(o=>{n[o]=!0})};return Ln(t)?i(t):i(String(t).split(e)),n},R0=()=>{},F0=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Ko="abcdefghijklmnopqrstuvwxyz",Hl="0123456789",ql={DIGIT:Hl,ALPHA:Ko,ALPHA_DIGIT:Ko+Ko.toUpperCase()+Hl},$0=(t=16,e=ql.ALPHA_DIGIT)=>{let n="";const{length:i}=e;for(;t--;)n+=e[Math.random()*i|0];return n};function L0(t){return!!(t&&tt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const I0=t=>{const e=new Array(10),n=(i,s)=>{if(Es(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const o=Ln(i)?[]:{};return yi(i,(r,l)=>{const c=n(r,s+1);!gi(c)&&(o[l]=c)}),e[s]=void 0,o}}return i};return n(t,0)},j0=pt("AsyncFunction"),z0=t=>t&&(Es(t)||tt(t))&&tt(t.then)&&tt(t.catch),Yl=((t,e)=>t?setImmediate:e?((n,i)=>(yn.addEventListener("message",({source:s,data:o})=>{s===yn&&o===n&&i.length&&i.shift()()},!1),s=>{i.push(s),yn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",tt(yn.postMessage)),U0=typeof queueMicrotask<"u"?queueMicrotask.bind(yn):typeof process<"u"&&process.nextTick||Yl,B={isArray:Ln,isArrayBuffer:Ll,isBuffer:r0,isFormData:p0,isArrayBufferView:a0,isString:l0,isNumber:Il,isBoolean:c0,isObject:Es,isPlainObject:Cs,isReadableStream:y0,isRequest:b0,isResponse:x0,isHeaders:_0,isUndefined:gi,isDate:d0,isFile:u0,isBlob:f0,isRegExp:A0,isFunction:tt,isStream:m0,isURLSearchParams:g0,isTypedArray:N0,isFileList:h0,forEach:yi,merge:Yo,extend:S0,trim:k0,stripBOM:w0,inherits:E0,toFlatObject:C0,kindOf:Ss,kindOfTest:pt,endsWith:O0,toArray:v0,forEachEntry:D0,matchAll:T0,isHTMLForm:B0,hasOwnProperty:Ul,hasOwnProp:Ul,reduceDescriptors:Wl,freezeMethods:M0,toObjectSet:V0,toCamelCase:P0,noop:R0,toFiniteNumber:F0,findKey:jl,global:yn,isContextDefined:zl,ALPHABET:ql,generateString:$0,isSpecCompliantForm:L0,toJSONObject:I0,isAsyncFn:j0,isThenable:z0,setImmediate:Yl,asap:U0};function re(t,e,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}B.inherits(re,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const Kl=re.prototype,Xl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Xl[t]={value:t}}),Object.defineProperties(re,Xl),Object.defineProperty(Kl,"isAxiosError",{value:!0}),re.from=(t,e,n,i,s,o)=>{const r=Object.create(Kl);return B.toFlatObject(t,r,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),re.call(r,t.message,e,n,i,s),r.cause=t,r.name=t.name,o&&Object.assign(r,o),r};const W0=null;function Xo(t){return B.isPlainObject(t)||B.isArray(t)}function Gl(t){return B.endsWith(t,"[]")?t.slice(0,-2):t}function Jl(t,e,n){return t?t.concat(e).map(function(s,o){return s=Gl(s),!n&&o?"["+s+"]":s}).join(n?".":""):e}function H0(t){return B.isArray(t)&&!t.some(Xo)}const q0=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function Os(t,e,n){if(!B.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,y){return!B.isUndefined(y[g])});const i=n.metaTokens,s=n.visitor||u,o=n.dots,r=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(s))throw new TypeError("visitor must be a function");function d(p){if(p===null)return"";if(B.isDate(p))return p.toISOString();if(!c&&B.isBlob(p))throw new re("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(p)||B.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,y){let b=p;if(p&&!y&&typeof p=="object"){if(B.endsWith(g,"{}"))g=i?g:g.slice(0,-2),p=JSON.stringify(p);else if(B.isArray(p)&&H0(p)||(B.isFileList(p)||B.endsWith(g,"[]"))&&(b=B.toArray(p)))return g=Gl(g),b.forEach(function(w,E){!(B.isUndefined(w)||w===null)&&e.append(r===!0?Jl([g],E,o):r===null?g:g+"[]",d(w))}),!1}return Xo(p)?!0:(e.append(Jl(y,g,o),d(p)),!1)}const f=[],h=Object.assign(q0,{defaultVisitor:u,convertValue:d,isVisitable:Xo});function m(p,g){if(!B.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(p),B.forEach(p,function(b,x){(!(B.isUndefined(b)||b===null)&&s.call(e,b,B.isString(x)?x.trim():x,g,h))===!0&&m(b,g?g.concat(x):[x])}),f.pop()}}if(!B.isObject(t))throw new TypeError("data must be an object");return m(t),e}function Ql(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Go(t,e){this._pairs=[],t&&Os(t,this,e)}const Zl=Go.prototype;Zl.append=function(e,n){this._pairs.push([e,n])},Zl.toString=function(e){const n=e?function(i){return e.call(this,i,Ql)}:Ql;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Y0(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ec(t,e,n){if(!e)return t;const i=n&&n.encode||Y0;B.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(e,n):o=B.isURLSearchParams(e)?e.toString():new Go(e,n).toString(i),o){const r=t.indexOf("#");r!==-1&&(t=t.slice(0,r)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class tc{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,function(i){i!==null&&e(i)})}}const nc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},K0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Go,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Jo=typeof window<"u"&&typeof document<"u",Qo=typeof navigator=="object"&&navigator||void 0,X0=Jo&&(!Qo||["ReactNative","NativeScript","NS"].indexOf(Qo.product)<0),G0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",J0=Jo&&window.location.href||"http://localhost",Ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jo,hasStandardBrowserEnv:X0,hasStandardBrowserWebWorkerEnv:G0,navigator:Qo,origin:J0},Symbol.toStringTag,{value:"Module"})),...K0};function Q0(t,e){return Os(t,new Ue.classes.URLSearchParams,Object.assign({visitor:function(n,i,s,o){return Ue.isNode&&B.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Z0(t){return B.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ex(t){const e={},n=Object.keys(t);let i;const s=n.length;let o;for(i=0;i<s;i++)o=n[i],e[o]=t[o];return e}function ic(t){function e(n,i,s,o){let r=n[o++];if(r==="__proto__")return!0;const l=Number.isFinite(+r),c=o>=n.length;return r=!r&&B.isArray(s)?s.length:r,c?(B.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!l):((!s[r]||!B.isObject(s[r]))&&(s[r]=[]),e(n,i,s[r],o)&&B.isArray(s[r])&&(s[r]=ex(s[r])),!l)}if(B.isFormData(t)&&B.isFunction(t.entries)){const n={};return B.forEachEntry(t,(i,s)=>{e(Z0(i),s,n,0)}),n}return null}function tx(t,e,n){if(B.isString(t))try{return(e||JSON.parse)(t),B.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(t)}const bi={transitional:nc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,o=B.isObject(e);if(o&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return s?JSON.stringify(ic(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e)||B.isReadableStream(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Q0(e,this.formSerializer).toString();if((l=B.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Os(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),tx(e)):e}],transformResponse:[function(e){const n=this.transitional||bi.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(B.isResponse(e)||B.isReadableStream(e))return e;if(e&&B.isString(e)&&(i&&!this.responseType||s)){const r=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(l){if(r)throw l.name==="SyntaxError"?re.from(l,re.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ue.classes.FormData,Blob:Ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],t=>{bi.headers[t]={}});const nx=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ix=t=>{const e={};let n,i,s;return t&&t.split(`
|
|
161
|
+
`).forEach(function(r){s=r.indexOf(":"),n=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!n||e[n]&&nx[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},sc=Symbol("internals");function xi(t){return t&&String(t).trim().toLowerCase()}function vs(t){return t===!1||t==null?t:B.isArray(t)?t.map(vs):String(t)}function sx(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const ox=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zo(t,e,n,i,s){if(B.isFunction(i))return i.call(this,e,n);if(s&&(e=n),!!B.isString(e)){if(B.isString(i))return e.indexOf(i)!==-1;if(B.isRegExp(i))return i.test(e)}}function rx(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function ax(t,e){const n=B.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(s,o,r){return this[i].call(this,e,s,o,r)},configurable:!0})})}class Ge{constructor(e){e&&this.set(e)}set(e,n,i){const s=this;function o(l,c,d){const u=xi(c);if(!u)throw new Error("header name must be a non-empty string");const f=B.findKey(s,u);(!f||s[f]===void 0||d===!0||d===void 0&&s[f]!==!1)&&(s[f||c]=vs(l))}const r=(l,c)=>B.forEach(l,(d,u)=>o(d,u,c));if(B.isPlainObject(e)||e instanceof this.constructor)r(e,n);else if(B.isString(e)&&(e=e.trim())&&!ox(e))r(ix(e),n);else if(B.isHeaders(e))for(const[l,c]of e.entries())o(c,l,i);else e!=null&&o(n,e,i);return this}get(e,n){if(e=xi(e),e){const i=B.findKey(this,e);if(i){const s=this[i];if(!n)return s;if(n===!0)return sx(s);if(B.isFunction(n))return n.call(this,s,i);if(B.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=xi(e),e){const i=B.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||Zo(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let s=!1;function o(r){if(r=xi(r),r){const l=B.findKey(i,r);l&&(!n||Zo(i,i[l],l,n))&&(delete i[l],s=!0)}}return B.isArray(e)?e.forEach(o):o(e),s}clear(e){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const o=n[i];(!e||Zo(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const n=this,i={};return B.forEach(this,(s,o)=>{const r=B.findKey(i,o);if(r){n[r]=vs(s),delete n[o];return}const l=e?rx(o):String(o).trim();l!==o&&delete n[o],n[l]=vs(s),i[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return B.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=e&&B.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
162
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[sc]=this[sc]={accessors:{}}).accessors,s=this.prototype;function o(r){const l=xi(r);i[l]||(ax(s,r),i[l]=!0)}return B.isArray(e)?e.forEach(o):o(e),this}}Ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.reduceDescriptors(Ge.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}}),B.freezeMethods(Ge);function er(t,e){const n=this||bi,i=e||n,s=Ge.from(i.headers);let o=i.data;return B.forEach(t,function(l){o=l.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function oc(t){return!!(t&&t.__CANCEL__)}function In(t,e,n){re.call(this,t??"canceled",re.ERR_CANCELED,e,n),this.name="CanceledError"}B.inherits(In,re,{__CANCEL__:!0});function rc(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function lx(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function cx(t,e){t=t||10;const n=new Array(t),i=new Array(t);let s=0,o=0,r;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),u=i[o];r||(r=d),n[s]=c,i[s]=d;let f=o,h=0;for(;f!==s;)h+=n[f++],f=f%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),d-r<e)return;const m=u&&d-u;return m?Math.round(h*1e3/m):void 0}}function dx(t,e){let n=0,i=1e3/e,s,o;const r=(d,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),t.apply(null,d)};return[(...d)=>{const u=Date.now(),f=u-n;f>=i?r(d,u):(s=d,o||(o=setTimeout(()=>{o=null,r(s)},i-f)))},()=>s&&r(s)]}const Ns=(t,e,n=3)=>{let i=0;const s=cx(50,250);return dx(o=>{const r=o.loaded,l=o.lengthComputable?o.total:void 0,c=r-i,d=s(c),u=r<=l;i=r;const f={loaded:r,total:l,progress:l?r/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-r)/d:void 0,event:o,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(f)},n)},ac=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},lc=t=>(...e)=>B.asap(()=>t(...e)),ux=Ue.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ue.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ue.origin),Ue.navigator&&/(msie|trident)/i.test(Ue.navigator.userAgent)):()=>!0,fx=Ue.hasStandardBrowserEnv?{write(t,e,n,i,s,o){const r=[t+"="+encodeURIComponent(e)];B.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),B.isString(i)&&r.push("path="+i),B.isString(s)&&r.push("domain="+s),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hx(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function mx(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function cc(t,e){return t&&!hx(e)?mx(t,e):e}const dc=t=>t instanceof Ge?{...t}:t;function bn(t,e){e=e||{};const n={};function i(d,u,f,h){return B.isPlainObject(d)&&B.isPlainObject(u)?B.merge.call({caseless:h},d,u):B.isPlainObject(u)?B.merge({},u):B.isArray(u)?u.slice():u}function s(d,u,f,h){if(B.isUndefined(u)){if(!B.isUndefined(d))return i(void 0,d,f,h)}else return i(d,u,f,h)}function o(d,u){if(!B.isUndefined(u))return i(void 0,u)}function r(d,u){if(B.isUndefined(u)){if(!B.isUndefined(d))return i(void 0,d)}else return i(void 0,u)}function l(d,u,f){if(f in e)return i(d,u);if(f in t)return i(void 0,d)}const c={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:l,headers:(d,u,f)=>s(dc(d),dc(u),f,!0)};return B.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=c[u]||s,h=f(t[u],e[u],u);B.isUndefined(h)&&f!==l||(n[u]=h)}),n}const uc=t=>{const e=bn({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:r,auth:l}=e;e.headers=r=Ge.from(r),e.url=ec(cc(e.baseURL,e.url),t.params,t.paramsSerializer),l&&r.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(B.isFormData(n)){if(Ue.hasStandardBrowserEnv||Ue.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((c=r.getContentType())!==!1){const[d,...u]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];r.setContentType([d||"multipart/form-data",...u].join("; "))}}if(Ue.hasStandardBrowserEnv&&(i&&B.isFunction(i)&&(i=i(e)),i||i!==!1&&ux(e.url))){const d=s&&o&&fx.read(o);d&&r.set(s,d)}return e},px=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,i){const s=uc(t);let o=s.data;const r=Ge.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,u,f,h,m,p;function g(){m&&m(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const w=Ge.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:t,request:y};rc(function(S){n(S),g()},function(S){i(S),g()},k),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(i(new re("Request aborted",re.ECONNABORTED,t,y)),y=null)},y.onerror=function(){i(new re("Network Error",re.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||nc;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),i(new re(E,k.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,t,y)),y=null},o===void 0&&r.setContentType(null),"setRequestHeader"in y&&B.forEach(r.toJSON(),function(E,k){y.setRequestHeader(k,E)}),B.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&l!=="json"&&(y.responseType=s.responseType),d&&([h,p]=Ns(d,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,m]=Ns(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(u=w=>{y&&(i(!w||w.type?new In(null,t,y):w),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=lx(s.url);if(x&&Ue.protocols.indexOf(x)===-1){i(new re("Unsupported protocol "+x+":",re.ERR_BAD_REQUEST,t));return}y.send(o||null)})},gx=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,s;const o=function(d){if(!s){s=!0,l();const u=d instanceof Error?d:this.reason;i.abort(u instanceof re?u:new In(u instanceof Error?u.message:u))}};let r=e&&setTimeout(()=>{r=null,o(new re(`timeout ${e} of ms exceeded`,re.ETIMEDOUT))},e);const l=()=>{t&&(r&&clearTimeout(r),r=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),t=null)};t.forEach(d=>d.addEventListener("abort",o));const{signal:c}=i;return c.unsubscribe=()=>B.asap(l),c}},yx=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,s;for(;i<n;)s=i+e,yield t.slice(i,s),i=s},bx=async function*(t,e){for await(const n of xx(t))yield*yx(n,e)},xx=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},fc=(t,e,n,i)=>{const s=bx(t,e);let o=0,r,l=c=>{r||(r=!0,i&&i(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await s.next();if(d){l(),c.close();return}let f=u.byteLength;if(n){let h=o+=f;n(h)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},Ds=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",hc=Ds&&typeof ReadableStream=="function",_x=Ds&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),mc=(t,...e)=>{try{return!!t(...e)}catch{return!1}},kx=hc&&mc(()=>{let t=!1;const e=new Request(Ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),pc=64*1024,tr=hc&&mc(()=>B.isReadableStream(new Response("").body)),Ts={stream:tr&&(t=>t.body)};Ds&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ts[e]&&(Ts[e]=B.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new re(`Response type '${e}' is not supported`,re.ERR_NOT_SUPPORT,i)})})})(new Response);const Sx=async t=>{if(t==null)return 0;if(B.isBlob(t))return t.size;if(B.isSpecCompliantForm(t))return(await new Request(Ue.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(B.isArrayBufferView(t)||B.isArrayBuffer(t))return t.byteLength;if(B.isURLSearchParams(t)&&(t=t+""),B.isString(t))return(await _x(t)).byteLength},wx=async(t,e)=>{const n=B.toFiniteNumber(t.getContentLength());return n??Sx(e)},nr={http:W0,xhr:px,fetch:Ds&&(async t=>{let{url:e,method:n,data:i,signal:s,cancelToken:o,timeout:r,onDownloadProgress:l,onUploadProgress:c,responseType:d,headers:u,withCredentials:f="same-origin",fetchOptions:h}=uc(t);d=d?(d+"").toLowerCase():"text";let m=gx([s,o&&o.toAbortSignal()],r),p;const g=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(c&&kx&&n!=="get"&&n!=="head"&&(y=await wx(u,i))!==0){let k=new Request(e,{method:"POST",body:i,duplex:"half"}),C;if(B.isFormData(i)&&(C=k.headers.get("content-type"))&&u.setContentType(C),k.body){const[S,_]=ac(y,Ns(lc(c)));i=fc(k.body,pc,S,_)}}B.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;p=new Request(e,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:b?f:void 0});let x=await fetch(p);const w=tr&&(d==="stream"||d==="response");if(tr&&(l||w&&g)){const k={};["status","statusText","headers"].forEach(O=>{k[O]=x[O]});const C=B.toFiniteNumber(x.headers.get("content-length")),[S,_]=l&&ac(C,Ns(lc(l),!0))||[];x=new Response(fc(x.body,pc,S,()=>{_&&_(),g&&g()}),k)}d=d||"text";let E=await Ts[B.findKey(Ts,d)||"text"](x,t);return!w&&g&&g(),await new Promise((k,C)=>{rc(k,C,{data:E,headers:Ge.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:p})})}catch(b){throw g&&g(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new re("Network Error",re.ERR_NETWORK,t,p),{cause:b.cause||b}):re.from(b,b&&b.code,t,p)}})};B.forEach(nr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const gc=t=>`- ${t}`,Ex=t=>B.isFunction(t)||t===null||t===!1,yc={getAdapter:t=>{t=B.isArray(t)?t:[t];const{length:e}=t;let n,i;const s={};for(let o=0;o<e;o++){n=t[o];let r;if(i=n,!Ex(n)&&(i=nr[(r=String(n)).toLowerCase()],i===void 0))throw new re(`Unknown adapter '${r}'`);if(i)break;s[r||"#"+o]=i}if(!i){const o=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?`since :
|
|
163
|
+
`+o.map(gc).join(`
|
|
164
|
+
`):" "+gc(o[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:nr};function ir(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new In(null,t)}function bc(t){return ir(t),t.headers=Ge.from(t.headers),t.data=er.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),yc.getAdapter(t.adapter||bi.adapter)(t).then(function(i){return ir(t),i.data=er.call(t,t.transformResponse,i),i.headers=Ge.from(i.headers),i},function(i){return oc(i)||(ir(t),i&&i.response&&(i.response.data=er.call(t,t.transformResponse,i.response),i.response.headers=Ge.from(i.response.headers))),Promise.reject(i)})}const xc="1.7.9",Bs={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Bs[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const _c={};Bs.transitional=function(e,n,i){function s(o,r){return"[Axios v"+xc+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,l)=>{if(e===!1)throw new re(s(r," has been removed"+(n?" in "+n:"")),re.ERR_DEPRECATED);return n&&!_c[r]&&(_c[r]=!0,console.warn(s(r," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,r,l):!0}},Bs.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function Cx(t,e,n){if(typeof t!="object")throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let s=i.length;for(;s-- >0;){const o=i[s],r=e[o];if(r){const l=t[o],c=l===void 0||r(l,o,t);if(c!==!0)throw new re("option "+o+" must be "+c,re.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new re("Unknown option "+o,re.ERR_BAD_OPTION)}}const Ps={assertOptions:Cx,validators:Bs},Ct=Ps.validators;class xn{constructor(e){this.defaults=e,this.interceptors={request:new tc,response:new tc}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
|
165
|
+
`+o):i.stack=o}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=bn(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:o}=n;i!==void 0&&Ps.assertOptions(i,{silentJSONParsing:Ct.transitional(Ct.boolean),forcedJSONParsing:Ct.transitional(Ct.boolean),clarifyTimeoutError:Ct.transitional(Ct.boolean)},!1),s!=null&&(B.isFunction(s)?n.paramsSerializer={serialize:s}:Ps.assertOptions(s,{encode:Ct.function,serialize:Ct.function},!0)),Ps.assertOptions(n,{baseUrl:Ct.spelling("baseURL"),withXsrfToken:Ct.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=o&&B.merge(o.common,o[n.method]);o&&B.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=Ge.concat(r,o);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,f=0,h;if(!c){const p=[bc.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,d),h=p.length,u=Promise.resolve(n);f<h;)u=u.then(p[f++],p[f++]);return u}h=l.length;let m=n;for(f=0;f<h;){const p=l[f++],g=l[f++];try{m=p(m)}catch(y){g.call(this,y);break}}try{u=bc.call(this,m)}catch(p){return Promise.reject(p)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(e){e=bn(this.defaults,e);const n=cc(e.baseURL,e.url);return ec(n,e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],function(e){xn.prototype[e]=function(n,i){return this.request(bn(i||{},{method:e,url:n,data:(i||{}).data}))}}),B.forEach(["post","put","patch"],function(e){function n(i){return function(o,r,l){return this.request(bn(l||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}xn.prototype[e]=n(),xn.prototype[e+"Form"]=n(!0)});class sr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const i=this;this.promise.then(s=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const r=new Promise(l=>{i.subscribe(l),o=l}).then(s);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,l){i.reason||(i.reason=new In(o,r,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new sr(function(s){e=s}),cancel:e}}}function Ox(t){return function(n){return t.apply(null,n)}}function vx(t){return B.isObject(t)&&t.isAxiosError===!0}const or={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(or).forEach(([t,e])=>{or[e]=t});function kc(t){const e=new xn(t),n=$l(xn.prototype.request,e);return B.extend(n,xn.prototype,e,{allOwnKeys:!0}),B.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return kc(bn(t,s))},n}const Be=kc(bi);Be.Axios=xn,Be.CanceledError=In,Be.CancelToken=sr,Be.isCancel=oc,Be.VERSION=xc,Be.toFormData=Os,Be.AxiosError=re,Be.Cancel=Be.CanceledError,Be.all=function(e){return Promise.all(e)},Be.spread=Ox,Be.isAxiosError=vx,Be.mergeConfig=bn,Be.AxiosHeaders=Ge,Be.formToJSON=t=>ic(B.isHTMLForm(t)?new FormData(t):t),Be.getAdapter=yc.getAdapter,Be.HttpStatusCode=or,Be.default=Be;const Nx=["onMouseenter","onMouseleave"],Dx=["onClick"],Tx=["onClick"],Bx={class:"ml-2"},Px=["onClick"],Ax=["href"],Mx={class:"ml-2"},Vx=De({__name:"SampleMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},emits:["menuItems"],setup(t,{expose:e,emit:n}){const i=Ye.useRouter(),s=n,o=a.ref([]),r=t;a.onMounted(async()=>{console.log("Menu component mounted",r.menuItems);try{if(r.menuItems)o.value=r.menuItems;else{const d=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");o.value=d.data.response}console.log("menuItems.value",o.value),o.value.forEach(d=>{d.children&&d.children.length>0&&(d.isOpen=!1),s("menuItems",o.value)})}catch(d){console.error("Error fetching menu items:",d)}});const l=d=>{o.value[d]&&o.value[d].children&&o.value[d].children.length>0&&(o.value[d].isOpen=!o.value[d].isOpen)},c=d=>{i.push(o.value[index].url)};return e({props:r,goToUrl:c,toggleDropdown:l}),(d,u)=>(a.openBlock(),a.createElementBlock("div",{class:"card rounded-none p-0",style:a.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 10%;")},[a.createElementVNode("ul",{class:a.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row":"layout-menu-vertical p-0 m-0"]])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(f,h)=>(a.openBlock(),a.createElementBlock("li",{key:f.id,class:a.normalizeClass(["layout-root-menuitem relative",{"is-open":f.isOpen}]),onMouseenter:m=>l(h),onMouseleave:m=>l(h)},[d.$slots["list-item-menu-parent"]?(a.openBlock(),a.createElementBlock("a",{key:0,onClick:m=>c()},[a.renderSlot(d.$slots,"list-item-menu-parent",a.normalizeProps({[t.variable||""]:f}),void 0,!0)],8,Dx)):(a.openBlock(),a.createElementBlock("a",{key:1,onClick:m=>c(),href:"#",class:"flex items-center p-3 text-primary-color cursor-pointer transition-colors duration-300"},[u[0]||(u[0]=a.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),a.createElementVNode("span",Bx,a.toDisplayString(f.displayLabel),1)],8,Tx)),f.isOpen?(a.openBlock(),a.createElementBlock("ul",{key:2,class:a.normalizeClass(["submenu",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-white shadow-md z-1000":"submenu-vertical pl-5"]])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f.children,(m,p)=>(a.openBlock(),a.createElementBlock("li",{key:m.id},[d.$slots["list-item-menu-child"]?(a.openBlock(),a.createElementBlock("a",{key:0,onClick:g=>l(h)},[a.renderSlot(d.$slots,"list-item-menu-child",a.normalizeProps({[t.variable||""]:m}),void 0,!0)],8,Px)):(a.openBlock(),a.createElementBlock("a",{key:1,href:m.url,class:"layout-submenu-item flex items-center p-3 text-primary-color cursor-pointer transition-colors duration-300"},[u[1]||(u[1]=a.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),a.createElementVNode("span",Mx,a.toDisplayString(m.displayLabel),1)],8,Ax))]))),128))],2)):a.createCommentVNode("",!0)],42,Nx))),128))],2)],4))}},[["__scopeId","data-v-1bc890da"]]),Rx=["onMouseenter","onMouseleave"],Fx=["onClick"],$x=["onClick"],Lx={class:"ml-2"},Ix=["onClick"],jx=["href"],zx={class:"ml-2"},Ux=De({__name:"ContraMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},setup(t){const e=Ye.useRouter(),n=a.ref([]),i=t;a.onMounted(()=>{n.value=i.menuItems,n.value.forEach(r=>{r.children&&r.children.length>0&&(r.isOpen=!1)})});const s=r=>{n.value[r]&&n.value[r].children&&n.value[r].children.length>0&&(n.value[r].isOpen=!n.value[r].isOpen)},o=r=>{e.push(n.value[index].url)};return(r,l)=>(a.openBlock(),a.createElementBlock("div",{class:"card rounded-none p-0",style:a.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 10%;")},[a.createElementVNode("ul",{class:a.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row space-x-6":"layout-menu-vertical p-0 m-0"]])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(c,d)=>(a.openBlock(),a.createElementBlock("li",{key:c.id,class:a.normalizeClass(["layout-root-menuitem relative group",{"is-open":c.isOpen}]),onMouseenter:u=>s(d),onMouseleave:u=>s(d)},[r.$slots["list-item-menu-parent"]?(a.openBlock(),a.createElementBlock("a",{key:0,onClick:u=>o()},[a.renderSlot(r.$slots,"list-item-menu-parent",a.normalizeProps({[t.variable||""]:c}),void 0,!0)],8,Fx)):(a.openBlock(),a.createElementBlock("a",{key:1,onClick:u=>o(),class:"flex items-center p-3 text-white hover:text-green-500 cursor-pointer transition-all duration-300 ease-in-out group-hover:bg-gradient-to-r from-green-400 to-green-600 group-hover:shadow-xl rounded-md"},[l[0]||(l[0]=a.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),a.createElementVNode("span",Lx,a.toDisplayString(c.displayLabel),1)],8,$x)),c.isOpen?(a.openBlock(),a.createElementBlock("ul",{key:2,class:a.normalizeClass(["submenu transition-all ease-in-out duration-300 opacity-0",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-black text-white shadow-lg rounded-md p-2":"submenu-vertical pl-5 mt-2 bg-black text-white shadow-lg rounded-md"]])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.children,(u,f)=>(a.openBlock(),a.createElementBlock("li",{key:u.id},[r.$slots["list-item-menu-child"]?(a.openBlock(),a.createElementBlock("a",{key:0,onClick:h=>s(d)},[a.renderSlot(r.$slots,"list-item-menu-child",a.normalizeProps({[t.variable||""]:u}),void 0,!0)],8,Ix)):(a.openBlock(),a.createElementBlock("a",{key:1,href:u.url,class:"layout-submenu-item flex items-center p-3 text-white hover:text-green-500 cursor-pointer transition-all duration-300 ease-in-out"},[l[1]||(l[1]=a.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),a.createElementVNode("span",zx,a.toDisplayString(u.displayLabel),1)],8,jx))]))),128))],2)):a.createCommentVNode("",!0)],42,Rx))),128))],2)],4))}},[["__scopeId","data-v-d38ffa61"]]),Wx=["onMouseenter","onMouseleave"],Hx=["onClick"],qx=["onClick"],Yx={class:"ml-2"},Kx=["onClick"],Xx=["href"],Gx={class:"ml-2"},Jx=De({__name:"UltraLightMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},setup(t){const e=Ye.useRouter(),n=a.ref([]),i=t;a.onMounted(async()=>{console.log("Menu component mounted",i.menuItems);try{if(i.menuItems)n.value=i.menuItems;else{const r=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");n.value=r.data.response}console.log("menuItems.value",n.value),n.value.forEach(r=>{r.children&&r.children.length>0&&(r.isOpen=!1)})}catch(r){console.error("Error fetching menu items:",r)}});const s=r=>{n.value[r]&&n.value[r].children&&n.value[r].children.length>0&&(n.value[r].isOpen=!n.value[r].isOpen)},o=r=>{e.push(n.value[r].url)};return(r,l)=>(a.openBlock(),a.createElementBlock("div",{class:"card rounded-none p-0",style:a.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 250px;")},[a.createElementVNode("ul",{class:a.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row justify-around":"layout-menu-vertical p-0 m-0"]])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(c,d)=>(a.openBlock(),a.createElementBlock("li",{key:c.id,class:a.normalizeClass(["layout-root-menuitem relative",{"is-open":c.isOpen}]),onMouseenter:u=>s(d),onMouseleave:u=>s(d)},[r.$slots["list-item-menu-parent"]?(a.openBlock(),a.createElementBlock("a",{key:0,onClick:u=>o(d),class:"menu-item"},[a.renderSlot(r.$slots,"list-item-menu-parent",a.normalizeProps({[t.variable||""]:c}),void 0,!0)],8,Hx)):(a.openBlock(),a.createElementBlock("a",{key:1,onClick:u=>o(d),href:"#",class:"flex items-center p-4 text-white rounded-lg cursor-pointer transition-all duration-300 transform hover:scale-105 menu-item"},[l[0]||(l[0]=a.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),a.createElementVNode("span",Yx,a.toDisplayString(c.displayLabel),1)],8,qx)),c.isOpen?(a.openBlock(),a.createElementBlock("ul",{key:2,class:a.normalizeClass(["submenu transition-all ease-in-out duration-300",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-blue-600 shadow-xl rounded-lg z-1000":"submenu-vertical pl-5 mt-2 bg-gray-800 text-white shadow-md rounded-md"]])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.children,(u,f)=>(a.openBlock(),a.createElementBlock("li",{key:u.id},[r.$slots["list-item-menu-child"]?(a.openBlock(),a.createElementBlock("a",{key:0,onClick:h=>s(d),class:"submenu-item"},[a.renderSlot(r.$slots,"list-item-menu-child",a.normalizeProps({[t.variable||""]:u}),void 0,!0)],8,Kx)):(a.openBlock(),a.createElementBlock("a",{key:1,href:u.url,class:"layout-submenu-item flex items-center p-3 text-white hover:text-blue-400 cursor-pointer transition-all duration-300 transform hover:scale-105"},[l[1]||(l[1]=a.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),a.createElementVNode("span",Gx,a.toDisplayString(u.displayLabel),1)],8,Xx))]))),128))],2)):a.createCommentVNode("",!0)],42,Wx))),128))],2)],4))}},[["__scopeId","data-v-138d7c6d"]]),Qx={key:0},Zx={key:1},Sc=De({__name:"Menu",props:{menuName:{type:String,required:!0},menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},variable:String},setup(t){const e=a.useTemplateRef("componentsRef"),n=l=>{console.log("Menu Items:",l)},i=t,s=a.ref([]),o=a.ref(!1),r={sample:Vx,contra:Ux,ultra:Jx};return a.onMounted(async()=>{try{const l=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");s.value=l.data.response,o.value=!0,s.value.forEach(c=>{c.children&&c.children.length>0&&(c.isOpen=!1)})}catch(l){console.error("Error fetching menu items:",l)}}),(l,c)=>l.$slots["list-item-menu-parent"]?(a.openBlock(),a.createElementBlock("div",Qx,[o.value?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r[i.menuName]),a.mergeProps({key:0},i,{"menu-items":s.value}),a.createSlots({_:2},[a.renderList(l.$slots,(d,u)=>({name:u,fn:a.withCtx(f=>[a.renderSlot(l.$slots,u,a.normalizeProps(a.guardReactiveProps(f)),void 0,!0)])}))]),1040,["menu-items"])):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",Zx,[o.value?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r[i.menuName]),a.mergeProps({key:0},i,{"menu-items":s.value,ref_key:"componentsRef",ref:e,onMenuItems:n}),null,16,["menu-items"])):a.createCommentVNode("",!0)]))}},[["__scopeId","data-v-9cb18622"]]);function e_(t){const e=new kt;return{getEntityRecord:async(i,s,o)=>{try{const r=await e.getRecord(i,s);if(r&&r.response)return o!=null&&o!=""&&t(o,r.response),r}catch(r){return r}finally{}}}}function t_(t){const e=new kt;return{addEntityRecord:async(i,s,o)=>{try{const r=await e.addRecord(i,s);if(r&&r.response)return o!=null&&o!=""&&t(o,r.response),r}catch(r){return r}finally{}}}}function n_(t){const e=new kt;return{deleteEntityRecord:async(i,s,o)=>{try{const r=await e.deleteRecord(i,s);if(r&&r.response)return o!=null&&o!=""&&t(o,r.response),r}catch(r){return r}finally{}}}}const i_={install(t,e){t.component("CSEntityGrid",Ro),t.component("csentitygrid",Ro),t.component("CSEntityList",yl),t.component("csentitylist",yl),t.component("CSFieldExpression",Rl),t.component("csfieldexpression",Rl),t.component("CSEntityBarChart",ul),t.component("csentitybarchart",ul),t.component("CSEntityLineChart",fl),t.component("csentitylinechart",fl),t.component("CSEntityPieChart",hl),t.component("csentitypiechart",hl),t.component("CSEntityPolarChart",ml),t.component("csentitypolarchart",ml),t.component("CSEntityRadarChart",pl),t.component("csentityradarchart",pl),t.component("CSEntity360View",gl),t.component("csentity360view",gl),t.component("CSEntityListing",bl),t.component("csentitylisting",bl),t.component("CSEntityListingTile",xl),t.component("csentitylistingtile",xl),t.component("CSEntityListingCarousel",Ml),t.component("csentitylistingcarousel",Ml),t.component("CSEntitySelection",Ho),t.component("csentityselection",Ho),t.component("CSEntityExplorer",Fl),t.component("csentityexplorer",Fl),t.component("CSMenu",Sc),t.component("csmenu",Sc)}},wc=6048e5,s_=864e5,Ec=Symbol.for("constructDateFrom");function Zt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Ec in t?t[Ec](e):t instanceof Date?new t.constructor(e):new Date(e)}function gt(t,e){return Zt(e||t,t)}let o_={};function As(){return o_}function _i(t,e){var l,c,d,u;const n=As(),i=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=gt(t,e==null?void 0:e.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function Ms(t,e){return _i(t,{...e,weekStartsOn:1})}function Cc(t,e){const n=gt(t,e==null?void 0:e.in),i=n.getFullYear(),s=Zt(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Ms(s),r=Zt(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const l=Ms(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function Oc(t){const e=gt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function r_(t,...e){const n=Zt.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function vc(t,e){const n=gt(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function a_(t,e,n){const[i,s]=r_(n==null?void 0:n.in,t,e),o=vc(i),r=vc(s),l=+o-Oc(o),c=+r-Oc(r);return Math.round((l-c)/s_)}function l_(t,e){const n=Cc(t,e),i=Zt(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ms(i)}function c_(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function d_(t){return!(!c_(t)&&typeof t!="number"||isNaN(+gt(t)))}function u_(t,e){const n=gt(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const f_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},h_=(t,e,n)=>{let i;const s=f_[t];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function rr(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const m_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},g_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y_={date:rr({formats:m_,defaultWidth:"full"}),time:rr({formats:p_,defaultWidth:"full"}),dateTime:rr({formats:g_,defaultWidth:"full"})},b_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x_=(t,e,n,i)=>b_[t];function ki(t){return(e,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let s;if(i==="formatting"&&t.formattingValues){const r=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):r;s=t.formattingValues[l]||t.formattingValues[r]}else{const r=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[r]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}const __={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},k_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},S_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},w_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},E_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},C_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},O_={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ki({values:__,defaultWidth:"wide"}),quarter:ki({values:k_,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ki({values:S_,defaultWidth:"wide"}),day:ki({values:w_,defaultWidth:"wide"}),dayPeriod:ki({values:E_,defaultWidth:"wide",formattingValues:C_,defaultFormattingWidth:"wide"})};function Si(t){return(e,n={})=>{const i=n.width,s=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const r=o[0],l=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?N_(l,f=>f.test(r)):v_(l,f=>f.test(r));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(r.length);return{value:d,rest:u}}}function v_(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function N_(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function D_(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const s=i[0],o=e.match(t.parsePattern);if(!o)return null;let r=t.valueCallback?t.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const l=e.slice(s.length);return{value:r,rest:l}}}const T_=/^(\d+)(th|st|nd|rd)?/i,B_=/\d+/i,P_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},A_={any:[/^b/i,/^(a|c)/i]},M_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},V_={any:[/1/i,/2/i,/3/i,/4/i]},R_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},F_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},L_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},I_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},j_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},z_={ordinalNumber:D_({matchPattern:T_,parsePattern:B_,valueCallback:t=>parseInt(t,10)}),era:Si({matchPatterns:P_,defaultMatchWidth:"wide",parsePatterns:A_,defaultParseWidth:"any"}),quarter:Si({matchPatterns:M_,defaultMatchWidth:"wide",parsePatterns:V_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Si({matchPatterns:R_,defaultMatchWidth:"wide",parsePatterns:F_,defaultParseWidth:"any"}),day:Si({matchPatterns:$_,defaultMatchWidth:"wide",parsePatterns:L_,defaultParseWidth:"any"}),dayPeriod:Si({matchPatterns:I_,defaultMatchWidth:"any",parsePatterns:j_,defaultParseWidth:"any"})},U_={code:"en-US",formatDistance:h_,formatLong:y_,formatRelative:x_,localize:O_,match:z_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W_(t,e){const n=gt(t,e==null?void 0:e.in);return a_(n,u_(n))+1}function H_(t,e){const n=gt(t,e==null?void 0:e.in),i=+Ms(n)-+l_(n);return Math.round(i/wc)+1}function Nc(t,e){var u,f,h,m;const n=gt(t,e==null?void 0:e.in),i=n.getFullYear(),s=As(),o=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,r=Zt((e==null?void 0:e.in)||t,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const l=_i(r,e),c=Zt((e==null?void 0:e.in)||t,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);const d=_i(c,e);return+n>=+l?i+1:+n>=+d?i:i-1}function q_(t,e){var l,c,d,u;const n=As(),i=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Nc(t,e),o=Zt((e==null?void 0:e.in)||t,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),_i(o,e)}function Y_(t,e){const n=gt(t,e==null?void 0:e.in),i=+_i(n,e)-+q_(n,e);return Math.round(i/wc)+1}function ye(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const en={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return ye(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):ye(n+1,2)},d(t,e){return ye(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return ye(t.getHours()%12||12,e.length)},H(t,e){return ye(t.getHours(),e.length)},m(t,e){return ye(t.getMinutes(),e.length)},s(t,e){return ye(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ye(s,e.length)}},jn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dc={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return en.y(t,e)},Y:function(t,e,n,i){const s=Nc(t,i),o=s>0?s:1-s;if(e==="YY"){const r=o%100;return ye(r,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):ye(o,e.length)},R:function(t,e){const n=Cc(t);return ye(n,e.length)},u:function(t,e){const n=t.getFullYear();return ye(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ye(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ye(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return en.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return ye(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const s=Y_(t,i);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):ye(s,e.length)},I:function(t,e,n){const i=H_(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):ye(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):en.d(t,e)},D:function(t,e,n){const i=W_(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ye(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const s=t.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return ye(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const s=t.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return ye(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return ye(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let s;switch(i===12?s=jn.noon:i===0?s=jn.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let s;switch(i>=17?s=jn.evening:i>=12?s=jn.afternoon:i>=4?s=jn.morning:s=jn.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return en.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):en.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ye(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):ye(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):en.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):en.s(t,e)},S:function(t,e){return en.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Bc(i);case"XXXX":case"XX":return _n(i);case"XXXXX":case"XXX":default:return _n(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Bc(i);case"xxxx":case"xx":return _n(i);case"xxxxx":case"xxx":default:return _n(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Tc(i,":");case"OOOO":default:return"GMT"+_n(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Tc(i,":");case"zzzz":default:return"GMT"+_n(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return ye(i,e.length)},T:function(t,e,n){return ye(+t,e.length)}};function Tc(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+e+ye(o,2)}function Bc(t,e){return t%60===0?(t>0?"-":"+")+ye(Math.abs(t)/60,2):_n(t,e)}function _n(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=ye(Math.trunc(i/60),2),o=ye(i%60,2);return n+s+e+o}const Pc=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ac=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},K_={p:Ac,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Pc(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Pc(i,e)).replace("{{time}}",Ac(s,e))}},X_=/^D+$/,G_=/^Y+$/,J_=["D","DD","YY","YYYY"];function Q_(t){return X_.test(t)}function Z_(t){return G_.test(t)}function ek(t,e,n){const i=tk(t,e,n);if(console.warn(i),J_.includes(t))throw new RangeError(i)}function tk(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ik=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sk=/^'([^]*?)'?$/,ok=/''/g,rk=/[a-zA-Z]/;function Mc(t,e,n){var u,f,h,m;const i=As(),s=i.locale??U_,o=i.firstWeekContainsDate??((f=(u=i.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,r=i.weekStartsOn??((m=(h=i.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=gt(t,n==null?void 0:n.in);if(!d_(l))throw new RangeError("Invalid time value");let c=e.match(ik).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=K_[g];return y(p,s.formatLong)}return p}).join("").match(nk).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:ak(p)};if(Dc[g])return{isToken:!0,value:p};if(g.match(rk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(Z_(g)||Q_(g))&&ek(g,e,String(t));const y=Dc[g[0]];return y(l,g,s.localize,d)}).join("")}function ak(t){const e=t.match(sk);return e?e[1].replace(ok,"'"):t}const lk=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(t,e){const{value:n,arg:i}=e;if(t&&n){const s=Mc(new Date(n),i||"yyyy-MM-dd");t.textContent=s}},updated(t,e){const{value:n,arg:i}=e;if(t&&n){const s=Mc(new Date(n),i||"yyyy-MM-dd");t.textContent=s}}}},Symbol.toStringTag,{value:"Module"})),ck=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(t,e){const{value:n,arg:i}=e;n&&(t.textContent=t.textContent.toUpperCase())},updated(t,e){const{value:n,arg:i}=e;n&&(t.textContent=t.textContent.toUpperCase())}}},Symbol.toStringTag,{value:"Module"}));/*!
|
|
161
166
|
* @kurkle/color v0.3.4
|
|
162
167
|
* https://github.com/kurkle/color#readme
|
|
163
168
|
* (c) 2024 Jukka Kurkela
|
|
164
169
|
* Released under the MIT License
|
|
165
|
-
*/function
|
|
170
|
+
*/function wi(t){return t+.5|0}const tn=(t,e,n)=>Math.max(Math.min(t,n),e);function Ei(t){return tn(wi(t*2.55),0,255)}function nn(t){return tn(wi(t*255),0,255)}function Lt(t){return tn(wi(t/2.55)/100,0,1)}function Vc(t){return tn(wi(t*100),0,100)}const at={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ar=[..."0123456789ABCDEF"],dk=t=>ar[t&15],uk=t=>ar[(t&240)>>4]+ar[t&15],Vs=t=>(t&240)>>4===(t&15),fk=t=>Vs(t.r)&&Vs(t.g)&&Vs(t.b)&&Vs(t.a);function hk(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&at[t[1]]*17,g:255&at[t[2]]*17,b:255&at[t[3]]*17,a:e===5?at[t[4]]*17:255}:(e===7||e===9)&&(n={r:at[t[1]]<<4|at[t[2]],g:at[t[3]]<<4|at[t[4]],b:at[t[5]]<<4|at[t[6]],a:e===9?at[t[7]]<<4|at[t[8]]:255})),n}const mk=(t,e)=>t<255?e(t):"";function pk(t){var e=fk(t)?dk:uk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+mk(t.a,e):void 0}const gk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Rc(t,e,n){const i=e*Math.min(n,1-n),s=(o,r=(o+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function yk(t,e,n){const i=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function bk(t,e,n){const i=Rc(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)i[s]*=1-e-n,i[s]+=e;return i}function xk(t,e,n,i,s){return t===s?(e-n)/i+(e<n?6:0):e===s?(n-t)/i+2:(t-e)/i+4}function lr(t){const n=t.r/255,i=t.g/255,s=t.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),l=(o+r)/2;let c,d,u;return o!==r&&(u=o-r,d=l>.5?u/(2-o-r):u/(o+r),c=xk(n,i,s,u,o),c=c*60+.5),[c|0,d||0,l]}function cr(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(nn)}function dr(t,e,n){return cr(Rc,t,e,n)}function _k(t,e,n){return cr(bk,t,e,n)}function kk(t,e,n){return cr(yk,t,e,n)}function Fc(t){return(t%360+360)%360}function Sk(t){const e=gk.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?Ei(+e[5]):nn(+e[5]));const s=Fc(+e[2]),o=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?i=_k(s,o,r):e[1]==="hsv"?i=kk(s,o,r):i=dr(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function wk(t,e){var n=lr(t);n[0]=Fc(n[0]+e),n=dr(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Ek(t){if(!t)return;const e=lr(t),n=e[0],i=Vc(e[1]),s=Vc(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${s}%, ${Lt(t.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const $c={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Lc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ck(){const t={},e=Object.keys(Lc),n=Object.keys($c);let i,s,o,r,l;for(i=0;i<e.length;i++){for(r=l=e[i],s=0;s<n.length;s++)o=n[s],l=l.replace(o,$c[o]);o=parseInt(Lc[r],16),t[l]=[o>>16&255,o>>8&255,o&255]}return t}let Rs;function Ok(t){Rs||(Rs=Ck(),Rs.transparent=[0,0,0,0]);const e=Rs[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const vk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Nk(t){const e=vk.exec(t);let n=255,i,s,o;if(e){if(e[7]!==i){const r=+e[7];n=e[8]?Ei(r):tn(r*255,0,255)}return i=+e[1],s=+e[3],o=+e[5],i=255&(e[2]?Ei(i):tn(i,0,255)),s=255&(e[4]?Ei(s):tn(s,0,255)),o=255&(e[6]?Ei(o):tn(o,0,255)),{r:i,g:s,b:o,a:n}}}function Dk(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Lt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ur=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,zn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Tk(t,e,n){const i=zn(Lt(t.r)),s=zn(Lt(t.g)),o=zn(Lt(t.b));return{r:nn(ur(i+n*(zn(Lt(e.r))-i))),g:nn(ur(s+n*(zn(Lt(e.g))-s))),b:nn(ur(o+n*(zn(Lt(e.b))-o))),a:t.a+n*(e.a-t.a)}}function Fs(t,e,n){if(t){let i=lr(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,e===0?360:1)),i=dr(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Ic(t,e){return t&&Object.assign(e||{},t)}function jc(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=nn(t[3]))):(e=Ic(t,{r:0,g:0,b:0,a:1}),e.a=nn(e.a)),e}function Bk(t){return t.charAt(0)==="r"?Nk(t):Sk(t)}class Ci{constructor(e){if(e instanceof Ci)return e;const n=typeof e;let i;n==="object"?i=jc(e):n==="string"&&(i=hk(e)||Ok(e)||Bk(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Ic(this._rgb);return e&&(e.a=Lt(e.a)),e}set rgb(e){this._rgb=jc(e)}rgbString(){return this._valid?Dk(this._rgb):void 0}hexString(){return this._valid?pk(this._rgb):void 0}hslString(){return this._valid?Ek(this._rgb):void 0}mix(e,n){if(e){const i=this.rgb,s=e.rgb;let o;const r=n===o?.5:n,l=2*r-1,c=i.a-s.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(e,n){return e&&(this._rgb=Tk(this._rgb,e._rgb,n)),this}clone(){return new Ci(this.rgb)}alpha(e){return this._rgb.a=nn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=wi(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Fs(this._rgb,2,e),this}darken(e){return Fs(this._rgb,2,-e),this}saturate(e){return Fs(this._rgb,1,e),this}desaturate(e){return Fs(this._rgb,1,-e),this}rotate(e){return wk(this._rgb,e),this}}/*!
|
|
166
171
|
* Chart.js v4.4.7
|
|
167
172
|
* https://www.chartjs.org
|
|
168
173
|
* (c) 2024 Chart.js Contributors
|
|
169
174
|
* Released under the MIT License
|
|
170
|
-
*/function Pt(){}const a0=(()=>{let n=0;return()=>n++})();function de(n){return n==null}function Ce(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function le(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Ne(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Xe(n,e){return Ne(n)?n:e}function oe(n,e){return typeof n>"u"?e:n}const l0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/e,pl=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function xe(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ge(n,e,t,i){let s,o,a;if(Ce(n))for(o=n.length,s=0;s<o;s++)e.call(t,n[s],s);else if(le(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)e.call(t,n[a[s]],a[s])}function ds(n,e){let t,i,s,o;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],o=e[t],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function us(n){if(Ce(n))return n.map(us);if(le(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=us(n[t[s]]);return e}return n}function gl(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function c0(n,e,t,i){if(!gl(n))return;const s=e[n],o=t[n];le(s)&&le(o)?ci(s,o,i):e[n]=us(o)}function ci(n,e,t){const i=Ce(e)?e:[e],s=i.length;if(!le(n))return n;t=t||{};const o=t.merger||c0;let a;for(let l=0;l<s;++l){if(a=i[l],!le(a))continue;const c=Object.keys(a);for(let d=0,u=c.length;d<u;++d)o(c[d],n,a,t)}return n}function di(n,e){return ci(n,e,{merger:d0})}function d0(n,e,t){if(!gl(n))return;const i=e[n],s=t[n];le(i)&&le(s)?di(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=us(s))}const yl={"":n=>n,x:n=>n.x,y:n=>n.y};function u0(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function f0(n){const e=u0(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Kt(n,e){return(yl[e]||(yl[e]=f0(e)))(n)}function Eo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ui=n=>typeof n<"u",Xt=n=>typeof n=="function",bl=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function h0(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ke=Math.PI,Se=2*ke,m0=Se+ke,fs=Number.POSITIVE_INFINITY,p0=ke/180,Te=ke/2,dn=ke/4,xl=ke*2/3,Gt=Math.log10,yt=Math.sign;function fi(n,e,t){return Math.abs(n-e)<t}function _l(n){const e=Math.round(n);n=fi(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Gt(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function g0(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,o)=>s-o).pop(),e}function Tn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function y0(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function kl(n,e,t){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][t],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function dt(n){return n*(ke/180)}function Co(n){return n*(180/ke)}function Sl(n){if(!Ne(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function wl(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let o=Math.atan2(i,t);return o<-.5*ke&&(o+=Se),{angle:o,distance:s}}function vo(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function b0(n,e){return(n-e+m0)%Se-ke}function Ge(n){return(n%Se+Se)%Se}function hi(n,e,t,i){const s=Ge(n),o=Ge(e),a=Ge(t),l=Ge(o-s),c=Ge(a-s),d=Ge(s-o),u=Ge(s-a);return s===o||s===a||i&&o===a||l>c&&d<u}function Fe(n,e,t){return Math.max(e,Math.min(t,n))}function x0(n){return Fe(n,-32768,32767)}function Bt(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Do(n,e,t){t=t||(a=>n[a]<e);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,t(o)?s=o:i=o;return{lo:s,hi:i}}const Mt=(n,e,t,i)=>Do(n,t,i?s=>{const o=n[s][e];return o<t||o===t&&n[s+1][e]===t}:s=>n[s][e]<t),_0=(n,e,t)=>Do(n,t,i=>n[i][e]>=t);function k0(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const El=["push","pop","shift","splice","unshift"];function S0(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),El.forEach(t=>{const i="_onData"+Eo(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...o)}),a}})})}function Cl(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(El.forEach(o=>{delete n[o]}),delete n._chartjs)}function vl(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const Dl=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Nl(n,e){let t=[],i=!1;return function(...s){t=s,i||(i=!0,Dl.call(window,()=>{i=!1,n.apply(e,t)}))}}function w0(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const No=n=>n==="start"?"left":n==="end"?"right":"center",Re=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,E0=(n,e,t,i)=>n===(i?"left":"right")?t:n==="center"?(e+t)/2:e;function Ol(n,e,t){const i=e.length;let s=0,o=i;if(n._sorted){const{iScale:a,_parsed:l}=n,c=a.axis,{min:d,max:u,minDefined:f,maxDefined:h}=a.getUserBounds();f&&(s=Fe(Math.min(Mt(l,c,d).lo,t?i:Mt(e,c,a.getPixelForValue(d)).lo),0,i-1)),h?o=Fe(Math.max(Mt(l,a.axis,u,!0).hi+1,t?0:Mt(e,c,a.getPixelForValue(u),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function Tl(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),o}const hs=n=>n===0||n===1,Pl=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Se/t)),Bl=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Se/t)+1,mi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Te)+1,easeOutSine:n=>Math.sin(n*Te),easeInOutSine:n=>-.5*(Math.cos(ke*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>hs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>hs(n)?n:Pl(n,.075,.3),easeOutElastic:n=>hs(n)?n:Bl(n,.075,.3),easeInOutElastic(n){return hs(n)?n:n<.5?.5*Pl(n*2,.1125,.45):.5+.5*Bl(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-mi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?mi.easeInBounce(n*2)*.5:mi.easeOutBounce(n*2-1)*.5+.5};function Oo(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ml(n){return Oo(n)?n:new li(n)}function To(n){return Oo(n)?n:new li(n).saturate(.5).darken(.1).hexString()}const C0=["x","y","borderWidth","radius","tension"],v0=["color","borderColor","backgroundColor"];function D0(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:v0},numbers:{type:"number",properties:C0}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function N0(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vl=new Map;function O0(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Vl.get(t);return i||(i=new Intl.NumberFormat(n,e),Vl.set(t,i)),i}function pi(n,e,t){return O0(e,t).format(n)}const Al={values(n){return Ce(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(t.length>1){const d=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=T0(n,t)}const a=Gt(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),pi(n,i,c)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Gt(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?Al.numeric.call(this,n,e,t):""}};function T0(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var gi={formatters:Al};function P0(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:gi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const un=Object.create(null),Po=Object.create(null);function yi(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const o=t[i];n=n[o]||(n[o]=Object.create(null))}return n}function Bo(n,e,t){return typeof e=="string"?ci(yi(n,e),t):ci(yi(n,""),e)}class B0{constructor(e,t){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=i=>i.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=(i,s)=>To(s.backgroundColor),this.hoverBorderColor=(i,s)=>To(s.borderColor),this.hoverColor=(i,s)=>To(s.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(t)}set(e,t){return Bo(this,e,t)}get(e){return yi(this,e)}describe(e,t){return Bo(Po,e,t)}override(e,t){return Bo(un,e,t)}route(e,t,i,s){const o=yi(this,e),a=yi(this,i),l="_"+t;Object.defineProperties(o,{[l]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){const c=this[l],d=a[s];return le(c)?Object.assign({},d,c):oe(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(t=>t(this))}}var we=new B0({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[D0,N0,P0]);function M0(n){return!n||de(n.size)||de(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ms(n,e,t,i,s){let o=e[s];return o||(o=e[s]=n.measureText(s).width,t.push(s)),o>i&&(i=o),i}function V0(n,e,t,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},o=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let a=0;const l=t.length;let c,d,u,f,h;for(c=0;c<l;c++)if(f=t[c],f!=null&&!Ce(f))a=ms(n,s,o,a,f);else if(Ce(f))for(d=0,u=f.length;d<u;d++)h=f[d],h!=null&&!Ce(h)&&(a=ms(n,s,o,a,h));n.restore();const m=o.length/2;if(m>t.length){for(c=0;c<m;c++)delete s[o[c]];o.splice(0,m)}return a}function fn(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function Fl(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Mo(n,e,t,i){$l(n,e,t,i,null)}function $l(n,e,t,i,s){let o,a,l,c,d,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let y=(p||0)*p0;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(y),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:s?n.ellipse(t,i,s/2,g,0,0,Se):n.arc(t,i,g,0,Se),n.closePath();break;case"triangle":u=s?s/2:g,n.moveTo(t+Math.sin(y)*u,i-Math.cos(y)*g),y+=xl,n.lineTo(t+Math.sin(y)*u,i-Math.cos(y)*g),y+=xl,n.lineTo(t+Math.sin(y)*u,i-Math.cos(y)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(y+dn)*c,f=Math.cos(y+dn)*(s?s/2-d:c),l=Math.sin(y+dn)*c,h=Math.sin(y+dn)*(s?s/2-d:c),n.arc(t-f,i-l,d,y-ke,y-Te),n.arc(t+h,i-a,d,y-Te,y),n.arc(t+f,i+l,d,y,y+Te),n.arc(t-h,i+a,d,y+Te,y+ke),n.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=s?s/2:c,n.rect(t-u,i-c,2*u,2*c);break}y+=dn;case"rectRot":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+h,i-a),n.lineTo(t+f,i+l),n.lineTo(t-h,i+a),n.closePath();break;case"crossRot":y+=dn;case"cross":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+f,i+l),n.moveTo(t+h,i-a),n.lineTo(t-h,i+a);break;case"star":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+f,i+l),n.moveTo(t+h,i-a),n.lineTo(t-h,i+a),y+=dn,f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),n.moveTo(t-f,i-l),n.lineTo(t+f,i+l),n.moveTo(t+h,i-a),n.lineTo(t-h,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,l=Math.sin(y)*g,n.moveTo(t-a,i-l),n.lineTo(t+a,i+l);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function Vt(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function ps(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function gs(n){n.restore()}function A0(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){const o=(e.x+t.x)/2;n.lineTo(o,e.y),n.lineTo(o,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function F0(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function $0(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),de(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function I0(n,e,t,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),a=e-o.actualBoundingBoxLeft,l=e+o.actualBoundingBoxRight,c=t-o.actualBoundingBoxAscent,d=t+o.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(l,u),n.stroke()}}function L0(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function hn(n,e,t,i,s,o={}){const a=Ce(e)?e:[e],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(n.save(),n.font=s.string,$0(n,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&L0(n,o.backdrop),l&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),de(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,t,i,o.maxWidth)),n.fillText(d,t,i,o.maxWidth),I0(n,t,i,d,o),i+=Number(s.lineHeight);n.restore()}function bi(n,e){const{x:t,y:i,w:s,h:o,radius:a}=e;n.arc(t+a.topLeft,i+a.topLeft,a.topLeft,1.5*ke,ke,!0),n.lineTo(t,i+o-a.bottomLeft),n.arc(t+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,ke,Te,!0),n.lineTo(t+s-a.bottomRight,i+o),n.arc(t+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,Te,0,!0),n.lineTo(t+s,i+a.topRight),n.arc(t+s-a.topRight,i+a.topRight,a.topRight,0,-Te,!0),n.lineTo(t+a.topLeft,i)}const R0=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,j0=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function z0(n,e){const t=(""+n).match(R0);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const W0=n=>+n||0;function Vo(n,e){const t={},i=le(e),s=i?Object.keys(e):e,o=le(n)?i?a=>oe(n[a],n[e[a]]):a=>n[a]:()=>n;for(const a of s)t[a]=W0(o(a));return t}function Il(n){return Vo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function mn(n){return Vo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function je(n){const e=Il(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ve(n,e){n=n||{},e=e||we.font;let t=oe(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=oe(n.style,e.style);i&&!(""+i).match(j0)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:oe(n.family,e.family),lineHeight:z0(oe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:oe(n.weight,e.weight),string:""};return s.string=M0(s),s}function xi(n,e,t,i){let s,o,a;for(s=0,o=n.length;s<o;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function H0(n,e,t){const{min:i,max:s}=n,o=pl(e,(s-i)/2),a=(l,c)=>t&&l===0?0:l+c;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Qt(n,e){return Object.assign(Object.create(n),e)}function Ao(n,e=[""],t,i,s=()=>n[0]){const o=t||n;typeof i>"u"&&(i=Wl("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:l=>Ao([l,...n],e,o,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return Rl(l,c,()=>J0(c,e,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return Hl(l).includes(c)},ownKeys(l){return Hl(l)},set(l,c,d){const u=l._storage||(l._storage=s());return l[c]=u[c]=d,delete l._keys,!0}})}function Pn(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Ll(n,i),setContext:o=>Pn(n,o,t,i),override:o=>Pn(n.override(o),e,t,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete n[a],!0},get(o,a,l){return Rl(o,a,()=>q0(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(o,a,l){return n[a]=l,delete o[a],!0}})}function Ll(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Xt(t)?t:()=>t,isIndexable:Xt(i)?i:()=>i}}const U0=(n,e)=>n?n+Eo(e):e,Fo=(n,e)=>le(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Rl(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function q0(n,e,t){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let l=i[e];return Xt(l)&&a.isScriptable(e)&&(l=Y0(e,l,n,t)),Ce(l)&&l.length&&(l=K0(e,l,n,a.isIndexable)),Fo(e,l)&&(l=Pn(l,s,o&&o[e],a)),l}function Y0(n,e,t,i){const{_proxy:s,_context:o,_subProxy:a,_stack:l}=t;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=e(o,a||i);return l.delete(n),Fo(n,c)&&(c=$o(s._scopes,s,n,c)),c}function K0(n,e,t,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:l}=t;if(typeof o.index<"u"&&i(n))return e[o.index%e.length];if(le(e[0])){const c=e,d=s._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=$o(d,s,n,u);e.push(Pn(f,o,a&&a[n],l))}}return e}function jl(n,e,t){return Xt(n)?n(e,t):n}const X0=(n,e)=>n===!0?e:typeof n=="string"?Kt(e,n):void 0;function G0(n,e,t,i,s){for(const o of e){const a=X0(t,o);if(a){n.add(a);const l=jl(a._fallback,t,s);if(typeof l<"u"&&l!==t&&l!==i)return l}else if(a===!1&&typeof i<"u"&&t!==i)return null}return!1}function $o(n,e,t,i){const s=e._rootScopes,o=jl(e._fallback,t,i),a=[...n,...s],l=new Set;l.add(i);let c=zl(l,a,t,o||t,i);return c===null||typeof o<"u"&&o!==t&&(c=zl(l,a,o,c,i),c===null)?!1:Ao(Array.from(l),[""],s,o,()=>Q0(e,t,i))}function zl(n,e,t,i,s){for(;t;)t=G0(n,e,t,i,s);return t}function Q0(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ce(s)&&le(t)?t:s||{}}function J0(n,e,t,i){let s;for(const o of e)if(s=Wl(U0(o,n),t),typeof s<"u")return Fo(n,s)?$o(t,i,n,s):s}function Wl(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Hl(n){let e=n._keys;return e||(e=n._keys=Z0(n._scopes)),e}function Z0(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function Ul(n,e,t,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let l,c,d,u;for(l=0,c=i;l<c;++l)d=l+t,u=e[d],a[l]={r:s.parse(Kt(u,o),d)};return a}const ex=Number.EPSILON||1e-14,Bn=(n,e)=>e<n.length&&!n[e].skip&&n[e],ql=n=>n==="x"?"y":"x";function tx(n,e,t,i){const s=n.skip?e:n,o=e,a=t.skip?e:t,l=vo(o,s),c=vo(a,o);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=i*d,h=i*u;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+h*(a.x-s.x),y:o.y+h*(a.y-s.y)}}}function nx(n,e,t){const i=n.length;let s,o,a,l,c,d=Bn(n,0);for(let u=0;u<i-1;++u)if(c=d,d=Bn(n,u+1),!(!c||!d)){if(fi(e[u],0,ex)){t[u]=t[u+1]=0;continue}s=t[u]/e[u],o=t[u+1]/e[u],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),t[u]=s*a*e[u],t[u+1]=o*a*e[u])}}function ix(n,e,t="x"){const i=ql(t),s=n.length;let o,a,l,c=Bn(n,0);for(let d=0;d<s;++d){if(a=l,l=c,c=Bn(n,d+1),!l)continue;const u=l[t],f=l[i];a&&(o=(u-a[t])/3,l[`cp1${t}`]=u-o,l[`cp1${i}`]=f-o*e[d]),c&&(o=(c[t]-u)/3,l[`cp2${t}`]=u+o,l[`cp2${i}`]=f+o*e[d])}}function sx(n,e="x"){const t=ql(e),i=n.length,s=Array(i).fill(0),o=Array(i);let a,l,c,d=Bn(n,0);for(a=0;a<i;++a)if(l=c,c=d,d=Bn(n,a+1),!!c){if(d){const u=d[e]-c[e];s[a]=u!==0?(d[t]-c[t])/u:0}o[a]=l?d?yt(s[a-1])!==yt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}nx(n,s,o),ix(n,o,e)}function ys(n,e,t){return Math.max(Math.min(n,t),e)}function ox(n,e){let t,i,s,o,a,l=Vt(n[0],e);for(t=0,i=n.length;t<i;++t)a=o,o=l,l=t<i-1&&Vt(n[t+1],e),o&&(s=n[t],a&&(s.cp1x=ys(s.cp1x,e.left,e.right),s.cp1y=ys(s.cp1y,e.top,e.bottom)),l&&(s.cp2x=ys(s.cp2x,e.left,e.right),s.cp2y=ys(s.cp2y,e.top,e.bottom)))}function rx(n,e,t,i,s){let o,a,l,c;if(e.spanGaps&&(n=n.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")sx(n,s);else{let d=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)l=n[o],c=tx(d,l,n[Math.min(o+1,a-(i?0:1))%a],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&ox(n,t)}function Io(){return typeof window<"u"&&typeof document<"u"}function Lo(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function bs(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const xs=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function ax(n,e){return xs(n).getPropertyValue(e)}const lx=["top","right","bottom","left"];function pn(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const o=lx[s];i[o]=parseFloat(n[e+"-"+o+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const cx=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function dx(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,l,c;if(cx(s,o,n.target))l=s,c=o;else{const d=e.getBoundingClientRect();l=i.clientX-d.left,c=i.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function gn(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=xs(t),o=s.boxSizing==="border-box",a=pn(s,"padding"),l=pn(s,"border","width"),{x:c,y:d,box:u}=dx(n,t),f=a.left+(u&&l.left),h=a.top+(u&&l.top);let{width:m,height:p}=e;return o&&(m-=a.width+l.width,p-=a.height+l.height),{x:Math.round((c-f)/m*t.width/i),y:Math.round((d-h)/p*t.height/i)}}function ux(n,e,t){let i,s;if(e===void 0||t===void 0){const o=n&&Lo(n);if(!o)e=n.clientWidth,t=n.clientHeight;else{const a=o.getBoundingClientRect(),l=xs(o),c=pn(l,"border","width"),d=pn(l,"padding");e=a.width-d.width-c.width,t=a.height-d.height-c.height,i=bs(l.maxWidth,o,"clientWidth"),s=bs(l.maxHeight,o,"clientHeight")}}return{width:e,height:t,maxWidth:i||fs,maxHeight:s||fs}}const _s=n=>Math.round(n*10)/10;function fx(n,e,t,i){const s=xs(n),o=pn(s,"margin"),a=bs(s.maxWidth,n,"clientWidth")||fs,l=bs(s.maxHeight,n,"clientHeight")||fs,c=ux(n,e,t);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const h=pn(s,"border","width"),m=pn(s,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-o.width),u=Math.max(0,i?d/i:u-o.height),d=_s(Math.min(d,a,c.maxWidth)),u=_s(Math.min(u,l,c.maxHeight)),d&&!u&&(u=_s(d/2)),(e!==void 0||t!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,d=_s(Math.floor(u*i))),{width:d,height:u}}function Yl(n,e,t){const i=e||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(n.currentDevicePixelRatio=i,a.height=s,a.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const hx=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Io()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Kl(n,e){const t=ax(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function yn(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function mx(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function px(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},o={x:e.cp1x,y:e.cp1y},a=yn(n,s,t),l=yn(s,o,t),c=yn(o,e,t),d=yn(a,l,t),u=yn(l,c,t);return yn(d,u,t)}const gx=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},yx=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function Mn(n,e,t){return n?gx(e,t):yx()}function Xl(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Gl(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Ql(n){return n==="angle"?{between:hi,compare:b0,normalize:Ge}:{between:Bt,compare:(e,t)=>e-t,normalize:e=>e}}function Jl({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function bx(n,e,t){const{property:i,start:s,end:o}=t,{between:a,normalize:l}=Ql(i),c=e.length;let{start:d,end:u,loop:f}=n,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&a(l(e[d%c][i]),s,o);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:n.style}}function Zl(n,e,t){if(!t)return[n];const{property:i,start:s,end:o}=t,a=e.length,{compare:l,between:c,normalize:d}=Ql(i),{start:u,end:f,loop:h,style:m}=bx(n,e,t),p=[];let g=!1,y=null,b,_,w;const E=()=>c(s,w,b)&&l(s,w)!==0,k=()=>l(o,b)===0||c(o,w,b),C=()=>g||E(),S=()=>!g||k();for(let x=u,v=u;x<=f;++x)_=e[x%a],!_.skip&&(b=d(_[i]),b!==w&&(g=c(b,s,o),y===null&&C()&&(y=l(b,s)===0?x:v),y!==null&&S()&&(p.push(Jl({start:y,end:x,loop:h,count:a,style:m})),y=null),v=x,w=b));return y!==null&&p.push(Jl({start:y,end:f,loop:h,count:a,style:m})),p}function ec(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const o=Zl(i[s],n.points,e);o.length&&t.push(...o)}return t}function xx(n,e,t,i){let s=0,o=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(o+=s);o>s&&n[o%e].skip;)o--;return o%=e,{start:s,end:o}}function _x(n,e,t,i){const s=n.length,o=[];let a=e,l=n[e],c;for(c=e+1;c<=t;++c){const d=n[c%s];d.skip||d.stop?l.skip||(i=!1,o.push({start:e%s,end:(c-1)%s,loop:i}),e=a=d.stop?c:null):(a=c,l.skip&&(e=c)),l=d}return a!==null&&o.push({start:e%s,end:a%s,loop:i}),o}function kx(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const o=!!n._loop,{start:a,end:l}=xx(t,s,o,i);if(i===!0)return tc(n,[{start:a,end:l,loop:o}],t,e);const c=l<a?l+s:l,d=!!n._fullLoop&&a===0&&l===s-1;return tc(n,_x(t,a,c,d),t,e)}function tc(n,e,t,i){return!i||!i.setContext||!t?e:Sx(n,e,t,i)}function Sx(n,e,t,i){const s=n._chart.getContext(),o=nc(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,c=t.length,d=[];let u=o,f=e[0].start,h=f;function m(p,g,y,b){const _=l?-1:1;if(p!==g){for(p+=c;t[p%c].skip;)p-=_;for(;t[g%c].skip;)g+=_;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:b}),u=b,f=g%c)}}for(const p of e){f=l?f:p.start;let g=t[f%c],y;for(h=f+1;h<=p.end;h++){const b=t[h%c];y=nc(i.setContext(Qt(s,{type:"segment",p0:g,p1:b,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:a}))),wx(y,u)&&m(f,h-1,p.loop,u),g=b,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function nc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function wx(n,e){if(!e)return!1;const t=[],i=function(s,o){return Oo(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(e,i)}/*!
|
|
175
|
+
*/function It(){}const Pk=(()=>{let t=0;return()=>t++})();function fe(t){return t==null}function Oe(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 de(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Pe(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function nt(t,e){return Pe(t)?t:e}function ae(t,e){return typeof t>"u"?e:t}const Ak=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,zc=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ke(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function be(t,e,n,i){let s,o,r;if(Oe(t))for(o=t.length,s=0;s<o;s++)e.call(n,t[s],s);else if(de(t))for(r=Object.keys(t),o=r.length,s=0;s<o;s++)e.call(n,t[r[s]],r[s])}function $s(t,e){let n,i,s,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(s=t[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Ls(t){if(Oe(t))return t.map(Ls);if(de(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let s=0;for(;s<i;++s)e[n[s]]=Ls(t[n[s]]);return e}return t}function Uc(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Mk(t,e,n,i){if(!Uc(t))return;const s=e[t],o=n[t];de(s)&&de(o)?Oi(s,o,i):e[t]=Ls(o)}function Oi(t,e,n){const i=Oe(e)?e:[e],s=i.length;if(!de(t))return t;n=n||{};const o=n.merger||Mk;let r;for(let l=0;l<s;++l){if(r=i[l],!de(r))continue;const c=Object.keys(r);for(let d=0,u=c.length;d<u;++d)o(c[d],t,r,n)}return t}function vi(t,e){return Oi(t,e,{merger:Vk})}function Vk(t,e,n){if(!Uc(t))return;const i=e[t],s=n[t];de(i)&&de(s)?vi(i,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ls(s))}const Wc={"":t=>t,x:t=>t.x,y:t=>t.y};function Rk(t){const e=t.split("."),n=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Fk(t){const e=Rk(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function sn(t,e){return(Wc[e]||(Wc[e]=Fk(e)))(t)}function fr(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ni=t=>typeof t<"u",on=t=>typeof t=="function",Hc=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function $k(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Se=Math.PI,we=2*Se,Lk=we+Se,Is=Number.POSITIVE_INFINITY,Ik=Se/180,Me=Se/2,kn=Se/4,qc=Se*2/3,rn=Math.log10,Ot=Math.sign;function Di(t,e,n){return Math.abs(t-e)<n}function Yc(t){const e=Math.round(t);t=Di(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(rn(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function jk(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function Un(t){return!isNaN(parseFloat(t))&&isFinite(t)}function zk(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function Kc(t,e,n){let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function yt(t){return t*(Se/180)}function hr(t){return t*(180/Se)}function Xc(t){if(!Pe(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Gc(t,e){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*Se&&(o+=we),{angle:o,distance:s}}function mr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Uk(t,e){return(t-e+Lk)%we-Se}function it(t){return(t%we+we)%we}function Ti(t,e,n,i){const s=it(t),o=it(e),r=it(n),l=it(o-s),c=it(r-s),d=it(s-o),u=it(s-r);return s===o||s===r||i&&o===r||l>c&&d<u}function Ie(t,e,n){return Math.max(e,Math.min(n,t))}function Wk(t){return Ie(t,-32768,32767)}function jt(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function pr(t,e,n){n=n||(r=>t[r]<e);let i=t.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const zt=(t,e,n,i)=>pr(t,n,i?s=>{const o=t[s][e];return o<n||o===n&&t[s+1][e]===n}:s=>t[s][e]<n),Hk=(t,e,n)=>pr(t,n,i=>t[i][e]>=n);function qk(t,e,n){let i=0,s=t.length;for(;i<s&&t[i]<e;)i++;for(;s>i&&t[s-1]>n;)s--;return i>0||s<t.length?t.slice(i,s):t}const Jc=["push","pop","shift","splice","unshift"];function Yk(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Jc.forEach(n=>{const i="_onData"+fr(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return t._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...o)}),r}})})}function Qc(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Jc.forEach(o=>{delete t[o]}),delete t._chartjs)}function Zc(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ed=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function td(t,e){let n=[],i=!1;return function(...s){n=s,i||(i=!0,ed.call(window,()=>{i=!1,t.apply(e,n)}))}}function Kk(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}const gr=t=>t==="start"?"left":t==="end"?"right":"center",We=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,Xk=(t,e,n,i)=>t===(i?"left":"right")?n:t==="center"?(e+n)/2:e;function nd(t,e,n){const i=e.length;let s=0,o=i;if(t._sorted){const{iScale:r,_parsed:l}=t,c=r.axis,{min:d,max:u,minDefined:f,maxDefined:h}=r.getUserBounds();f&&(s=Ie(Math.min(zt(l,c,d).lo,n?i:zt(e,c,r.getPixelForValue(d)).lo),0,i-1)),h?o=Ie(Math.max(zt(l,r.axis,u,!0).hi+1,n?0:zt(e,c,r.getPixelForValue(u),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function id(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=s,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const js=t=>t===0||t===1,sd=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*we/n)),od=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*we/n)+1,Bi={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(Se*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=>js(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=>js(t)?t:sd(t,.075,.3),easeOutElastic:t=>js(t)?t:od(t,.075,.3),easeInOutElastic(t){return js(t)?t:t<.5?.5*sd(t*2,.1125,.45):.5+.5*od(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-Bi.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?Bi.easeInBounce(t*2)*.5:Bi.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 rd(t){return yr(t)?t:new Ci(t)}function br(t){return yr(t)?t:new Ci(t).saturate(.5).darken(.1).hexString()}const Gk=["x","y","borderWidth","radius","tension"],Jk=["color","borderColor","backgroundColor"];function Qk(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:Jk},numbers:{type:"number",properties:Gk}}),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 Zk(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ad=new Map;function eS(t,e){e=e||{};const n=t+JSON.stringify(e);let i=ad.get(n);return i||(i=new Intl.NumberFormat(t,e),ad.set(n,i)),i}function Pi(t,e,n){return eS(e,n).format(t)}const ld={values(t){return Oe(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let s,o=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=tS(t,n)}const r=rn(Math.abs(o)),l=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pi(t,i,c)},logarithmic(t,e,n){if(t===0)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(rn(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?ld.numeric.call(this,t,e,n):""}};function tS(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 Ai={formatters:ld};function nS(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:Ai.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 Sn=Object.create(null),xr=Object.create(null);function Mi(t,e){if(!e)return t;const n=e.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];t=t[o]||(t[o]=Object.create(null))}return t}function _r(t,e,n){return typeof e=="string"?Oi(Mi(t,e),n):Oi(Mi(t,""),e)}class iS{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=i=>i.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=(i,s)=>br(s.backgroundColor),this.hoverBorderColor=(i,s)=>br(s.borderColor),this.hoverColor=(i,s)=>br(s.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 _r(this,e,n)}get(e){return Mi(this,e)}describe(e,n){return _r(xr,e,n)}override(e,n){return _r(Sn,e,n)}route(e,n,i,s){const o=Mi(this,e),r=Mi(this,i),l="_"+n;Object.defineProperties(o,{[l]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],d=r[s];return de(c)?Object.assign({},d,c):ae(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(n=>n(this))}}var Ee=new iS({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qk,Zk,nS]);function sS(t){return!t||fe(t.size)||fe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zs(t,e,n,i,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,n.push(s)),o>i&&(i=o),i}function oS(t,e,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let r=0;const l=n.length;let c,d,u,f,h;for(c=0;c<l;c++)if(f=n[c],f!=null&&!Oe(f))r=zs(t,s,o,r,f);else if(Oe(f))for(d=0,u=f.length;d<u;d++)h=f[d],h!=null&&!Oe(h)&&(r=zs(t,s,o,r,h));t.restore();const m=o.length/2;if(m>n.length){for(c=0;c<m;c++)delete s[o[c]];o.splice(0,m)}return r}function wn(t,e,n){const i=t.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*i)/i+s}function cd(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function kr(t,e,n,i){dd(t,e,n,i,null)}function dd(t,e,n,i,s){let o,r,l,c,d,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let y=(p||0)*Ik;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(n,i),t.rotate(y),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:s?t.ellipse(n,i,s/2,g,0,0,we):t.arc(n,i,g,0,we),t.closePath();break;case"triangle":u=s?s/2:g,t.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*g),y+=qc,t.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*g),y+=qc,t.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*g),t.closePath();break;case"rectRounded":d=g*.516,c=g-d,r=Math.cos(y+kn)*c,f=Math.cos(y+kn)*(s?s/2-d:c),l=Math.sin(y+kn)*c,h=Math.sin(y+kn)*(s?s/2-d:c),t.arc(n-f,i-l,d,y-Se,y-Me),t.arc(n+h,i-r,d,y-Me,y),t.arc(n+f,i+l,d,y,y+Me),t.arc(n-h,i+r,d,y+Me,y+Se),t.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=s?s/2:c,t.rect(n-u,i-c,2*u,2*c);break}y+=kn;case"rectRot":f=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+h,i-r),t.lineTo(n+f,i+l),t.lineTo(n-h,i+r),t.closePath();break;case"crossRot":y+=kn;case"cross":f=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-r),t.lineTo(n-h,i+r);break;case"star":f=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-r),t.lineTo(n-h,i+r),y+=kn,f=Math.cos(y)*(s?s/2:g),r=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-r),t.lineTo(n-h,i+r);break;case"line":r=s?s/2:Math.cos(y)*g,l=Math.sin(y)*g,t.moveTo(n-r,i-l),t.lineTo(n+r,i+l);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function Ut(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 Us(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ws(t){t.restore()}function rS(t,e,n,i,s){if(!e)return t.lineTo(n.x,n.y);if(s==="middle"){const o=(e.x+n.x)/2;t.lineTo(o,e.y),t.lineTo(o,n.y)}else s==="after"!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function aS(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function lS(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),fe(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 cS(t,e,n,i,s){if(s.strikethrough||s.underline){const o=t.measureText(i),r=e-o.actualBoundingBoxLeft,l=e+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,d=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,u),t.lineTo(l,u),t.stroke()}}function dS(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function En(t,e,n,i,s,o={}){const r=Oe(e)?e:[e],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(t.save(),t.font=s.string,lS(t,o),c=0;c<r.length;++c)d=r[c],o.backdrop&&dS(t,o.backdrop),l&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),fe(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,n,i,o.maxWidth)),t.fillText(d,n,i,o.maxWidth),cS(t,n,i,d,o),i+=Number(s.lineHeight);t.restore()}function Vi(t,e){const{x:n,y:i,w:s,h:o,radius:r}=e;t.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*Se,Se,!0),t.lineTo(n,i+o-r.bottomLeft),t.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,Se,Me,!0),t.lineTo(n+s-r.bottomRight,i+o),t.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Me,0,!0),t.lineTo(n+s,i+r.topRight),t.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Me,!0),t.lineTo(n+r.topLeft,i)}const uS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function hS(t,e){const n=(""+t).match(uS);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 mS=t=>+t||0;function Sr(t,e){const n={},i=de(e),s=i?Object.keys(e):e,o=de(t)?i?r=>ae(t[r],t[e[r]]):r=>t[r]:()=>t;for(const r of s)n[r]=mS(o(r));return n}function ud(t){return Sr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Cn(t){return Sr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function He(t){const e=ud(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $e(t,e){t=t||{},e=e||Ee.font;let n=ae(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let i=ae(t.style,e.style);i&&!(""+i).match(fS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:ae(t.family,e.family),lineHeight:hS(ae(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:ae(t.weight,e.weight),string:""};return s.string=sS(s),s}function Ri(t,e,n,i){let s,o,r;for(s=0,o=t.length;s<o;++s)if(r=t[s],r!==void 0&&r!==void 0)return r}function pS(t,e,n){const{min:i,max:s}=t,o=zc(e,(s-i)/2),r=(l,c)=>n&&l===0?0:l+c;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function an(t,e){return Object.assign(Object.create(t),e)}function wr(t,e=[""],n,i,s=()=>t[0]){const o=n||t;typeof i>"u"&&(i=gd("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:s,override:l=>wr([l,...t],e,o,i)};return new Proxy(r,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return hd(l,c,()=>wS(c,e,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return yd(l).includes(c)},ownKeys(l){return yd(l)},set(l,c,d){const u=l._storage||(l._storage=s());return l[c]=u[c]=d,delete l._keys,!0}})}function Wn(t,e,n,i){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:fd(t,i),setContext:o=>Wn(t,o,n,i),override:o=>Wn(t.override(o),e,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete t[r],!0},get(o,r,l){return hd(o,r,()=>yS(o,r,l))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(t,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,r)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,r){return Reflect.has(t,r)},ownKeys(){return Reflect.ownKeys(t)},set(o,r,l){return t[r]=l,delete o[r],!0}})}function fd(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:i,isScriptable:on(n)?n:()=>n,isIndexable:on(i)?i:()=>i}}const gS=(t,e)=>t?t+fr(e):e,Er=(t,e)=>de(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function hd(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const i=n();return t[e]=i,i}function yS(t,e,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=t;let l=i[e];return on(l)&&r.isScriptable(e)&&(l=bS(e,l,t,n)),Oe(l)&&l.length&&(l=xS(e,l,t,r.isIndexable)),Er(e,l)&&(l=Wn(l,s,o&&o[e],r)),l}function bS(t,e,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:l}=n;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=e(o,r||i);return l.delete(t),Er(t,c)&&(c=Cr(s._scopes,s,t,c)),c}function xS(t,e,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:l}=n;if(typeof o.index<"u"&&i(t))return e[o.index%e.length];if(de(e[0])){const c=e,d=s._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=Cr(d,s,t,u);e.push(Wn(f,o,r&&r[t],l))}}return e}function md(t,e,n){return on(t)?t(e,n):t}const _S=(t,e)=>t===!0?e:typeof t=="string"?sn(e,t):void 0;function kS(t,e,n,i,s){for(const o of e){const r=_S(n,o);if(r){t.add(r);const l=md(r._fallback,n,s);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function Cr(t,e,n,i){const s=e._rootScopes,o=md(e._fallback,n,i),r=[...t,...s],l=new Set;l.add(i);let c=pd(l,r,n,o||n,i);return c===null||typeof o<"u"&&o!==n&&(c=pd(l,r,o,c,i),c===null)?!1:wr(Array.from(l),[""],s,o,()=>SS(e,n,i))}function pd(t,e,n,i,s){for(;n;)n=kS(t,e,n,i,s);return n}function SS(t,e,n){const i=t._getTarget();e in i||(i[e]={});const s=i[e];return Oe(s)&&de(n)?n:s||{}}function wS(t,e,n,i){let s;for(const o of e)if(s=gd(gS(o,t),n),typeof s<"u")return Er(t,s)?Cr(n,i,t,s):s}function gd(t,e){for(const n of e){if(!n)continue;const i=n[t];if(typeof i<"u")return i}}function yd(t){let e=t._keys;return e||(e=t._keys=ES(t._scopes)),e}function ES(t){const e=new Set;for(const n of t)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function bd(t,e,n,i){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(i);let l,c,d,u;for(l=0,c=i;l<c;++l)d=l+n,u=e[d],r[l]={r:s.parse(sn(u,o),d)};return r}const CS=Number.EPSILON||1e-14,Hn=(t,e)=>e<t.length&&!t[e].skip&&t[e],xd=t=>t==="x"?"y":"x";function OS(t,e,n,i){const s=t.skip?e:t,o=e,r=n.skip?e:n,l=mr(o,s),c=mr(r,o);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=i*d,h=i*u;return{previous:{x:o.x-f*(r.x-s.x),y:o.y-f*(r.y-s.y)},next:{x:o.x+h*(r.x-s.x),y:o.y+h*(r.y-s.y)}}}function vS(t,e,n){const i=t.length;let s,o,r,l,c,d=Hn(t,0);for(let u=0;u<i-1;++u)if(c=d,d=Hn(t,u+1),!(!c||!d)){if(Di(e[u],0,CS)){n[u]=n[u+1]=0;continue}s=n[u]/e[u],o=n[u+1]/e[u],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(r=3/Math.sqrt(l),n[u]=s*r*e[u],n[u+1]=o*r*e[u])}}function NS(t,e,n="x"){const i=xd(n),s=t.length;let o,r,l,c=Hn(t,0);for(let d=0;d<s;++d){if(r=l,l=c,c=Hn(t,d+1),!l)continue;const u=l[n],f=l[i];r&&(o=(u-r[n])/3,l[`cp1${n}`]=u-o,l[`cp1${i}`]=f-o*e[d]),c&&(o=(c[n]-u)/3,l[`cp2${n}`]=u+o,l[`cp2${i}`]=f+o*e[d])}}function DS(t,e="x"){const n=xd(e),i=t.length,s=Array(i).fill(0),o=Array(i);let r,l,c,d=Hn(t,0);for(r=0;r<i;++r)if(l=c,c=d,d=Hn(t,r+1),!!c){if(d){const u=d[e]-c[e];s[r]=u!==0?(d[n]-c[n])/u:0}o[r]=l?d?Ot(s[r-1])!==Ot(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}vS(t,s,o),NS(t,o,e)}function Hs(t,e,n){return Math.max(Math.min(t,n),e)}function TS(t,e){let n,i,s,o,r,l=Ut(t[0],e);for(n=0,i=t.length;n<i;++n)r=o,o=l,l=n<i-1&&Ut(t[n+1],e),o&&(s=t[n],r&&(s.cp1x=Hs(s.cp1x,e.left,e.right),s.cp1y=Hs(s.cp1y,e.top,e.bottom)),l&&(s.cp2x=Hs(s.cp2x,e.left,e.right),s.cp2y=Hs(s.cp2y,e.top,e.bottom)))}function BS(t,e,n,i,s){let o,r,l,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")DS(t,s);else{let d=i?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)l=t[o],c=OS(d,l,t[Math.min(o+1,r-(i?0:1))%r],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&TS(t,n)}function Or(){return typeof window<"u"&&typeof document<"u"}function vr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function qs(t,e,n){let i;return typeof t=="string"?(i=parseInt(t,10),t.indexOf("%")!==-1&&(i=i/100*e.parentNode[n])):i=t,i}const Ys=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function PS(t,e){return Ys(t).getPropertyValue(e)}const AS=["top","right","bottom","left"];function On(t,e,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=AS[s];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const MS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function VS(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:s,offsetY:o}=i;let r=!1,l,c;if(MS(s,o,t.target))l=s,c=o;else{const d=e.getBoundingClientRect();l=i.clientX-d.left,c=i.clientY-d.top,r=!0}return{x:l,y:c,box:r}}function vn(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,s=Ys(n),o=s.boxSizing==="border-box",r=On(s,"padding"),l=On(s,"border","width"),{x:c,y:d,box:u}=VS(t,n),f=r.left+(u&&l.left),h=r.top+(u&&l.top);let{width:m,height:p}=e;return o&&(m-=r.width+l.width,p-=r.height+l.height),{x:Math.round((c-f)/m*n.width/i),y:Math.round((d-h)/p*n.height/i)}}function RS(t,e,n){let i,s;if(e===void 0||n===void 0){const o=t&&vr(t);if(!o)e=t.clientWidth,n=t.clientHeight;else{const r=o.getBoundingClientRect(),l=Ys(o),c=On(l,"border","width"),d=On(l,"padding");e=r.width-d.width-c.width,n=r.height-d.height-c.height,i=qs(l.maxWidth,o,"clientWidth"),s=qs(l.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:i||Is,maxHeight:s||Is}}const Ks=t=>Math.round(t*10)/10;function FS(t,e,n,i){const s=Ys(t),o=On(s,"margin"),r=qs(s.maxWidth,t,"clientWidth")||Is,l=qs(s.maxHeight,t,"clientHeight")||Is,c=RS(t,e,n);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const h=On(s,"border","width"),m=On(s,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-o.width),u=Math.max(0,i?d/i:u-o.height),d=Ks(Math.min(d,r,c.maxWidth)),u=Ks(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Ks(d/2)),(e!==void 0||n!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,d=Ks(Math.floor(u*i))),{width:d,height:u}}function _d(t,e,n){const i=e||1,s=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(t.currentDevicePixelRatio=i,r.height=s,r.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $S=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Or()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function kd(t,e){const n=PS(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Nn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function LS(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:i==="middle"?n<.5?t.y:e.y:i==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function IS(t,e,n,i){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Nn(t,s,n),l=Nn(s,o,n),c=Nn(o,e,n),d=Nn(r,l,n),u=Nn(l,c,n);return Nn(d,u,n)}const jS=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,i){return n-i},leftForLtr(n,i){return n-i}}},zS=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function qn(t,e,n){return t?jS(e,n):zS()}function Sd(t,e){let n,i;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function wd(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ed(t){return t==="angle"?{between:Ti,compare:Uk,normalize:it}:{between:jt,compare:(e,n)=>e-n,normalize:e=>e}}function Cd({start:t,end:e,count:n,loop:i,style:s}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n===0,style:s}}function US(t,e,n){const{property:i,start:s,end:o}=n,{between:r,normalize:l}=Ed(i),c=e.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&r(l(e[d%c][i]),s,o);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Od(t,e,n){if(!n)return[t];const{property:i,start:s,end:o}=n,r=e.length,{compare:l,between:c,normalize:d}=Ed(i),{start:u,end:f,loop:h,style:m}=US(t,e,n),p=[];let g=!1,y=null,b,x,w;const E=()=>c(s,w,b)&&l(s,w)!==0,k=()=>l(o,b)===0||c(o,w,b),C=()=>g||E(),S=()=>!g||k();for(let _=u,O=u;_<=f;++_)x=e[_%r],!x.skip&&(b=d(x[i]),b!==w&&(g=c(b,s,o),y===null&&C()&&(y=l(b,s)===0?_:O),y!==null&&S()&&(p.push(Cd({start:y,end:_,loop:h,count:r,style:m})),y=null),O=_,w=b));return y!==null&&p.push(Cd({start:y,end:f,loop:h,count:r,style:m})),p}function vd(t,e){const n=[],i=t.segments;for(let s=0;s<i.length;s++){const o=Od(i[s],t.points,e);o.length&&n.push(...o)}return n}function WS(t,e,n,i){let s=0,o=e-1;if(n&&!i)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,n&&(o+=s);o>s&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}function HS(t,e,n,i){const s=t.length,o=[];let r=e,l=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%s];d.skip||d.stop?l.skip||(i=!1,o.push({start:e%s,end:(c-1)%s,loop:i}),e=r=d.stop?c:null):(r=c,l.skip&&(e=c)),l=d}return r!==null&&o.push({start:e%s,end:r%s,loop:i}),o}function qS(t,e){const n=t.points,i=t.options.spanGaps,s=n.length;if(!s)return[];const o=!!t._loop,{start:r,end:l}=WS(n,s,o,i);if(i===!0)return Nd(t,[{start:r,end:l,loop:o}],n,e);const c=l<r?l+s:l,d=!!t._fullLoop&&r===0&&l===s-1;return Nd(t,HS(n,r,c,d),n,e)}function Nd(t,e,n,i){return!i||!i.setContext||!n?e:YS(t,e,n,i)}function YS(t,e,n,i){const s=t._chart.getContext(),o=Dd(t.options),{_datasetIndex:r,options:{spanGaps:l}}=t,c=n.length,d=[];let u=o,f=e[0].start,h=f;function m(p,g,y,b){const x=l?-1:1;if(p!==g){for(p+=c;n[p%c].skip;)p-=x;for(;n[g%c].skip;)g+=x;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:b}),u=b,f=g%c)}}for(const p of e){f=l?f:p.start;let g=n[f%c],y;for(h=f+1;h<=p.end;h++){const b=n[h%c];y=Dd(i.setContext(an(s,{type:"segment",p0:g,p1:b,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:r}))),KS(y,u)&&m(f,h-1,p.loop,u),g=b,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function Dd(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function KS(t,e){if(!e)return!1;const n=[],i=function(s,o){return yr(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(t,i)!==JSON.stringify(e,i)}/*!
|
|
171
176
|
* Chart.js v4.4.7
|
|
172
177
|
* https://www.chartjs.org
|
|
173
178
|
* (c) 2024 Chart.js Contributors
|
|
174
179
|
* Released under the MIT License
|
|
175
|
-
*/class Ex{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const o=t.listeners[s],a=t.duration;o.forEach(l=>l({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(i-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Dl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),l=!0):(o[a]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,i,e,"progress")),o.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=o.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bt=new Ex;const ic="transparent",Cx={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Ml(n||ic),s=i.valid&&Ml(e||ic);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class sc{constructor(e,t,i,s){const o=t[i];s=xi([e.to,s,o,e.from]);const a=xi([e.from,o,s]);this._active=!0,this._fn=e.fn||Cx[e.type||typeof a],this._easing=mi[e.easing]||mi.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=xi([e.to,t,s,e.from]),this._from=xi([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||t<i),!this._active){this._target[s]=l,this._notify(!0);return}if(t<0){this._target[s]=o;return}c=t/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}class Ro{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!le(e))return;const t=Object.keys(we.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!le(o))return;const a={};for(const l of t)a[l]=o[l];(Ce(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!i.has(l))&&i.set(l,a)})})}_animateOptions(e,t){const i=t.options,s=Dx(e,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&vx(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,t){const i=this._properties,s=[],o=e.$animations||(e.$animations={}),a=Object.keys(t),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,t));continue}const u=t[d];let f=o[d];const h=i.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){e[d]=u;continue}o[d]=f=new sc(h,e,d,u),s.push(f)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return bt.add(this._chart,i),!0}}function vx(n,e){const t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function Dx(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function oc(n,e){const t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,o=t.max===void 0?e:0;return{start:i?o:s,end:i?s:o}}function Nx(n,e,t){if(t===!1)return!1;const i=oc(n,t),s=oc(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Ox(n){let e,t,i,s;return le(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function rc(n,e){const t=[],i=n._getSortedDatasetMetas(e);let s,o;for(s=0,o=i.length;s<o;++s)t.push(i[s].index);return t}function ac(n,e,t,i={}){const s=n.keys,o=i.mode==="single";let a,l,c,d;if(e===null)return;let u=!1;for(a=0,l=s.length;a<l;++a){if(c=+s[a],c===t){if(u=!0,i.all)continue;break}d=n.values[c],Ne(d)&&(o||e===0||yt(e)===yt(d))&&(e+=d)}return!u&&!i.all?0:e}function Tx(n,e){const{iScale:t,vScale:i}=e,s=t.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let c,d,u;for(c=0,d=a.length;c<d;++c)u=a[c],l[c]={[s]:u,[o]:n[u]};return l}function jo(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function Px(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function Bx(n){const{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function Mx(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function lc(n,e,t,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(t&&o>0||!t&&o<0)return s.index}return null}function cc(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:o,vScale:a,index:l}=i,c=o.axis,d=a.axis,u=Px(o,a,i),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[c]:g,[d]:y}=p,b=p._stacks||(p._stacks={});h=b[d]=Mx(s,u,g),h[l]=y,h._top=lc(h,a,!0,i.type),h._bottom=lc(h,a,!1,i.type);const _=h._visualValues||(h._visualValues={});_[l]=y}}function zo(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Vx(n,e){return Qt(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Ax(n,e,t){return Qt(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function _i(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const o=s._stacks;if(!o||o[i]===void 0||o[i][t]===void 0)return;delete o[i][t],o[i]._visualValues!==void 0&&o[i]._visualValues[t]!==void 0&&delete o[i]._visualValues[t]}}}const Wo=n=>n==="reset"||n==="none",dc=(n,e)=>e?n:Object.assign({},n),Fx=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:rc(t,!0),values:null};class nt{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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=jo(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&&_i(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,o=t.xAxisID=oe(i.xAxisID,zo(e,"x")),a=t.yAxisID=oe(i.yAxisID,zo(e,"y")),l=t.rAxisID=oe(i.rAxisID,zo(e,"r")),c=t.indexAxis,d=t.iAxisID=s(c,o,a,l),u=t.vAxisID=s(c,a,o,l);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(l),t.iScale=this.getScaleForId(d),t.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 t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Cl(this._data,this),e._stacked&&_i(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(le(t)){const s=this._cachedMeta;this._data=Tx(t,s)}else if(i!==t){if(i){Cl(i,this);const s=this._cachedMeta;_i(s),s._parsed=[]}t&&Object.isExtensible(t)&&S0(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=t._stacked;t._stacked=jo(t.vScale,t),t.stack!==i.stack&&(s=!0,_i(t),t.stack=i.stack),this._resyncElements(e),(s||o!==t._stacked)&&(cc(this,t._parsed),t._stacked=jo(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,l=o.axis;let c=e===0&&t===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],u,f,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ce(s[e])?h=this.parseArrayData(i,s,e,t):le(s[e])?h=this.parseObjectData(i,s,e,t):h=this.parsePrimitiveData(i,s,e,t);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<t;++u)i._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);i._sorted=c}a&&cc(this,h)}parsePrimitiveData(e,t,i,s){const{iScale:o,vScale:a}=e,l=o.axis,c=a.axis,d=o.getLabels(),u=o===a,f=new Array(s);let h,m,p;for(h=0,m=s;h<m;++h)p=h+i,f[h]={[l]:u||o.parse(d[p],p),[c]:a.parse(t[p],p)};return f}parseArrayData(e,t,i,s){const{xScale:o,yScale:a}=e,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=t[u],l[c]={x:o.parse(f[0],u),y:a.parse(f[1],u)};return l}parseObjectData(e,t,i,s){const{xScale:o,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,f,h,m;for(u=0,f=s;u<f;++u)h=u+i,m=t[h],d[u]={x:o.parse(Kt(m,l),h),y:a.parse(Kt(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,o=this._cachedMeta,a=t[e.axis],l={keys:rc(s,!0),values:t._stacks[e.axis]._visualValues};return ac(l,a,o.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const o=i[t.axis];let a=o===null?NaN:o;const l=s&&i._stacks[t.axis];s&&l&&(s.values=l,a=ac(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&e===i.iScale,a=s.length,l=this._getOtherScale(e),c=Fx(t,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Bx(l);let h,m;function p(){m=s[h];const g=m[l.axis];return!Ne(m[e.axis])||u>g||f<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=t.length;s<o;++s)a=t[s][e.axis],Ne(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=Ox(oe(this.options.clip,Nx(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],o=t.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(e,o,l,c),u=l;u<l+c;++u){const f=s[u];f.hidden||(f.active&&d?a.push(f):f.draw(e,o))}for(u=0;u<a.length;++u)a[u].draw(e,o)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];o=a.$context||(a.$context=Ax(this.getContext(),e,a)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=Vx(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s=t==="active",o=this._cachedDataOpts,a=e+"-"+t,l=o[a],c=this.enableOptionSharing&&ui(i);if(l)return dc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(we.elements[e]),p=()=>this.getContext(i,s,t),g=d.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(dc(g,c))),g}_resolveAnimations(e,t,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${t}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,t),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,i,t))}const d=new Ro(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||Wo(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(t,o)||o!==s;return this.updateSharedOptions(o,t,i),{sharedOptions:o,includeOptions:a}}updateElement(e,t,i,s){Wo(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!Wo(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const o=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"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 t=this._data,i=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=i.length,o=t.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,t,i=!0){const s=this._cachedMeta,o=s.data,a=e+t;let l;const c=d=>{for(d.length+=t,l=d.length-1;l>=a;l--)d[l]=d[l-t]};for(c(o),l=e;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,t),i&&this.updateElements(o,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&_i(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}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,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}z(nt,"defaults",{}),z(nt,"datasetElementType",null),z(nt,"dataElementType",null);function $x(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let s=0,o=t.length;s<o;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=vl(i.sort((s,o)=>s-o))}return n._cache.$bar}function Ix(n){const e=n.iScale,t=$x(e,n.type);let i=e._length,s,o,a,l;const c=()=>{a===32767||a===-32768||(ui(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(s=0,o=t.length;s<o;++s)a=e.getPixelForValue(t[s]),c();for(l=void 0,s=0,o=e.ticks.length;s<o;++s)a=e.getPixelForTick(s),c();return i}function Lx(n,e,t,i){const s=t.barThickness;let o,a;return de(s)?(o=e.min*t.categoryPercentage,a=t.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[n]-o/2}}function Rx(n,e,t,i){const s=e.pixels,o=s[n];let a=n>0?s[n-1]:null,l=n<s.length-1?s[n+1]:null;const c=t.categoryPercentage;a===null&&(a=o-(l===null?e.end-e.start:l-o)),l===null&&(l=o+o-a);const d=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/i,ratio:t.barPercentage,start:d}}function jx(n,e,t,i){const s=t.parse(n[0],i),o=t.parse(n[1],i),a=Math.min(s,o),l=Math.max(s,o);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),e[t.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:o,min:a,max:l}}function uc(n,e,t,i){return Ce(n)?jx(n,e,t,i):e[t.axis]=t.parse(n,i),e}function fc(n,e,t,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),l=s===o,c=[];let d,u,f,h;for(d=t,u=t+i;d<u;++d)h=e[d],f={},f[s.axis]=l||s.parse(a[d],d),c.push(uc(h,f,o,d));return c}function Ho(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function zx(n,e,t){return n!==0?yt(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Wx(n){let e,t,i,s,o;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",o="start"):(s="start",o="end"),{start:t,end:i,reverse:e,top:s,bottom:o}}function Hx(n,e,t,i){let s=e.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:u}=Wx(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=d:(t._bottom||0)===i?s=u:(o[hc(u,a,l,c)]=!0,s=d)),o[hc(s,a,l,c)]=!0,n.borderSkipped=o}function hc(n,e,t,i){return i?(n=Ux(n,e,t),n=mc(n,t,e)):n=mc(n,e,t),n}function Ux(n,e,t){return n===e?t:n===t?e:n}function mc(n,e,t){return n==="start"?e:n==="end"?t:n}function qx(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class ki extends nt{parsePrimitiveData(e,t,i,s){return fc(e,t,i,s)}parseArrayData(e,t,i,s){return fc(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:o,vScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,u=a.axis==="x"?l:c,f=[];let h,m,p,g;for(h=i,m=i+s;h<m;++h)g=t[h],p={},p[o.axis]=o.parse(Kt(g,d),h),f.push(uc(Kt(g,u),p,a,h));return f}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const o=i._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,o=this.getParsed(e),a=o._custom,l=Ho(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(t,s);for(let m=t;m<t+i;m++){const p=this.getParsed(m),g=o||de(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),b=(p._stacks||{})[l.axis],_={horizontal:d,base:g.base,enableBorderRadius:!b||Ho(p._custom)||a===b._top||a===b._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};h&&(_.options=f||this.resolveDataElementOptions(m,e[m].active?"active":s));const w=_.options||e[m].options;Hx(_,w,b,a),qx(_,w,u.ratio),this.updateElement(e[m],m,_,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(t),c=l&&l[i.axis],d=u=>{const f=u._parsed.find(m=>m[i.axis]===c),h=f&&f[u.vScale.axis];if(de(h)||isNaN(h))return!0};for(const u of s)if(!(t!==void 0&&d(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),o=t!==void 0?s.indexOf(t):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let o,a;for(o=0,a=t.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const l=e.barThickness;return{min:l||Ix(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(e),d=c._custom,u=Ho(d);let f=c[t.axis],h=0,m=i?this.applyStack(t,c,i):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&yt(f)!==yt(d.barEnd)&&(h=0),h+=f);const y=!de(o)&&!u?o:h;let b=t.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=t.getPixelForValue(h+m):p=b,g=p-b,Math.abs(g)<a){g=zx(g,t,l)*a,f===l&&(b-=g/2);const _=t.getPixelForDecimal(0),w=t.getPixelForDecimal(1),E=Math.min(_,w),k=Math.max(_,w);b=Math.max(Math.min(b,k),E),p=b+g,i&&!u&&(c._stacks[t.axis]._visualValues[s]=t.getValueForPixel(p)-t.getValueForPixel(b))}if(b===t.getPixelForValue(l)){const _=yt(g)*t.getLineWidthForValue(l)/2;b+=_,g-=_}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,o=s.skipNull,a=oe(s.maxBarThickness,1/0);let l,c;if(t.grouped){const d=o?this._getStackCount(e):t.stackCount,u=s.barThickness==="flex"?Rx(e,t,s,d):Lx(e,t,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);l=u.start+u.chunk*f+u.chunk/2,c=Math.min(a,u.chunk*u.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(a,t.min*t.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[t.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}z(ki,"id","bar"),z(ki,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z(ki,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Si extends nt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){const o=super.parsePrimitiveData(e,t,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(e,t,i,s){const o=super.parseArrayData(e,t,i,s);for(let a=0;a<o.length;a++){const l=t[i+a];o[a]._custom=oe(l[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(e,t,i,s){const o=super.parseObjectData(e,t,i,s);for(let a=0;a<o.length;a++){const l=t[i+a];o[a]._custom=oe(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=t,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),d=a._custom;return{label:i[e]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s),u=a.axis,f=l.axis;for(let h=t;h<t+i;h++){const m=e[h],p=!o&&this.getParsed(h),g={},y=g[u]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),b=g[f]=o?l.getBasePixel():l.getPixelForValue(p[f]);g.skip=isNaN(y)||isNaN(b),d&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return t!=="active"&&(s.radius=0),s.radius+=oe(i&&i._custom,o),s}}z(Si,"id","bubble"),z(Si,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Si,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Yx(n,e,t){let i=1,s=1,o=0,a=0;if(e<Se){const l=n,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,E,k)=>hi(w,l,c,!0)?1:Math.max(E,E*t,k,k*t),p=(w,E,k)=>hi(w,l,c,!0)?-1:Math.min(E,E*t,k,k*t),g=m(0,d,f),y=m(Te,u,h),b=p(ke,d,f),_=p(ke+Te,u,h);i=(g-b)/2,s=(y-_)/2,o=-(g+b)/2,a=-(y+_)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class Jt extends nt{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(le(i[e])){const{key:c="value"}=this._parsing;o=d=>+Kt(i[d],c)}let a,l;for(a=e,l=e+t;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return dt(this.options.rotation-90)}_getCircumference(){return dt(this.options.circumference)}_getRotationExtents(){let e=Se,t=-Se;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._getCircumference();e=Math.min(e,o),t=Math.max(t,o+a)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),c=Math.min(l0(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=Yx(f,u,c),y=(i.width-a)/h,b=(i.height-a)/m,_=Math.max(Math.min(y,b)/2,0),w=pl(this.options.radius,_),E=Math.max(w*c,0),k=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/Se)}updateElements(e,t,i,s){const o=s==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=o&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(t,s);let b=this._getRotation(),_;for(_=0;_<t;++_)b+=this._circumference(_,o);for(_=t;_<t+i;++_){const w=this._circumference(_,o),E=e[_],k={x:u+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:m};y&&(k.options=g||this.resolveDataElementOptions(_,E.active?"active":s)),b+=w,this.updateElement(E,_,k,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?Se*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=pi(t._parsed[e],i.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,o,a,l,c;if(!e){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),e=a.data,l=a.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(t=Math.max(t,c.borderWidth||0,c.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const o=this.resolveDataElementOptions(i);t=Math.max(t,o.offset||0,o.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(oe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(Jt,"id","doughnut"),z(Jt,"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"}),z(Jt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),z(Jt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return t.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}}});class wi extends nt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=t,a=this.chart._animationsDisabled;let{start:l,count:c}=Ol(t,s,a);this._drawStart=l,this._drawCount=c,Tl(t)&&(l=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},e),this.updateElements(s,l,c,e)}updateElements(e,t,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(t,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=Tn(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",_=t+i,w=e.length;let E=t>0&&this.getParsed(t-1);for(let k=0;k<w;++k){const C=e[k],S=b?C:{};if(k<t||k>=_){S.skip=!0;continue}const x=this.getParsed(k),v=de(x[m]),B=S[h]=a.getPixelForValue(x[h],k),D=S[m]=o||v?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,x,c):x[m],k);S.skip=isNaN(B)||isNaN(D)||v,S.stop=k>0&&Math.abs(x[h]-E[h])>y,g&&(S.parsed=x,S.raw=d.data[k]),f&&(S.options=u||this.resolveDataElementOptions(k,C.active?"active":s)),b||this.updateElement(C,k,S,s),E=x}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}z(wi,"id","line"),z(wi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(wi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Vn extends nt{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=pi(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:o}}parseObjectData(e,t,i,s){return Ul.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<t.min&&(t.min=o),o>t.max&&(t.max=o))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-a)/e.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,t,i,s){const o=s==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,h=d.getIndexAngle(0)-.5*ke;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<t;++p)m+=this._computeAngle(p,s,g);for(p=t;p<t+i;p++){const y=e[p];let b=m,_=m+this._computeAngle(p,s,g),w=a.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=_,o&&(c.animateScale&&(w=0),c.animateRotate&&(b=_=h));const E={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,E,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?dt(this.resolveDataElementOptions(e,t).angle||i):0}}z(Vn,"id","polarArea"),z(Vn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Vn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return t.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ks extends Jt{}z(ks,"id","pie"),z(ks,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ei extends nt{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return Ul.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],o=t.iScale.getLabels();if(i.points=s,e!=="resize"){const a=this.resolveDatasetElementOptions(e);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,l,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let l=t;l<t+i;l++){const c=e[l],d=this.resolveDataElementOptions(l,c.active?"active":s),u=o.getPointPositionForValue(l,this.getParsed(l).r),f=a?o.xCenter:u.x,h=a?o.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:d};this.updateElement(c,l,m,s)}}}z(Ei,"id","radar"),z(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(Ei,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ci extends nt{getLabelAndValue(e){const t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=t,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:i[e]||"",value:"("+l+", "+c+")"}}update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:o,count:a}=Ol(t,i,s);if(this._drawStart=o,this._drawCount=a,Tl(t)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=t;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=i;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:d},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(t,s),f=this.getSharedOptions(u),h=this.includeOptions(s,f),m=a.axis,p=l.axis,{spanGaps:g,segment:y}=this.options,b=Tn(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none";let w=t>0&&this.getParsed(t-1);for(let E=t;E<t+i;++E){const k=e[E],C=this.getParsed(E),S=_?k:{},x=de(C[p]),v=S[m]=a.getPixelForValue(C[m],E),B=S[p]=o||x?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],E);S.skip=isNaN(v)||isNaN(B)||x,S.stop=E>0&&Math.abs(C[m]-w[m])>b,y&&(S.parsed=C,S.raw=d.data[E]),h&&(S.options=f||this.resolveDataElementOptions(E,k.active?"active":s)),_||this.updateElement(k,E,S,s),w=C}this.updateSharedOptions(f,s,u)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let l=0;for(let c=t.length-1;c>=0;--c)l=Math.max(l,t[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const o=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,o,a)/2}}z(Ci,"id","scatter"),z(Ci,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(Ci,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var pc=Object.freeze({__proto__:null,BarController:ki,BubbleController:Si,DoughnutController:Jt,LineController:wi,PieController:ks,PolarAreaController:Vn,RadarController:Ei,ScatterController:Ci});function bn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uo{constructor(e){z(this,"options");this.options=e||{}}static override(e){Object.assign(Uo.prototype,e)}init(){}formats(){return bn()}parse(){return bn()}format(){return bn()}add(){return bn()}diff(){return bn()}startOf(){return bn()}endOf(){return bn()}}var gc={_date:Uo};function Kx(n,e,t,i){const{controller:s,data:o,_sorted:a}=n,l=s._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&o.length){const c=l._reversePixels?_0:Mt;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,t-u),h=c(o,e,t+u);return{lo:f.lo,hi:h.hi}}}}else return c(o,e,t)}return{lo:0,hi:o.length-1}}function vi(n,e,t,i,s){const o=n.getSortedVisibleDatasetMetas(),a=t[e];for(let l=0,c=o.length;l<c;++l){const{index:d,data:u}=o[l],{lo:f,hi:h}=Kx(o[l],e,a,s);for(let m=f;m<=h;++m){const p=u[m];p.skip||i(p,d,m)}}}function Xx(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const o=e?Math.abs(i.x-s.x):0,a=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function qo(n,e,t,i,s){const o=[];return!s&&!n.isPointInArea(e)||vi(n,t,e,function(l,c,d){!s&&!Vt(l,n.chartArea,0)||l.inRange(e.x,e.y,i)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function Gx(n,e,t,i){let s=[];function o(a,l,c){const{startAngle:d,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:f}=wl(a,{x:e.x,y:e.y});hi(f,d,u)&&s.push({element:a,datasetIndex:l,index:c})}return vi(n,t,e,o),s}function Qx(n,e,t,i,s,o){let a=[];const l=Xx(t);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!m)return;const y=l(e,p);y<c?(a=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&a.push({element:u,datasetIndex:f,index:h})}return vi(n,t,e,d),a}function Yo(n,e,t,i,s,o){return!o&&!n.isPointInArea(e)?[]:t==="r"&&!i?Gx(n,e,t,s):Qx(n,e,t,i,s,o)}function yc(n,e,t,i,s){const o=[],a=t==="x"?"inXRange":"inYRange";let l=!1;return vi(n,t,e,(c,d,u)=>{c[a]&&c[a](e[t],s)&&(o.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,s))}),i&&!l?[]:o}var bc={evaluateInteractionItems:vi,modes:{index(n,e,t,i){const s=gn(e,n),o=t.axis||"x",a=t.includeInvisible||!1,l=t.intersect?qo(n,s,o,i,a):Yo(n,s,o,!1,i,a),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(n,e,t,i){const s=gn(e,n),o=t.axis||"xy",a=t.includeInvisible||!1;let l=t.intersect?qo(n,s,o,i,a):Yo(n,s,o,!1,i,a);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(n,e,t,i){const s=gn(e,n),o=t.axis||"xy",a=t.includeInvisible||!1;return qo(n,s,o,i,a)},nearest(n,e,t,i){const s=gn(e,n),o=t.axis||"xy",a=t.includeInvisible||!1;return Yo(n,s,o,t.intersect,i,a)},x(n,e,t,i){const s=gn(e,n);return yc(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=gn(e,n);return yc(n,s,"y",t.intersect,i)}}};const xc=["left","top","right","bottom"];function Di(n,e){return n.filter(t=>t.pos===e)}function _c(n,e){return n.filter(t=>xc.indexOf(t.pos)===-1&&t.box.axis===e)}function Ni(n,e){return n.sort((t,i)=>{const s=e?i:t,o=e?t:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Jx(n){const e=[];let t,i,s,o,a,l;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:o,options:{stack:a,stackWeight:l=1}}=s,e.push({index:t,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:l});return e}function Zx(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:o}=t;if(!i||!xc.includes(s))continue;const a=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function e_(n,e){const t=Zx(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let o,a,l;for(o=0,a=n.length;o<a;++o){l=n[o];const{fullSize:c}=l.box,d=t[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*i:c&&e.availableWidth,l.height=s):(l.width=i,l.height=u?u*s:c&&e.availableHeight)}return t}function t_(n){const e=Jx(n),t=Ni(e.filter(d=>d.box.fullSize),!0),i=Ni(Di(e,"left"),!0),s=Ni(Di(e,"right")),o=Ni(Di(e,"top"),!0),a=Ni(Di(e,"bottom")),l=_c(e,"x"),c=_c(e,"y");return{fullSize:t,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(a).concat(l),chartArea:Di(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(a).concat(l)}}function kc(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Sc(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function n_(n,e,t,i){const{pos:s,box:o}=t,a=n.maxPadding;if(!le(s)){t.size&&(n[s]-=t.size);const f=i[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?o.height:o.width),t.size=f.size/f.count,n[s]+=t.size}o.getPadding&&Sc(a,o.getPadding());const l=Math.max(0,e.outerWidth-kc(a,n,"left","right")),c=Math.max(0,e.outerHeight-kc(a,n,"top","bottom")),d=l!==n.w,u=c!==n.h;return n.w=l,n.h=c,t.horizontal?{same:d,other:u}:{same:u,other:d}}function i_(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function s_(n,e){const t=e.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(e[a],t[a])}),o}return i(n?["left","right"]:["top","bottom"])}function Oi(n,e,t,i){const s=[];let o,a,l,c,d,u;for(o=0,a=n.length,d=0;o<a;++o){l=n[o],c=l.box,c.update(l.width||e.w,l.height||e.h,s_(l.horizontal,e));const{same:f,other:h}=n_(e,t,l,i);d|=f&&s.length,u=u||h,c.fullSize||s.push(l)}return d&&Oi(s,e,t,i)||u}function Ss(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function wc(n,e,t,i){const s=t.padding;let{x:o,y:a}=e;for(const l of n){const c=l.box,d=i[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;ui(d.start)&&(a=d.start),c.fullSize?Ss(c,s.left,a,t.outerWidth-s.right-s.left,h):Ss(c,e.left+d.placed,a,f,h),d.start=a,d.placed+=f,a=c.bottom}else{const f=e.h*u,h=d.size||c.width;ui(d.start)&&(o=d.start),c.fullSize?Ss(c,o,s.top,h,t.outerHeight-s.bottom-s.top):Ss(c,o,e.top+d.placed,h,f),d.start=o,d.placed+=f,o=c.right}}e.x=o,e.y=a}var Ie={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const s=je(n.options.layout.padding),o=Math.max(e-s.width,0),a=Math.max(t-s.height,0),l=t_(n.boxes),c=l.vertical,d=l.horizontal;ge(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},s);Sc(h,je(i));const m=Object.assign({maxPadding:h,w:o,h:a,x:s.left,y:s.top},s),p=e_(c.concat(d),f);Oi(l.fullSize,m,f,p),Oi(c,m,f,p),Oi(d,m,f,p)&&Oi(c,m,f,p),i_(m),wc(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,wc(l.rightAndBottom,m,f,p),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},ge(l.chartArea,g=>{const y=g.box;Object.assign(y,n.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Ko{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Ec extends Ko{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ws="$chartjs",o_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cc=n=>n===null||n==="";function r_(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ws]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Cc(s)){const o=Kl(n,"width");o!==void 0&&(n.width=o)}if(Cc(i))if(n.style.height==="")n.height=n.width/(e||2);else{const o=Kl(n,"height");o!==void 0&&(n.height=o)}return n}const vc=hx?{passive:!0}:!1;function a_(n,e,t){n&&n.addEventListener(e,t,vc)}function l_(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,vc)}function c_(n,e){const t=o_[n.type]||n.type,{x:i,y:s}=gn(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Es(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function d_(n,e,t){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Es(l.addedNodes,i),a=a&&!Es(l.removedNodes,i);a&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function u_(n,e,t){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Es(l.removedNodes,i),a=a&&!Es(l.addedNodes,i);a&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ti=new Map;let Dc=0;function Nc(){const n=window.devicePixelRatio;n!==Dc&&(Dc=n,Ti.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function f_(n,e){Ti.size||window.addEventListener("resize",Nc),Ti.set(n,e)}function h_(n){Ti.delete(n),Ti.size||window.removeEventListener("resize",Nc)}function m_(n,e,t){const i=n.canvas,s=i&&Lo(i);if(!s)return;const o=Nl((l,c)=>{const d=s.clientWidth;t(l,c),d<s.clientWidth&&t()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||o(d,u)});return a.observe(s),f_(n,o),a}function Xo(n,e,t){t&&t.disconnect(),e==="resize"&&h_(n)}function p_(n,e,t){const i=n.canvas,s=Nl(o=>{n.ctx!==null&&t(c_(o,n))},n);return a_(i,e,s),s}class Oc extends Ko{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(r_(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ws])return!1;const i=t[ws].initial;["height","width"].forEach(o=>{const a=i[o];de(a)?t.removeAttribute(o):t.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{t.style[o]=s[o]}),t.width=t.width,delete t[ws],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),a={attach:d_,detach:u_,resize:m_}[t]||p_;s[t]=a(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:Xo,detach:Xo,resize:Xo}[t]||l_)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return fx(e,t,i,s)}isAttached(e){const t=e&&Lo(e);return!!(t&&t.isConnected)}}function Tc(n){return!Io()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ec:Oc}let xt=(Rs=class{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Tn(this.x)&&Tn(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},z(Rs,"defaults",{}),z(Rs,"defaultRoutes"),Rs);function g_(n,e){const t=n.options.ticks,i=y_(n),s=Math.min(t.maxTicksLimit||i,i),o=t.major.enabled?x_(e):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>s)return __(e,d,o,a/s),d;const u=b_(o,e,s);if(a>0){let f,h;const m=a>1?Math.round((c-l)/(a-1)):null;for(Cs(e,d,u,de(m)?0:l-m,l),f=0,h=a-1;f<h;f++)Cs(e,d,u,o[f],o[f+1]);return Cs(e,d,u,c,de(m)?e.length:c+m),d}return Cs(e,d,u),d}function y_(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function b_(n,e,t){const i=k_(n),s=e.length/t;if(!i)return Math.max(s,1);const o=g0(i);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>s)return c}return Math.max(s,1)}function x_(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function __(n,e,t,i){let s=0,o=t[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===o&&(e.push(n[a]),s++,o=t[s*i])}function Cs(n,e,t,i,s){const o=oe(i,0),a=Math.min(oe(s,n.length),n.length);let l=0,c,d,u;for(t=Math.ceil(t),s&&(c=s-i,t=c/Math.floor(c/t)),u=o;u<0;)l++,u=Math.round(o+l*t);for(d=Math.max(o,0);d<a;d++)d===u&&(e.push(n[d]),l++,u=Math.round(o+l*t))}function k_(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const S_=n=>n==="left"?"right":n==="right"?"left":n,Pc=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Bc=(n,e)=>Math.min(e||n,n);function Mc(n,e){const t=[],i=n.length/e,s=n.length;let o=0;for(;o<s;o+=i)t.push(n[Math.floor(o)]);return t}function w_(n,e,t){const i=n.ticks.length,s=Math.min(e,i-1),o=n._startPixel,a=n._endPixel,l=1e-6;let c=n.getPixelForTick(s),d;if(!(t&&(i===1?d=Math.max(c-o,a-c):e===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<o-l||c>a+l)))return c}function E_(n,e){ge(n,t=>{const i=t.gc,s=i.length/2;let o;if(s>e){for(o=0;o<s;++o)delete t.data[i[o]];i.splice(0,s)}})}function Pi(n){return n.drawTicks?n.tickLength:0}function Vc(n,e){if(!n.display)return 0;const t=Ve(n.font,e),i=je(n.padding);return(Ce(n.text)?n.text.length:1)*t.lineHeight+i.height}function C_(n,e){return Qt(n,{scale:e,type:"scale"})}function v_(n,e,t){return Qt(n,{tick:t,index:e,type:"tick"})}function D_(n,e,t){let i=No(n);return(t&&e!=="right"||!t&&e==="right")&&(i=S_(i)),i}function N_(n,e,t,i){const{top:s,left:o,bottom:a,right:l,chart:c}=n,{chartArea:d,scales:u}=c;let f=0,h,m,p;const g=a-s,y=l-o;if(n.isHorizontal()){if(m=Re(i,o,l),le(t)){const b=Object.keys(t)[0],_=t[b];p=u[b].getPixelForValue(_)+g-e}else t==="center"?p=(d.bottom+d.top)/2+g-e:p=Pc(n,t,e);h=l-o}else{if(le(t)){const b=Object.keys(t)[0],_=t[b];m=u[b].getPixelForValue(_)-y+e}else t==="center"?m=(d.left+d.right)/2-y+e:m=Pc(n,t,e);p=Re(i,a,s),f=t==="left"?-Te:Te}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class Zt extends xt{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,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=Xe(e,Number.POSITIVE_INFINITY),t=Xe(t,Number.NEGATIVE_INFINITY),i=Xe(i,Number.POSITIVE_INFINITY),s=Xe(s,Number.NEGATIVE_INFINITY),{min:Xe(e,i),max:Xe(t,s),minDefined:Ne(e),maxDefined:Ne(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:t,max:i};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,e),s||(t=Math.min(t,a.min)),o||(i=Math.max(i,a.max));return t=o&&t>i?i:t,i=s&&t>i?t:i,{min:Xe(t,Xe(i,t)),max:Xe(i,Xe(t,i))}}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(){xe(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=H0(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Mc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=g_(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xe(this.options.afterUpdate,[this])}beforeSetDimensions(){xe(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(){xe(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),xe(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i],o.label=xe(t.callback,[o.value,i,e],this)}afterTickToLabelConversion(){xe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=Bc(this.ticks.length,e.ticks.maxTicksLimit),s=t.minRotation||0,o=t.maxRotation;let a=s,l,c,d;if(!this._isVisible()||!t.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=Fe(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/i:m/(i-1),f+6>l&&(l=m/(i-(e.offset?.5:1)),c=this.maxHeight-Pi(e.grid)-t.padding-Vc(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),a=Co(Math.min(Math.asin(Fe((u.highest.height+6)/l,-1,1)),Math.asin(Fe(c/d,-1,1))-Math.asin(Fe(h/d,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){xe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xe(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=Vc(s,t.options.font);if(l?(e.width=this.maxWidth,e.height=Pi(o)+c):(e.height=this.maxHeight,e.width=Pi(o)+c),i.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=i.padding*2,p=dt(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const b=i.mirror?0:y*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+b+m)}else{const b=i.mirror?0:g*f.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="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;c?d?(h=s*e.width,m=i*t.height):(h=i*e.height,m=s*t.width):o==="start"?m=t.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,m=t.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+a)*this.width/(this.width-f),0)}else{let u=t.height/2,f=e.height/2;o==="start"?(u=0,f=e.height):o==="end"&&(u=t.height,f=0),this.paddingTop=u+a,this.paddingBottom=f+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){xe(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)de(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Mc(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:s,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(t/Bc(t,i));let d=0,u=0,f,h,m,p,g,y,b,_,w,E,k;for(f=0;f<t;f+=c){if(p=e[f].label,g=this._resolveTickFontOptions(f),s.font=y=g.string,b=o[y]=o[y]||{data:{},gc:[]},_=g.lineHeight,w=E=0,!de(p)&&!Ce(p))w=ms(s,b.data,b.gc,w,p),E=_;else if(Ce(p))for(h=0,m=p.length;h<m;++h)k=p[h],!de(k)&&!Ce(k)&&(w=ms(s,b.data,b.gc,w,k),E+=_);a.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}E_(o,t);const C=a.indexOf(d),S=l.indexOf(u),x=v=>({width:a[v]||0,height:l[v]||0});return{first:x(0),last:x(t-1),widest:x(C),highest:x(S),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return x0(this._alignToPixels?fn(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=v_(this.getContext(),e,i))}return this.$context||(this.$context=C_(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=dt(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*i>l*s?l/i:c/s:c*s<l*i?c/i:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:l}=s,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Pi(o),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,b=function(A){return fn(i,A,g)};let _,w,E,k,C,S,x,v,B,D,T,I;if(a==="top")_=b(this.bottom),S=this.bottom-h,v=_-y,D=b(e.top)+y,I=e.bottom;else if(a==="bottom")_=b(this.top),D=e.top,I=b(e.bottom)-y,S=_+y,v=this.top+h;else if(a==="left")_=b(this.right),C=this.right-h,x=_-y,B=b(e.left)+y,T=e.right;else if(a==="right")_=b(this.left),B=e.left,T=b(e.right)-y,C=_+y,x=this.left+h;else if(t==="x"){if(a==="center")_=b((e.top+e.bottom)/2+.5);else if(le(a)){const A=Object.keys(a)[0],j=a[A];_=b(this.chart.scales[A].getPixelForValue(j))}D=e.top,I=e.bottom,S=_+y,v=S+h}else if(t==="y"){if(a==="center")_=b((e.left+e.right)/2);else if(le(a)){const A=Object.keys(a)[0],j=a[A];_=b(this.chart.scales[A].getPixelForValue(j))}C=_-y,x=C-h,B=e.left,T=e.right}const q=oe(s.ticks.maxTicksLimit,f),L=Math.max(1,Math.ceil(f/q));for(w=0;w<f;w+=L){const A=this.getContext(w),j=o.setContext(A),$=l.setContext(A),P=j.lineWidth,R=j.color,G=$.dash||[],se=$.dashOffset,ne=j.tickWidth,Q=j.tickColor,Y=j.tickBorderDash||[],te=j.tickBorderDashOffset;E=w_(this,w,c),E!==void 0&&(k=fn(i,E,P),d?C=x=B=T=k:S=v=D=I=k,m.push({tx1:C,ty1:S,tx2:x,ty2:v,x1:B,y1:D,x2:T,y2:I,width:P,color:R,borderDash:G,borderDashOffset:se,tickWidth:ne,tickColor:Q,tickBorderDash:Y,tickBorderDashOffset:te}))}return this._ticksLength=f,this._borderValue=_,m}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=o,h=Pi(i.grid),m=h+u,p=f?-u:m,g=-dt(this.labelRotation),y=[];let b,_,w,E,k,C,S,x,v,B,D,T,I="middle";if(s==="top")C=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const L=this._getYAxisLabelAlignment(h);S=L.textAlign,k=L.x}else if(s==="right"){const L=this._getYAxisLabelAlignment(h);S=L.textAlign,k=L.x}else if(t==="x"){if(s==="center")C=(e.top+e.bottom)/2+m;else if(le(s)){const L=Object.keys(s)[0],A=s[L];C=this.chart.scales[L].getPixelForValue(A)+m}S=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")k=(e.left+e.right)/2-m;else if(le(s)){const L=Object.keys(s)[0],A=s[L];k=this.chart.scales[L].getPixelForValue(A)}S=this._getYAxisLabelAlignment(h).textAlign}t==="y"&&(c==="start"?I="top":c==="end"&&(I="bottom"));const q=this._getLabelSizes();for(b=0,_=l.length;b<_;++b){w=l[b],E=w.label;const L=o.setContext(this.getContext(b));x=this.getPixelForTick(b)+o.labelOffset,v=this._resolveTickFontOptions(b),B=v.lineHeight,D=Ce(E)?E.length:1;const A=D/2,j=L.color,$=L.textStrokeColor,P=L.textStrokeWidth;let R=S;a?(k=x,S==="inner"&&(b===_-1?R=this.options.reverse?"left":"right":b===0?R=this.options.reverse?"right":"left":R="center"),s==="top"?d==="near"||g!==0?T=-D*B+B/2:d==="center"?T=-q.highest.height/2-A*B+B:T=-q.highest.height+B/2:d==="near"||g!==0?T=B/2:d==="center"?T=q.highest.height/2-A*B:T=q.highest.height-D*B,f&&(T*=-1),g!==0&&!L.showLabelBackdrop&&(k+=B/2*Math.sin(g))):(C=x,T=(1-D)*B/2);let G;if(L.showLabelBackdrop){const se=je(L.backdropPadding),ne=q.heights[b],Q=q.widths[b];let Y=T-se.top,te=0-se.left;switch(I){case"middle":Y-=ne/2;break;case"bottom":Y-=ne;break}switch(S){case"center":te-=Q/2;break;case"right":te-=Q;break;case"inner":b===_-1?te-=Q:b>0&&(te-=Q/2);break}G={left:te,top:Y,width:Q+se.width,height:ne+se.height,color:L.backdropColor}}y.push({label:E,font:v,textOffset:T,options:{rotation:g,color:j,strokeColor:$,strokeWidth:P,textAlign:R,textBaseline:I,translation:[k,C],backdrop:G}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-dt(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),l=e+o,c=a.widest.width;let d,u;return t==="left"?s?(u=this.right+o,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):t==="right"?s?(u=this.left+o,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:o,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,o,a),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const l=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(t.display)for(o=0,a=s.length;o<a;++o){const c=s[o];t.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),t.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=fn(e,this.left,a)-a/2,u=fn(e,this.right,l)+l/2,f=h=c):(f=fn(e,this.top,a)-a/2,h=fn(e,this.bottom,l)+l/2,d=u=c),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(d,f),t.lineTo(u,h),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ps(i,s);const o=this.getLabelItems(e);for(const a of o){const l=a.options,c=a.font,d=a.label,u=a.textOffset;hn(i,d,0,u,c,l)}s&&gs(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const o=Ve(i.font),a=je(i.padding),l=i.align;let c=o.lineHeight/2;t==="bottom"||t==="center"||le(t)?(c+=a.bottom,Ce(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=N_(this,c,t,l);hn(e,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:h,textAlign:D_(l,t,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=oe(e.grid&&e.grid.z,-1),s=oe(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Zt.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=t.length;o<a;++o){const l=t[o];l[i]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return Ve(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class vs{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;P_(t)&&(i=this.register(t));const s=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,O_(e,a,i),this.override&&we.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in we[s]&&(delete we[s][i],this.override&&delete un[i])}}function O_(n,e,t){const i=ci(Object.create(null),[t?we.get(t):{},we.get(e),n.defaults]);we.set(e,i),n.defaultRoutes&&T_(e,n.defaultRoutes),n.descriptors&&we.describe(e,n.descriptors)}function T_(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),s=i.pop(),o=[n].concat(i).join("."),a=e[t].split("."),l=a.pop(),c=a.join(".");we.route(o,s,c,l)})}function P_(n){return"id"in n&&"defaults"in n}class B_{constructor(){this.controllers=new vs(nt,"datasets",!0),this.elements=new vs(xt,"elements"),this.plugins=new vs(Object,"plugins"),this.scales=new vs(Zt,"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,t,i){[...t].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):ge(s,a=>{const l=i||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,t,i){const s=Eo(e);xe(i["before"+s],[],i),t[e](i),xe(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var ut=new B_;class M_{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),a=this._notify(o,e,t,i);return t==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,t,i,s){s=s||{};for(const o of e){const a=o.plugin,l=a[i],c=[t,s,o.options];if(xe(l,c,a)===!1&&s.cancelable)return!1}return!0}invalidate(){de(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=oe(i.options&&i.options.plugins,{}),o=V_(i);return s===!1&&!t?[]:F_(e,o,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function V_(n){const e={},t=[],i=Object.keys(ut.plugins.items);for(let o=0;o<i.length;o++)t.push(ut.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];t.indexOf(a)===-1&&(t.push(a),e[a.id]=!0)}return{plugins:t,localIds:e}}function A_(n,e){return!e&&n===!1?null:n===!0?{}:n}function F_(n,{plugins:e,localIds:t},i,s){const o=[],a=n.getContext();for(const l of e){const c=l.id,d=A_(i[c],s);d!==null&&o.push({plugin:l,options:$_(n.config,{plugin:l,local:t[c]},d,a)})}return o}function $_(n,{plugin:e,local:t},i,s){const o=n.pluginScopeKeys(e),a=n.getOptionScopes(i,o);return t&&e.defaults&&a.push(e.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Go(n,e){const t=we.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function I_(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function L_(n,e){return n===e?"_index_":"_value_"}function Ac(n){if(n==="x"||n==="y"||n==="r")return n}function R_(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qo(n,...e){if(Ac(n))return n;for(const t of e){const i=t.axis||R_(t.position)||n.length>1&&Ac(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Fc(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function j_(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Fc(n,"x",t[0])||Fc(n,"y",t[0])}return{}}function z_(n,e){const t=un[n.type]||{scales:{}},i=e.scales||{},s=Go(n.type,e),o=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!le(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Qo(a,l,j_(a,n),we.scales[l.type]),d=L_(c,s),u=t.scales||{};o[a]=di(Object.create(null),[{axis:c},l,u[c],u[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,c=a.indexAxis||Go(l,e),u=(un[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=I_(f,c),m=a[h+"AxisID"]||h;o[m]=o[m]||Object.create(null),di(o[m],[{axis:h},i[m],u[f]])})}),Object.keys(o).forEach(a=>{const l=o[a];di(l,[we.scales[l.type],we.scale])}),o}function $c(n){const e=n.options||(n.options={});e.plugins=oe(e.plugins,{}),e.scales=z_(n,e)}function Ic(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function W_(n){return n=n||{},n.data=Ic(n.data),$c(n),n}const Lc=new Map,Rc=new Set;function Ds(n,e){let t=Lc.get(n);return t||(t=e(),Lc.set(n,t),Rc.add(t)),t}const Bi=(n,e,t)=>{const i=Kt(e,t);i!==void 0&&n.add(i)};class H_{constructor(e){this._config=W_(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=Ic(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(),$c(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ds(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Ds(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Ds(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Ds(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:o}=this,a=this._cachedScopes(e,i),l=a.get(t);if(l)return l;const c=new Set;t.forEach(u=>{e&&(c.add(e),u.forEach(f=>Bi(c,e,f))),u.forEach(f=>Bi(c,s,f)),u.forEach(f=>Bi(c,un[o]||{},f)),u.forEach(f=>Bi(c,we,f)),u.forEach(f=>Bi(c,Po,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Rc.has(t)&&a.set(t,d),d}chartOptionScopes(){const{options:e,type:t}=this;return[e,un[t]||{},we.datasets[t]||{},{type:t},we,Po]}resolveNamedOptions(e,t,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=jc(this._resolverCache,e,s);let c=a;if(q_(a,t)){o.$shared=!1,i=Xt(i)?i():i;const d=this.createResolver(e,i,l);c=Pn(a,i,d)}for(const d of t)o[d]=c[d];return o}createResolver(e,t,i=[""],s){const{resolver:o}=jc(this._resolverCache,e,i);return le(t)?Pn(o,t,void 0,s):o}}function jc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let o=i.get(s);return o||(o={resolver:Ao(e,t),subPrefixes:t.filter(l=>!l.toLowerCase().includes("hover"))},i.set(s,o)),o}const U_=n=>le(n)&&Object.getOwnPropertyNames(n).some(e=>Xt(n[e]));function q_(n,e){const{isScriptable:t,isIndexable:i}=Ll(n);for(const s of e){const o=t(s),a=i(s),l=(a||o)&&n[s];if(o&&(Xt(l)||U_(l))||a&&Ce(l))return!0}return!1}var Y_="4.4.7";const K_=["top","bottom","left","right","chartArea"];function zc(n,e){return n==="top"||n==="bottom"||K_.indexOf(n)===-1&&e==="x"}function Wc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Hc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),xe(t&&t.onComplete,[n],e)}function X_(n){const e=n.chart,t=e.options.animation;xe(t&&t.onProgress,[n],e)}function Uc(n){return Io()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ns={},qc=n=>{const e=Uc(n);return Object.values(Ns).filter(t=>t.canvas===e).pop()};function G_(n,e,t){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=e){const a=n[s];delete n[s],(t>0||o>e)&&(n[o+t]=a)}}}function Q_(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Os(n,e,t){return n.options.clip?n[t]:e[t]}function J_(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Os(t,e,"left"),right:Os(t,e,"right"),top:Os(i,e,"top"),bottom:Os(i,e,"bottom")}:e}class _t{static register(...e){ut.add(...e),Yc()}static unregister(...e){ut.remove(...e),Yc()}constructor(e,t){const i=this.config=new H_(t),s=Uc(e),o=qc(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Tc(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=a0(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new M_,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=w0(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Ns[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}bt.listen(this,"complete",Hc),bt.listen(this,"progress",X_),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:o}=this;return de(e)?t&&o?o:s?i/s: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 ut}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Fl(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(e,t){bt.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,e,t,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Yl(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),xe(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ge(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let o=[];t&&(o=o.concat(Object.keys(t).map(a=>{const l=t[a],c=Qo(a,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),ge(o,a=>{const l=a.options,c=l.id,d=Qo(c,l),u=oe(l.type,a.dtype);(l.position===void 0||zc(l.position,d)!==zc(a.dposition))&&(l.position=a.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===u)f=i[c];else{const h=ut.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(l,e)}),ge(s,(a,l)=>{a||delete i[l]}),ge(i,a=>{Ie.configure(this,a,a.options),Ie.addBox(this,a)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,o)=>s.index-o.index),i>t){for(let s=t;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Wc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i<s;i++){const o=t[i];let a=this.getDatasetMeta(i);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=o.indexAxis||Go(l,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const c=ut.getController(l),{datasetElementType:d,dataElementType:u}=we.datasets[l];Object.assign(c,{dataElementType:ut.getElement(u),datasetElementType:d&&ut.getElement(d)}),a.controller=new c(this,i),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){ge(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(h),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||ge(o,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Wc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){ge(this.scales,e=>{Ie.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!bl(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of t){const a=i==="_removeElements"?-o:o;G_(e,s,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=o=>new Set(e.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<t;o++)if(!bl(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ie.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ge(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Xt(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bt.has(this)?this.attached&&!bt.running(this)&&bt.start(this):(this.draw(),Hc({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,o;for(s=0,o=t.length;s<o;++s){const a=t[s];(!e||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,o=J_(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&ps(t,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),e.controller.draw(),s&&gs(t),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return Vt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const o=bc.modes[t];return typeof o=="function"?o(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(o=>o&&o._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,s);ui(t)?(o.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),a.update(o,{visible:i}),this.update(l=>l.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),bt.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Fl(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Ns[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,t=this.platform,i=(o,a)=>{t.addEventListener(this,o,a),e[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};ge(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(c,d)=>{t.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(t.removeEventListener(this,c,d),delete e[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",l)},t.isAttached(this.canvas)?l():a()}unbindEvents(){ge(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ge(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let o,a,l,c;for(t==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!ds(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const s=this.options.hover,o=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),a=o(t,e),l=i?e:o(e,t);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:o}=this,a=t,l=this._getActiveElements(e,s,i,a),c=h0(e),d=Q_(e,this._lastEvent,i,c);i&&(this._lastEvent=null,xe(o.onHover,[e,l,this],this),c&&xe(o.onClick,[e,l,this],this));const u=!ds(l,s);return(u||t)&&(this._active=l,this._updateHoverStyles(l,s,t)),this._lastEvent=d,u}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}z(_t,"defaults",we),z(_t,"instances",Ns),z(_t,"overrides",un),z(_t,"registry",ut),z(_t,"version",Y_),z(_t,"getChart",qc);function Yc(){return ge(_t.instances,n=>n._plugins.invalidate())}function Z_(n,e,t){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:l,innerRadius:c}=e;let d=s/l;n.beginPath(),n.arc(o,a,l,i-d,t+d),c>s?(d=s/c,n.arc(o,a,c,t+d,i-d,!0)):n.arc(o,a,s,t+Te,i-Te),n.closePath(),n.clip()}function ek(n){return Vo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function tk(n,e,t,i){const s=ek(n.options.borderRadius),o=(t-e)/2,a=Math.min(o,i*e/2),l=c=>{const d=(t-Math.min(o,c))*i/2;return Fe(c,0,Math.min(o,d))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Fe(s.innerStart,0,a),innerEnd:Fe(s.innerEnd,0,a)}}function An(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Ts(n,e,t,i,s,o){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+i+t-d,0),h=u>0?u+i+t+d:0;let m=0;const p=s-c;if(i){const L=u>0?u-i:0,A=f>0?f-i:0,j=(L+A)/2,$=j!==0?p*j/(j+i):p;m=(p-$)/2}const g=Math.max(.001,p*f-t/ke)/f,y=(p-g)/2,b=c+y+m,_=s-y-m,{outerStart:w,outerEnd:E,innerStart:k,innerEnd:C}=tk(e,h,f,_-b),S=f-w,x=f-E,v=b+w/S,B=_-E/x,D=h+k,T=h+C,I=b+k/D,q=_-C/T;if(n.beginPath(),o){const L=(v+B)/2;if(n.arc(a,l,f,v,L),n.arc(a,l,f,L,B),E>0){const P=An(x,B,a,l);n.arc(P.x,P.y,E,B,_+Te)}const A=An(T,_,a,l);if(n.lineTo(A.x,A.y),C>0){const P=An(T,q,a,l);n.arc(P.x,P.y,C,_+Te,q+Math.PI)}const j=(_-C/h+(b+k/h))/2;if(n.arc(a,l,h,_-C/h,j,!0),n.arc(a,l,h,j,b+k/h,!0),k>0){const P=An(D,I,a,l);n.arc(P.x,P.y,k,I+Math.PI,b-Te)}const $=An(S,b,a,l);if(n.lineTo($.x,$.y),w>0){const P=An(S,v,a,l);n.arc(P.x,P.y,w,b-Te,v)}}else{n.moveTo(a,l);const L=Math.cos(v)*f+a,A=Math.sin(v)*f+l;n.lineTo(L,A);const j=Math.cos(B)*f+a,$=Math.sin(B)*f+l;n.lineTo(j,$)}n.closePath()}function nk(n,e,t,i,s){const{fullCircles:o,startAngle:a,circumference:l}=e;let c=e.endAngle;if(o){Ts(n,e,t,i,c,s);for(let d=0;d<o;++d)n.fill();isNaN(l)||(c=a+(l%Se||Se))}return Ts(n,e,t,i,c,s),n.fill(),c}function ik(n,e,t,i,s){const{fullCircles:o,startAngle:a,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=c,m=c.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=h,m?(n.lineWidth=d*2,n.lineJoin=u||"round"):(n.lineWidth=d,n.lineJoin=u||"bevel");let p=e.endAngle;if(o){Ts(n,e,t,i,p,s);for(let g=0;g<o;++g)n.stroke();isNaN(l)||(p=a+(l%Se||Se))}m&&Z_(n,e,p),o||(Ts(n,e,t,i,p,s),n.stroke())}class Fn extends xt{constructor(t){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(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,t&&Object.assign(this,t)}inRange(t,i,s){const o=this.getProps(["x","y"],s),{angle:a,distance:l}=wl(o,{x:t,y:i}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=oe(h,d-c),g=hi(a,c,d)&&c!==d,y=p>=Se||g,b=Bt(l,u+m,f+m);return y&&b}getCenterPoint(t){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:d,spacing:u}=this.options,f=(o+a)/2,h=(l+c+u+d)/2;return{x:i+Math.cos(f)*h,y:s+Math.sin(f)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:i,circumference:s}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Se?Math.floor(s/Se):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(ke,s||0)),u=o*d;t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,nk(t,this,u,a,l),ik(t,this,u,a,l),t.restore()}}z(Fn,"id","arc"),z(Fn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(Fn,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(Fn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function Kc(n,e,t=e){n.lineCap=oe(t.borderCapStyle,e.borderCapStyle),n.setLineDash(oe(t.borderDash,e.borderDash)),n.lineDashOffset=oe(t.borderDashOffset,e.borderDashOffset),n.lineJoin=oe(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=oe(t.borderWidth,e.borderWidth),n.strokeStyle=oe(t.borderColor,e.borderColor)}function sk(n,e,t){n.lineTo(t.x,t.y)}function ok(n){return n.stepped?A0:n.tension||n.cubicInterpolationMode==="monotone"?F0:sk}function Xc(n,e,t={}){const i=n.length,{start:s=0,end:o=i-1}=t,{start:a,end:l}=e,c=Math.max(s,a),d=Math.min(o,l),u=s<a&&o<a||s>l&&o>l;return{count:i,start:c,loop:e.loop,ilen:d<c&&!u?i+d-c:d-c}}function rk(n,e,t,i){const{points:s,options:o}=e,{count:a,start:l,loop:c,ilen:d}=Xc(s,t,i),u=ok(o);let{move:f=!0,reverse:h}=i||{},m,p,g;for(m=0;m<=d;++m)p=s[(l+(h?d-m:m))%a],!p.skip&&(f?(n.moveTo(p.x,p.y),f=!1):u(n,g,p,h,o.stepped),g=p);return c&&(p=s[(l+(h?d:0))%a],u(n,g,p,h,o.stepped)),!!c}function ak(n,e,t,i){const s=e.points,{count:o,start:a,ilen:l}=Xc(s,t,i),{move:c=!0,reverse:d}=i||{};let u=0,f=0,h,m,p,g,y,b;const _=E=>(a+(d?l-E:E))%o,w=()=>{g!==y&&(n.lineTo(u,y),n.lineTo(u,g),n.lineTo(u,b))};for(c&&(m=s[_(0)],n.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=s[_(h)],m.skip)continue;const E=m.x,k=m.y,C=E|0;C===p?(k<g?g=k:k>y&&(y=k),u=(f*u+E)/++f):(w(),n.lineTo(E,k),p=C,f=0,g=y=k),b=k}w()}function Jo(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?ak:rk}function lk(n){return n.stepped?mx:n.tension||n.cubicInterpolationMode==="monotone"?px:yn}function ck(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),Kc(n,e.options),n.stroke(s)}function dk(n,e,t,i){const{segments:s,options:o}=e,a=Jo(e);for(const l of s)Kc(n,o,l.style),n.beginPath(),a(n,e,l,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const uk=typeof Path2D=="function";function fk(n,e,t,i){uk&&!e.options.segment?ck(n,e,t,i):dk(n,e,t,i)}class At extends xt{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,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;rx(this._points,i,e,s,t),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=kx(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],o=this.points,a=ec(this,{property:t,start:s,end:s});if(!a.length)return;const l=[],c=lk(i);let d,u;for(d=0,u=a.length;d<u;++d){const{start:f,end:h}=a[d],m=o[f],p=o[h];if(m===p){l.push(m);continue}const g=Math.abs((s-m[t])/(p[t]-m[t])),y=c(m,p,g,i.stepped);y[t]=e[t],l.push(y)}return l.length===1?l[0]:l}pathSegment(e,t,i){return Jo(this)(e,this,t,i)}path(e,t,i){const s=this.segments,o=Jo(this);let a=this._loop;t=t||0,i=i||this.points.length-t;for(const l of s)a&=o(e,this,l,{start:t,end:t+i-1});return!!a}draw(e,t,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),fk(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(At,"id","line"),z(At,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(At,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(At,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Gc(n,e,t,i){const s=n.options,{[t]:o}=n.getProps([t],i);return Math.abs(e-o)<s.radius+s.hitRadius}class Mi extends xt{constructor(t){super();z(this,"parsed");z(this,"skip");z(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,s){const o=this.options,{x:a,y:l}=this.getProps(["x","y"],s);return Math.pow(t-a,2)+Math.pow(i-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,i){return Gc(this,t,"x",i)}inYRange(t,i){return Gc(this,t,"y",i)}getCenterPoint(t){const{x:i,y:s}=this.getProps(["x","y"],t);return{x:i,y:s}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const s=i&&t.borderWidth||0;return(i+s)*2}draw(t,i){const s=this.options;this.skip||s.radius<.1||!Vt(this,i,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Mo(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}z(Mi,"id","point"),z(Mi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Mi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Qc(n,e){const{x:t,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return n.horizontal?(f=a/2,l=Math.min(t,s),c=Math.max(t,s),d=i-f,u=i+f):(f=o/2,l=t-f,c=t+f,d=Math.min(i,s),u=Math.max(i,s)),{left:l,top:d,right:c,bottom:u}}function en(n,e,t,i){return n?0:Fe(e,t,i)}function hk(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,o=Il(i);return{t:en(s.top,o.top,0,t),r:en(s.right,o.right,0,e),b:en(s.bottom,o.bottom,0,t),l:en(s.left,o.left,0,e)}}function mk(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=mn(s),a=Math.min(e,t),l=n.borderSkipped,c=i||le(s);return{topLeft:en(!c||l.top||l.left,o.topLeft,0,a),topRight:en(!c||l.top||l.right,o.topRight,0,a),bottomLeft:en(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:en(!c||l.bottom||l.right,o.bottomRight,0,a)}}function pk(n){const e=Qc(n),t=e.right-e.left,i=e.bottom-e.top,s=hk(n,t/2,i/2),o=mk(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Zo(n,e,t,i){const s=e===null,o=t===null,l=n&&!(s&&o)&&Qc(n,i);return l&&(s||Bt(e,l.left,l.right))&&(o||Bt(t,l.top,l.bottom))}function gk(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function yk(n,e){n.rect(e.x,e.y,e.w,e.h)}function er(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,o=(n.x+n.w!==t.x+t.w?e:0)-i,a=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+a,radius:n.radius}}class Vi extends xt{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:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=pk(this),l=gk(a.radius)?bi:yk;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),l(e,er(a,t,o)),e.clip(),l(e,er(o,-t,a)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),l(e,er(o,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return Zo(this,e,t,i)}inXRange(e,t){return Zo(this,e,null,t)}inYRange(e,t){return Zo(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+s)/2:t,y:o?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}z(Vi,"id","bar"),z(Vi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(Vi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Jc=Object.freeze({__proto__:null,ArcElement:Fn,BarElement:Vi,LineElement:At,PointElement:Mi});const tr=["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)"],Zc=tr.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ed(n){return tr[n%tr.length]}function td(n){return Zc[n%Zc.length]}function bk(n,e){return n.borderColor=ed(e),n.backgroundColor=td(e),++e}function xk(n,e){return n.backgroundColor=n.data.map(()=>ed(e++)),e}function _k(n,e){return n.backgroundColor=n.data.map(()=>td(e++)),e}function kk(n){let e=0;return(t,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Jt?e=xk(t,e):s instanceof Vn?e=_k(t,e):s&&(e=bk(t,e))}}function nd(n){let e;for(e in n)if(n[e].borderColor||n[e].backgroundColor)return!0;return!1}function Sk(n){return n&&(n.borderColor||n.backgroundColor)}function wk(){return we.borderColor!=="rgba(0,0,0,0.1)"||we.backgroundColor!=="rgba(0,0,0,0.1)"}var id={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,e,t){if(!t.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s,a=nd(i)||Sk(s)||o&&nd(o)||wk();if(!t.forceOverride&&a)return;const l=kk(n);i.forEach(l)}};function Ek(n,e,t,i,s){const o=s.samples||i;if(o>=t)return n.slice(e,e+t);const a=[],l=(t-2)/(o-2);let c=0;const d=e+t-1;let u=e,f,h,m,p,g;for(a[c++]=n[u],f=0;f<o-2;f++){let y=0,b=0,_;const w=Math.floor((f+1)*l)+1+e,E=Math.min(Math.floor((f+2)*l)+1,t)+e,k=E-w;for(_=w;_<E;_++)y+=n[_].x,b+=n[_].y;y/=k,b/=k;const C=Math.floor(f*l)+1+e,S=Math.min(Math.floor((f+1)*l)+1,t)+e,{x,y:v}=n[u];for(m=p=-1,_=C;_<S;_++)p=.5*Math.abs((x-y)*(n[_].y-v)-(x-n[_].x)*(b-v)),p>m&&(m=p,h=n[_],g=_);a[c++]=h,u=g}return a[c++]=n[d],a}function Ck(n,e,t,i){let s=0,o=0,a,l,c,d,u,f,h,m,p,g;const y=[],b=e+t-1,_=n[e].x,E=n[b].x-_;for(a=e;a<e+t;++a){l=n[a],c=(l.x-_)/E*i,d=l.y;const k=c|0;if(k===u)d<p?(p=d,f=a):d>g&&(g=d,h=a),s=(o*s+l.x)/++o;else{const C=a-1;if(!de(f)&&!de(h)){const S=Math.min(f,h),x=Math.max(f,h);S!==m&&S!==C&&y.push({...n[S],x:s}),x!==m&&x!==C&&y.push({...n[x],x:s})}a>0&&C!==m&&y.push(n[C]),y.push(l),u=k,o=0,p=g=d,f=h=m=a}}return y}function sd(n){if(n._decimated){const e=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function od(n){n.data.datasets.forEach(e=>{sd(e)})}function vk(n,e){const t=e.length;let i=0,s;const{iScale:o}=n,{min:a,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=Fe(Mt(e,o.axis,a).lo,0,t-1)),d?s=Fe(Mt(e,o.axis,l).hi+1,i,t)-i:s=t-i,{start:i,count:s}}var rd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,e,t)=>{if(!t.enabled){od(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:l}=s,c=n.getDatasetMeta(o),d=a||s.data;if(xi([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=n.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:f,count:h}=vk(c,d);const m=t.threshold||4*i;if(h<=m){sd(s);return}de(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(t.algorithm){case"lttb":p=Ek(d,f,h,i,t);break;case"min-max":p=Ck(d,f,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}s._decimated=p})},destroy(n){od(n)}};function Dk(n,e,t){const i=n.segments,s=n.points,o=e.points,a=[];for(const l of i){let{start:c,end:d}=l;d=ir(c,d,s);const u=nr(t,s[c],s[d],l.loop);if(!e.segments){a.push({source:l,target:u,start:s[c],end:s[d]});continue}const f=ec(e,u);for(const h of f){const m=nr(t,o[h.start],o[h.end],h.loop),p=Zl(l,s,m);for(const g of p)a.push({source:g,target:h,start:{[t]:ad(u,m,"start",Math.max)},end:{[t]:ad(u,m,"end",Math.min)}})}}return a}function nr(n,e,t,i){if(i)return;let s=e[n],o=t[n];return n==="angle"&&(s=Ge(s),o=Ge(o)),{property:n,start:s,end:o}}function Nk(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,o=[];return e.segments.forEach(({start:a,end:l})=>{l=ir(a,l,s);const c=s[a],d=s[l];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):t!==null&&(o.push({x:t,y:c.y}),o.push({x:t,y:d.y}))}),o}function ir(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function ad(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function ld(n,e){let t=[],i=!1;return Ce(n)?(i=!0,t=n):t=Nk(n,e),t.length?new At({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function cd(n){return n&&n.fill!==!1}function Ok(n,e,t){let s=n[e].fill;const o=[e];let a;if(!t)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Ne(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function Tk(n,e,t){const i=Vk(n);if(le(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Ne(s)&&Math.floor(s)===s?Pk(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Pk(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Bk(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:le(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Mk(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:le(n)?i=n.value:i=e.getBaseValue(),i}function Vk(n){const e=n.options,t=e.fill;let i=oe(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Ak(n){const{scale:e,index:t,line:i}=n,s=[],o=i.segments,a=i.points,l=Fk(e,t);l.push(ld({x:null,y:e.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let u=d.start;u<=d.end;u++)$k(s,a[u],l)}return new At({points:s,options:{}})}function Fk(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===e)break;o.hidden||t.unshift(o.dataset)}return t}function $k(n,e,t){const i=[];for(let s=0;s<t.length;s++){const o=t[s],{first:a,last:l,point:c}=Ik(o,e,"x");if(!(!c||a&&l)){if(a)i.unshift(c);else if(n.push(c),!l)break}}n.push(...i)}function Ik(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],o=n.segments,a=n.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const u=o[d],f=a[u.start][t],h=a[u.end][t];if(Bt(s,f,h)){l=s===f,c=s===h;break}}return{first:l,last:c,point:i}}class dd{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:o,radius:a}=this;return t=t||{start:0,end:Se},e.arc(s,o,a,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,o=e.angle;return{x:t+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Lk(n){const{chart:e,fill:t,line:i}=n;if(Ne(t))return Rk(e,t);if(t==="stack")return Ak(n);if(t==="shape")return!0;const s=jk(n);return s instanceof dd?s:ld(s,i)}function Rk(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function jk(n){return(n.scale||{}).getPointPositionForValue?Wk(n):zk(n)}function zk(n){const{scale:e={},fill:t}=n,i=Bk(t,e);if(Ne(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Wk(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,o=i.reverse?e.max:e.min,a=Mk(t,e,o),l=[];if(i.grid.circular){const c=e.getPointPositionForValue(0,o);return new dd({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,a));return l}function sr(n,e,t){const i=Lk(e),{line:s,scale:o,axis:a}=e,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:f=d}=c||{};i&&s.points.length&&(ps(n,t),Hk(n,{line:s,target:i,above:u,below:f,area:t,scale:o,axis:a}),gs(n))}function Hk(n,e){const{line:t,target:i,above:s,below:o,area:a,scale:l}=e,c=t._loop?"angle":e.axis;n.save(),c==="x"&&o!==s&&(ud(n,i,a.top),fd(n,{line:t,target:i,color:s,scale:l,property:c}),n.restore(),n.save(),ud(n,i,a.bottom)),fd(n,{line:t,target:i,color:o,scale:l,property:c}),n.restore()}function ud(n,e,t){const{segments:i,points:s}=e;let o=!0,a=!1;n.beginPath();for(const l of i){const{start:c,end:d}=l,u=s[c],f=s[ir(c,d,s)];o?(n.moveTo(u.x,u.y),o=!1):(n.lineTo(u.x,t),n.lineTo(u.x,u.y)),a=!!e.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(f.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function fd(n,e){const{line:t,target:i,property:s,color:o,scale:a}=e,l=Dk(t,i,s);for(const{source:c,target:d,start:u,end:f}of l){const{style:{backgroundColor:h=o}={}}=c,m=i!==!0;n.save(),n.fillStyle=h,Uk(n,a,m&&nr(s,u,f)),n.beginPath();const p=!!t.pathSegment(n,c);let g;if(m){p?n.closePath():hd(n,i,f,s);const y=!!i.pathSegment(n,d,{move:p,reverse:!0});g=p&&y,g||hd(n,i,u,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function Uk(n,e,t){const{top:i,bottom:s}=e.chart.chartArea,{property:o,start:a,end:l}=t||{};o==="x"&&(n.beginPath(),n.rect(a,i,l-a,s-i),n.clip())}function hd(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var md={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,s=[];let o,a,l,c;for(a=0;a<i;++a)o=n.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof At&&(c={visible:n.isDatasetVisible(a),index:a,fill:Tk(l,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(a=0;a<i;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=Ok(s,a,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=s.length-1;a>=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&sr(n.ctx,l,o))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;cd(o)&&sr(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!cd(i)||t.drawTime!=="beforeDatasetDraw"||sr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const pd=(n,e)=>{let{boxHeight:t=e,boxWidth:i=e}=n;return n.usePointStyle&&(t=Math.min(t,e),i=n.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},qk=(n,e)=>n!==null&&e!==null&&n.datasetIndex===e.datasetIndex&&n.index===e.index;class gd extends xt{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,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=xe(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,s=Ve(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=pd(i,o);let d,u;t.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(a,o,l,c)+10):(u=this.maxHeight,d=this._fitCols(a,s,l,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+l;let f=e;o.textAlign="left",o.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=i+t/2+o.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>a)&&(f+=u,d[d.length-(g>0?0:1)]=0,m+=u,h++),c[g]={left:0,top:m,row:h,width:y,height:s},d[d.length-1]+=y+l}),f}_fitCols(e,t,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=a-e;let f=l,h=0,m=0,p=0,g=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:_,itemHeight:w}=Yk(i,t,o,y,s);b>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,g++,h=m=0),c[b]={left:p,top:m,col:g,width:_,height:w},h=Math.max(h,_),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:s},rtl:o}}=this,a=Mn(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=Re(i,this.left+s,this.right-this.lineWidths[l]);for(const d of t)l!==d.row&&(l=d.row,c=Re(i,this.left+s,this.right-this.lineWidths[l])),d.top+=this.top+e+s,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+s}else{let l=0,c=Re(i,this.top+e+s,this.bottom-this.columnSizes[l].height);for(const d of t)d.col!==l&&(l=d.col,c=Re(i,this.top+e+s,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;ps(e,this),this._draw(),gs(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:i,ctx:s}=this,{align:o,labels:a}=e,l=we.color,c=Mn(e.rtl,this.left,this.width),d=Ve(a.font),{padding:u}=a,f=d.size,h=f/2;let m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=pd(a,f),b=function(C,S,x){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const v=oe(x.lineWidth,1);if(s.fillStyle=oe(x.fillStyle,l),s.lineCap=oe(x.lineCap,"butt"),s.lineDashOffset=oe(x.lineDashOffset,0),s.lineJoin=oe(x.lineJoin,"miter"),s.lineWidth=v,s.strokeStyle=oe(x.strokeStyle,l),s.setLineDash(oe(x.lineDash,[])),a.usePointStyle){const B={radius:g*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:v},D=c.xPlus(C,p/2),T=S+h;$l(s,B,D,T,a.pointStyleWidth&&p)}else{const B=S+Math.max((f-g)/2,0),D=c.leftForLtr(C,p),T=mn(x.borderRadius);s.beginPath(),Object.values(T).some(I=>I!==0)?bi(s,{x:D,y:B,w:p,h:g,radius:T}):s.rect(D,B,p,g),s.fill(),v!==0&&s.stroke()}s.restore()},_=function(C,S,x){hn(s,x.text,C,S+y/2,d,{strikethrough:x.hidden,textAlign:c.textAlign(x.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:Re(o,this.left+u,this.right-i[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:Re(o,this.top+E+u,this.bottom-t[0].height),line:0},Xl(this.ctx,e.textDirection);const k=y+u;this.legendItems.forEach((C,S)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const x=s.measureText(C.text).width,v=c.textAlign(C.textAlign||(C.textAlign=a.textAlign)),B=p+h+x;let D=m.x,T=m.y;c.setWidth(this.width),w?S>0&&D+B+u>this.right&&(T=m.y+=k,m.line++,D=m.x=Re(o,this.left+u,this.right-i[m.line])):S>0&&T+k>this.bottom&&(D=m.x=D+t[m.line].width+u,m.line++,T=m.y=Re(o,this.top+E+u,this.bottom-t[m.line].height));const I=c.x(D);if(b(I,T,C),D=E0(v,D+p+h,w?D+B:this.right,e.rtl),_(c.x(D),T,C),w)m.x+=B+u;else if(typeof C.text!="string"){const q=d.lineHeight;m.y+=yd(C,q)+u}else m.y+=k}),Gl(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,i=Ve(t.font),s=je(t.padding);if(!t.display)return;const o=Mn(e.rtl,this.left,this.width),a=this.ctx,l=t.position,c=i.size/2,d=s.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=Re(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+Re(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=Re(l,f,f+h);a.textAlign=o.textAlign(No(l)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=i.string,hn(a,t.text,m,u,i)}_computeTitleHeight(){const e=this.options.title,t=Ve(e.font),i=je(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,s,o;if(Bt(e,this.left,this.right)&&Bt(t,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Bt(e,s.left,s.left+s.width)&&Bt(t,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){const t=this.options;if(!Gk(e.type,t))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=qk(s,i);s&&!o&&xe(t.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!o&&xe(t.onHover,[e,i,this],this)}else i&&xe(t.onClick,[e,i,this],this)}}function Yk(n,e,t,i,s){const o=Kk(i,n,e,t),a=Xk(s,i,e.lineHeight);return{itemWidth:o,itemHeight:a}}function Kk(n,e,t,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),e+t.size/2+i.measureText(s).width}function Xk(n,e,t){let i=n;return typeof e.text!="string"&&(i=yd(e,t)),i}function yd(n,e){const t=n.text?n.text.length:0;return e*t}function Gk(n,e){return!!((n==="mousemove"||n==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(n==="click"||n==="mouseup"))}var bd={id:"legend",_element:gd,start(n,e,t){const i=n.legend=new gd({ctx:n.ctx,options:t,chart:n});Ie.configure(n,i,t),Ie.addBox(n,i)},stop(n){Ie.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,e,t){const i=n.legend;Ie.configure(n,i,t),i.options=t},afterUpdate(n){const e=n.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(n,e){e.replay||n.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,e,t){const i=e.datasetIndex,s=t.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const e=n.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(t?0:void 0),u=je(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class or extends xt{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,t){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;const s=Ce(i.text)?i.text.length:1;this._padding=je(i.padding);const o=s*Ve(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:t,left:i,bottom:s,right:o,options:a}=this,l=a.align;let c=0,d,u,f;return this.isHorizontal()?(u=Re(l,i,o),f=t+e,d=o-i):(a.position==="left"?(u=i+e,f=Re(l,s,t),c=ke*-.5):(u=o-e,f=Re(l,t,s),c=ke*.5),d=s-t),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const i=Ve(t.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);hn(e,t.text,0,0,i,{color:t.color,maxWidth:c,rotation:d,textAlign:No(t.align),textBaseline:"middle",translation:[a,l]})}}function Qk(n,e){const t=new or({ctx:n.ctx,options:e,chart:n});Ie.configure(n,t,e),Ie.addBox(n,t),n.titleBlock=t}var xd={id:"title",_element:or,start(n,e,t){Qk(n,t)},stop(n){const e=n.titleBlock;Ie.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){const i=n.titleBlock;Ie.configure(n,i,t),i.options=t},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 Ps=new WeakMap;var _d={id:"subtitle",start(n,e,t){const i=new or({ctx:n.ctx,options:t,chart:n});Ie.configure(n,i,t),Ie.addBox(n,i),Ps.set(n,i)},stop(n){Ie.removeBox(n,Ps.get(n)),Ps.delete(n)},beforeUpdate(n,e,t){const i=Ps.get(n);Ie.configure(n,i,t),i.options=t},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 Ai={average(n){if(!n.length)return!1;let e,t,i=new Set,s=0,o=0;for(e=0,t=n.length;e<t;++e){const l=n[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((l,c)=>l+c)/i.size,y:s/o}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=n.length;o<a;++o){const c=n[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=vo(e,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();t=c.x,i=c.y}return{x:t,y:i}}};function kt(n,e){return e&&(Ce(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function Ft(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
176
|
-
`)>-1?
|
|
177
|
-
`):n}function Jk(n,e){const{element:t,datasetIndex:i,index:s}=e,o=n.getDatasetMeta(i).controller,{label:a,value:l}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function kd(n,e){const t=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:l}=e,c=Ve(e.bodyFont),d=Ve(e.titleFont),u=Ve(e.footerFont),f=o.length,h=s.length,m=i.length,p=je(e.padding);let g=p.height,y=0,b=i.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*E+(b-m)*c.lineHeight+(b-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let _=0;const w=function(E){y=Math.max(y,t.measureText(E).width+_)};return t.save(),t.font=d.string,ge(n.title,w),t.font=c.string,ge(n.beforeBody.concat(n.afterBody),w),_=e.displayColors?a+2+e.boxPadding:0,ge(i,E=>{ge(E.before,w),ge(E.lines,w),ge(E.after,w)}),_=0,t.font=u.string,ge(n.footer,w),t.restore(),y+=p.width,{width:y,height:g}}function Zk(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function eS(n,e,t,i){const{x:s,width:o}=i,a=t.caretSize+t.caretPadding;if(n==="left"&&s+o+a>e.width||n==="right"&&s-o-a<0)return!0}function tS(n,e,t,i){const{x:s,width:o}=t,{width:a,chartArea:{left:l,right:c}}=n;let d="center";return i==="center"?d=s<=(l+c)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),eS(d,n,e,t)&&(d="center"),d}function Sd(n,e,t){const i=t.yAlign||e.yAlign||Zk(n,t);return{xAlign:t.xAlign||e.xAlign||tS(n,e,t,i),yAlign:i}}function nS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function iS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function wd(n,e,t,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:l,yAlign:c}=t,d=s+o,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=mn(a);let p=nS(e,l);const g=iS(e,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+s:l==="right"&&(p+=Math.max(f,m)+s),{x:Fe(p,0,i.width-e.width),y:Fe(g,0,i.height-e.height)}}function Bs(n,e,t){const i=je(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Ed(n){return kt([],Ft(n))}function sS(n,e,t){return Qt(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Cd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const vd={beforeTitle:Pt,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Pt,beforeBody:Pt,beforeLabel:Pt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return de(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Pt,afterBody:Pt,beforeFooter:Pt,footer:Pt,afterFooter:Pt};function Ue(n,e,t,i){const s=n[e].call(t,i);return typeof s>"u"?vd[e].call(t,i):s}class rr extends xt{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 t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,o=new Ro(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=sS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=Ue(i,"beforeTitle",this,e),o=Ue(i,"title",this,e),a=Ue(i,"afterTitle",this,e);let l=[];return l=kt(l,Ft(s)),l=kt(l,Ft(o)),l=kt(l,Ft(a)),l}getBeforeBody(e,t){return Ed(Ue(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return ge(e,o=>{const a={before:[],lines:[],after:[]},l=Cd(i,o);kt(a.before,Ft(Ue(l,"beforeLabel",this,o))),kt(a.lines,Ue(l,"label",this,o)),kt(a.after,Ft(Ue(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(e,t){return Ed(Ue(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,s=Ue(i,"beforeFooter",this,e),o=Ue(i,"footer",this,e),a=Ue(i,"afterFooter",this,e);let l=[];return l=kt(l,Ft(s)),l=kt(l,Ft(o)),l=kt(l,Ft(a)),l}_createItems(e){const t=this._active,i=this.chart.data,s=[],o=[],a=[];let l=[],c,d;for(c=0,d=t.length;c<d;++c)l.push(Jk(this.chart,t[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,i))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,i))),ge(l,u=>{const f=Cd(e.callbacks,u);s.push(Ue(f,"labelColor",this,u)),o.push(Ue(f,"labelPointStyle",this,u)),a.push(Ue(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Ai[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const c=this._size=kd(this,i),d=Object.assign({},l,c),u=Sd(this.chart,i,d),f=wd(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const o=this.getCaretPosition(e,i,s);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=mn(l),{x:h,y:m}=e,{width:p,height:g}=t;let y,b,_,w,E,k;return o==="center"?(E=m+g/2,s==="left"?(y=h,b=y-a,w=E+a,k=E-a):(y=h+p,b=y+a,w=E-a,k=E+a),_=y):(s==="left"?b=h+Math.max(c,u)+a:s==="right"?b=h+p-Math.max(d,f)-a:b=this.caretX,o==="top"?(w=m,E=w-a,y=b-a,_=b+a):(w=m+g,E=w+a,y=b+a,_=b-a),k=w),{x1:y,x2:b,x3:_,y1:w,y2:E,y3:k}}drawTitle(e,t,i){const s=this.title,o=s.length;let a,l,c;if(o){const d=Mn(i.rtl,this.x,this.width);for(e.x=Bs(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",a=Ve(i.titleFont),l=i.titleSpacing,t.fillStyle=i.titleColor,t.font=a.string,c=0;c<o;++c)t.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===o&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,t,i,s,o){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,u=Ve(o.bodyFont),f=Bs(this,"left",o),h=s.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=t.y+m;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=s.leftForLtr(h,d)+d/2,b=p+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,Mo(e,g,y,b),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Mo(e,g,y,b)}else{e.lineWidth=le(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const g=s.leftForLtr(h,d),y=s.leftForLtr(s.xPlus(h,1),d-2),b=mn(a.borderRadius);Object.values(b).some(_=>_!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,bi(e,{x:g,y:p,w:d,h:c,radius:b}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),bi(e,{x:y,y:p+1,w:d-2,h:c-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=a.backgroundColor,e.fillRect(y,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=i,f=Ve(i.bodyFont);let h=f.lineHeight,m=0;const p=Mn(i.rtl,this.x,this.width),g=function(x){t.fillText(x,p.x(e.x+m),e.y+h/2),e.y+=h+o},y=p.textAlign(a);let b,_,w,E,k,C,S;for(t.textAlign=a,t.textBaseline="middle",t.font=f.string,e.x=Bs(this,y,i),t.fillStyle=i.bodyColor,ge(this.beforeBody,g),m=l&&y!=="right"?a==="center"?d/2+u:d+2+u:0,E=0,C=s.length;E<C;++E){for(b=s[E],_=this.labelTextColors[E],t.fillStyle=_,ge(b.before,g),w=b.lines,l&&w.length&&(this._drawColorBox(t,e,E,p,i),h=Math.max(f.lineHeight,c)),k=0,S=w.length;k<S;++k)g(w[k]),h=f.lineHeight;ge(b.after,g)}m=0,h=f.lineHeight,ge(this.afterBody,g),e.y-=o}drawFooter(e,t,i){const s=this.footer,o=s.length;let a,l;if(o){const c=Mn(i.rtl,this.x,this.width);for(e.x=Bs(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=c.textAlign(i.footerAlign),t.textBaseline="middle",a=Ve(i.footerFont),t.fillStyle=i.footerColor,t.font=a.string,l=0;l<o;++l)t.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=i,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=mn(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(l+f,c),a==="top"&&this.drawCaret(e,t,i,s),t.lineTo(l+d-h,c),t.quadraticCurveTo(l+d,c,l+d,c+h),a==="center"&&o==="right"&&this.drawCaret(e,t,i,s),t.lineTo(l+d,c+u-p),t.quadraticCurveTo(l+d,c+u,l+d-p,c+u),a==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(l+m,c+u),t.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&o==="left"&&this.drawCaret(e,t,i,s),t.lineTo(l,c+f),t.quadraticCurveTo(l,c,l+f,c),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Ai[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=kd(this,e),c=Object.assign({},a,this._size),d=Sd(t,e,c),u=wd(e,c,d,t);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=je(t.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,s,t),Xl(e,t.textDirection),o.y+=a.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),Gl(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!ds(i,s),a=this._positionChanged(s,t);(o||a)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(e,o,t,i),l=this._positionChanged(a,e),c=t||!ds(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),c}_getActiveElements(e,t,i,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return t.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(e,t){const{caretX:i,caretY:s,options:o}=this,a=Ai[o.position].call(this,e,t);return a!==!1&&(i!==a.x||s!==a.y)}}z(rr,"positioners",Ai);var Dd={id:"tooltip",_element:rr,positioners:Ai,afterInit(n,e,t){t&&(n.tooltip=new rr({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,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:(n,e)=>e.bodyFont.size,boxWidth:(n,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:vd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nd=Object.freeze({__proto__:null,Colors:id,Decimation:rd,Filler:md,Legend:bd,SubTitle:_d,Title:xd,Tooltip:Dd});const oS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function rS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return oS(n,e,t,i);const o=n.lastIndexOf(e);return s!==o?t:s}const aS=(n,e)=>n===null?null:Fe(Math.round(n),0,e);function Od(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}class Ms extends Zt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:o}of t)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(de(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:rS(i,e,oe(t,e),this._addedLabels),aS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=e===0&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=e;a<=t;a++)s.push({value:a});return s}getLabelForValue(e){return Od.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 t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}z(Ms,"id","category"),z(Ms,"defaults",{ticks:{callback:Od}});function lS(n,e){const t=[],{bounds:s,step:o,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=n,m=o||1,p=u-1,{min:g,max:y}=e,b=!de(a),_=!de(l),w=!de(d),E=(y-g)/(f+1);let k=_l((y-g)/p/m)*m,C,S,x,v;if(k<1e-14&&!b&&!_)return[{value:g},{value:y}];v=Math.ceil(y/k)-Math.floor(g/k),v>p&&(k=_l(v*k/p/m)*m),de(c)||(C=Math.pow(10,c),k=Math.ceil(k*C)/C),s==="ticks"?(S=Math.floor(g/k)*k,x=Math.ceil(y/k)*k):(S=g,x=y),b&&_&&o&&y0((l-a)/o,k/1e3)?(v=Math.round(Math.min((l-a)/k,u)),k=(l-a)/v,S=a,x=l):w?(S=b?a:S,x=_?l:x,v=d-1,k=(x-S)/v):(v=(x-S)/k,fi(v,Math.round(v),k/1e3)?v=Math.round(v):v=Math.ceil(v));const B=Math.max(Sl(k),Sl(S));C=Math.pow(10,de(c)?B:c),S=Math.round(S*C)/C,x=Math.round(x*C)/C;let D=0;for(b&&(h&&S!==a?(t.push({value:a}),S<a&&D++,fi(Math.round((S+D*k)*C)/C,a,Td(a,E,n))&&D++):S<a&&D++);D<v;++D){const T=Math.round((S+D*k)*C)/C;if(_&&T>l)break;t.push({value:T})}return _&&h&&x!==l?t.length&&fi(t[t.length-1].value,l,Td(l,E,n))?t[t.length-1].value=l:t.push({value:l}):(!_||x===l)&&t.push({value:x}),t}function Td(n,e,{horizontal:t,minRotation:i}){const s=dt(i),o=(t?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+n).length;return Math.min(e/o,a)}class Vs extends Zt{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,t){return de(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=c=>s=t?s:c,l=c=>o=i?o:c;if(e){const c=yt(s),d=yt(o);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),e||a(s-c)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,a=lS(s,o);return e.bounds==="ticks"&&kl(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return pi(e,this.chart.options.locale,this.options.ticks.format)}}class As extends Vs{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ne(e)?e:0,this.max=Ne(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=dt(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}z(As,"id","linear"),z(As,"defaults",{ticks:{callback:gi.formatters.numeric}});const Fi=n=>Math.floor(Gt(n)),xn=(n,e)=>Math.pow(10,Fi(n)+e);function Pd(n){return n/Math.pow(10,Fi(n))===1}function Bd(n,e,t){const i=Math.pow(10,t),s=Math.floor(n/i);return Math.ceil(e/i)-s}function cS(n,e){const t=e-n;let i=Fi(t);for(;Bd(n,e,i)>10;)i++;for(;Bd(n,e,i)<10;)i--;return Math.min(i,Fi(n))}function dS(n,{min:e,max:t}){e=Xe(n.min,e);const i=[],s=Fi(e);let o=cS(e,t),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let f=Math.floor((d-u)/Math.pow(10,o)),h=Xe(n.min,Math.round((c+u+f*Math.pow(10,o))*a)/a);for(;h<t;)i.push({value:h,major:Pd(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),h=Math.round((c+u+f*Math.pow(10,o))*a)/a;const m=Xe(n.max,h);return i.push({value:m,major:Pd(m),significand:f}),i}class Fs extends Zt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Vs.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Ne(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ne(e)?Math.max(0,e):null,this.max=Ne(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ne(this._userMin)&&(this.min=e===xn(this.min,0)?xn(this.min,-1):xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const o=l=>i=e?i:l,a=l=>s=t?s:l;i===s&&(i<=0?(o(1),a(10)):(o(xn(i,-1)),a(xn(s,1)))),i<=0&&o(xn(s,-1)),s<=0&&a(xn(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=dS(t,this);return e.bounds==="ticks"&&kl(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":pi(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Gt(e),this._valueRange=Gt(this.max)-Gt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Gt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}z(Fs,"id","logarithmic"),z(Fs,"defaults",{ticks:{callback:gi.formatters.logarithmic,major:{enabled:!0}}});function ar(n){const e=n.ticks;if(e.display&&n.display){const t=je(e.backdropPadding);return oe(e.font&&e.font.size,we.font.size)+t.height}return 0}function uS(n,e,t){return t=Ce(t)?t:[t],{w:V0(n,e.string,t),h:t.length*e.lineHeight}}function Md(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function fS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],o=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?ke/o:0;for(let c=0;c<o;c++){const d=a.setContext(n.getPointLabelContext(c));s[c]=d.padding;const u=n.getPointPosition(c,n.drawingArea+s[c],l),f=Ve(d.font),h=uS(n.ctx,f,n._pointLabels[c]);i[c]=h;const m=Ge(n.getIndexAngle(c)+l),p=Math.round(Co(m)),g=Md(p,u.x,h.w,0,180),y=Md(p,u.y,h.h,90,270);hS(t,e,m,g,y)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=gS(n,i,s)}function hS(n,e,t,i,s){const o=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t));let l=0,c=0;i.start<e.l?(l=(e.l-i.start)/o,n.l=Math.min(n.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/o,n.r=Math.max(n.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,n.t=Math.min(n.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,n.b=Math.max(n.b,e.b+c))}function mS(n,e,t){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:l}=t,c=n.getPointPosition(e,i+s+a,o),d=Math.round(Co(Ge(c.angle+Te))),u=xS(c.y,l.h,d),f=yS(d),h=bS(c.x,l.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:h,top:u,right:h+l.w,bottom:u+l.h}}function pS(n,e){if(!e)return!0;const{left:t,top:i,right:s,bottom:o}=n;return!(Vt({x:t,y:i},e)||Vt({x:t,y:o},e)||Vt({x:s,y:i},e)||Vt({x:s,y:o},e))}function gS(n,e,t){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:ar(o)/2,additionalAngle:a?ke/s:0};let d;for(let u=0;u<s;u++){c.padding=t[u],c.size=e[u];const f=mS(n,u,c);i.push(f),l==="auto"&&(f.visible=pS(f,d),f.visible&&(d=f))}return i}function yS(n){return n===0||n===180?"center":n<180?"left":"right"}function bS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function xS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function _S(n,e,t){const{left:i,top:s,right:o,bottom:a}=t,{backdropColor:l}=e;if(!de(l)){const c=mn(e.borderRadius),d=je(e.backdropPadding);n.fillStyle=l;const u=i-d.left,f=s-d.top,h=o-i+d.width,m=a-s+d.height;Object.values(c).some(p=>p!==0)?(n.beginPath(),bi(n,{x:u,y:f,w:h,h:m,radius:c}),n.fill()):n.fillRect(u,f,h,m)}}function kS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(n.getPointLabelContext(s));_S(t,a,o);const l=Ve(a.font),{x:c,y:d,textAlign:u}=o;hn(t,n._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Vd(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,Se);else{let o=n.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=n.getPointPosition(a,e),s.lineTo(o.x,o.y)}}function SS(n,e,t,i,s){const o=n.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!i||!l||!c||t<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Vd(n,t,a,i),o.closePath(),o.stroke(),o.restore())}function wS(n,e,t){return Qt(n,{label:t,index:e,type:"pointLabel"})}class $n extends Vs{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=je(ar(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Ne(e)&&!isNaN(e)?e:0,this.max=Ne(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ar(this.options))}generateTickLabels(e){Vs.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=xe(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?fS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=Se/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ge(e*t+dt(i))}getDistanceFromCenterForValue(e){if(de(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(de(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return wS(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-Te+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:s,bottom:o}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Vd(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:s,border:o}=t,a=this._pointLabels.length;let l,c,d;if(t.pointLabels.display&&kS(this,a),s.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=s.setContext(h),p=o.setContext(h);SS(this,m,c,a,p)}}),i.display){for(e.save(),l=a-1;l>=0;l--){const u=i.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!t.reverse)return;const d=i.setContext(this.getContext(c)),u=Ve(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const f=je(d.backdropPadding);e.fillRect(-a/2-f.left,-o-u.size/2-f.top,a+f.width,u.size+f.height)}hn(e,l.label,0,-o,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}z($n,"id","radialLinear"),z($n,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:gi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),z($n,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z($n,"descriptors",{angleLines:{_fallback:"grid"}});const $s={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}},qe=Object.keys($s);function Ad(n,e){return n-e}function Fd(n,e){if(de(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let a=e;return typeof i=="function"&&(a=i(a)),Ne(a)||(a=typeof i=="string"?t.parse(a,i):t.parse(a)),a===null?null:(s&&(a=s==="week"&&(Tn(o)||o===!0)?t.startOf(a,"isoWeek",o):t.startOf(a,s)),+a)}function $d(n,e,t,i){const s=qe.length;for(let o=qe.indexOf(n);o<s-1;++o){const a=$s[qe[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-e)/(l*a.size))<=i)return qe[o]}return qe[s-1]}function ES(n,e,t,i,s){for(let o=qe.length-1;o>=qe.indexOf(t);o--){const a=qe[o];if($s[a].common&&n._adapter.diff(s,i,a)>=e-1)return a}return qe[t?qe.indexOf(t):0]}function CS(n){for(let e=qe.indexOf(n)+1,t=qe.length;e<t;++e)if($s[qe[e]].common)return qe[e]}function Id(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Do(t,e),o=t[i]>=e?t[i]:t[s];n[o]=!0}}function vS(n,e,t,i){const s=n._adapter,o=+s.startOf(e[0].value,i),a=e[e.length-1].value;let l,c;for(l=o;l<=a;l=+s.add(l,1,i))c=t[l],c>=0&&(e[c].major=!0);return e}function Ld(n,e,t){const i=[],s={},o=e.length;let a,l;for(a=0;a<o;++a)l=e[a],s[l]=a,i.push({value:l,major:!1});return o===0||!t?i:vS(n,i,s,t)}class In extends Zt{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,t={}){const i=e.time||(e.time={}),s=this._adapter=new gc._date(e.adapters.date);s.init(t),di(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Fd(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=Ne(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),o=Ne(o)&&!isNaN(o)?o:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,l=k0(s,o,a);return this._unit=t.unit||(i.autoSkip?$d(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):ES(this,l.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:CS(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),Ld(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,i=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;t=Fe(t,0,a),i=Fe(i,0,a),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||$d(o.minUnit,t,i,this._getLabelCapacity(t)),l=oe(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=Tn(c)||c===!0,u={};let f=t,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":a),e.diff(i,t,a)>1e5*l)throw new Error(t+" and "+i+" are too far apart with stepSize of "+l+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<i;h=+e.add(h,l,a),m++)Id(u,h,p);return(h===i||s.bounds==="ticks"||m===1)&&Id(u,h,p),Object.keys(u).sort(Ad).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const s=this.options.time.displayFormats,o=this._unit,a=t||s[o];return this._adapter.format(e,a)}_tickFormatFunction(e,t,i,s){const o=this.options,a=o.ticks.callback;if(a)return xe(a,[e,t,i],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=i[t],m=d&&f&&h&&h.major;return this._adapter.format(e,s||(m?f:u))}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=dt(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:i*o+l*a,h:i*a+l*o}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,o=this._tickFormatFunction(e,0,Ld(this,[e],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(Fd(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return vl(e.sort(Ad))}}z(In,"id","time"),z(In,"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 Is(n,e,t){let i=0,s=n.length-1,o,a,l,c;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Mt(n,"pos",e)),{pos:o,time:l}=n[i],{pos:a,time:c}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Mt(n,"time",e)),{time:o,pos:l}=n[i],{time:a,pos:c}=n[s]);const d=a-o;return d?l+(c-l)*(e-o)/d:l}class Ls extends In{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Is(t,this.min),this._tableRange=Is(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],o=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=t&&d<=i&&s.push(d);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&o.push({time:d,pos:a/(l-1)});return o}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Is(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Is(this._table,i*this._tableRange+this._minPos,!0)}}z(Ls,"id","timeseries"),z(Ls,"defaults",In.defaults);var Rd=Object.freeze({__proto__:null,CategoryScale:Ms,LinearScale:As,LogarithmicScale:Fs,RadialLinearScale:$n,TimeScale:In,TimeSeriesScale:Ls});const jd=[pc,Jc,Nd,Rd];_t.register(...jd);const DS=Object.freeze(Object.defineProperty({__proto__:null,Animation:sc,Animations:Ro,ArcElement:Fn,BarController:ki,BarElement:Vi,BasePlatform:Ko,BasicPlatform:Ec,BubbleController:Si,CategoryScale:Ms,Chart:_t,Colors:id,DatasetController:nt,Decimation:rd,DomPlatform:Oc,DoughnutController:Jt,Element:xt,Filler:md,Interaction:bc,Legend:bd,LineController:wi,LineElement:At,LinearScale:As,LogarithmicScale:Fs,PieController:ks,PointElement:Mi,PolarAreaController:Vn,RadarController:Ei,RadialLinearScale:$n,Scale:Zt,ScatterController:Ci,SubTitle:_d,Ticks:gi,TimeScale:In,TimeSeriesScale:Ls,Title:xd,Tooltip:Dd,_adapters:gc,_detectPlatform:Tc,animator:bt,controllers:pc,default:_t,defaults:we,elements:Jc,layouts:Ie,plugins:Nd,registerables:jd,registry:ut,scales:Rd},Symbol.toStringTag,{value:"Module"}));$e.default=By,$e.useEntitiesStore=Ya,$e.useGlobalConfigsStore=Ze,Object.defineProperties($e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
180
|
+
*/class XS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(l=>l({chart:e,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=ed.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,l=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),l=!0):(o[r]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,i,e,"progress")),o.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var vt=new XS;const Td="transparent",GS={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=rd(t||Td),s=i.valid&&rd(e||Td);return s&&s.valid?s.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Bd{constructor(e,n,i,s){const o=n[i];s=Ri([e.to,s,o,e.from]);const r=Ri([e.from,o,s]);this._active=!0,this._fn=e.fn||GS[e.type||typeof r],this._easing=Bi[e.easing]||Bi.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=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Ri([e.to,n,s,e.from]),this._from=Ri([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,l=this._to;let c;if(this._active=o!==l&&(r||n<i),!this._active){this._target[s]=l,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/i%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class Nr{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!de(e))return;const n=Object.keys(Ee.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!de(o))return;const r={};for(const l of n)r[l]=o[l];(Oe(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!i.has(l))&&i.set(l,r)})})}_animateOptions(e,n){const i=n.options,s=QS(e,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&JS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,n){const i=this._properties,s=[],o=e.$animations||(e.$animations={}),r=Object.keys(n),l=Date.now();let c;for(c=r.length-1;c>=0;--c){const d=r[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[d];let f=o[d];const h=i.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){e[d]=u;continue}o[d]=f=new Bd(h,e,d,u),s.push(f)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return vt.add(this._chart,i),!0}}function JS(t,e){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=t[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function QS(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 Pd(t,e){const n=t&&t.options||{},i=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:i?o:s,end:i?s:o}}function ZS(t,e,n){if(n===!1)return!1;const i=Pd(t,n),s=Pd(e,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function ew(t){let e,n,i,s;return de(t)?(e=t.top,n=t.right,i=t.bottom,s=t.left):e=n=i=s=t,{top:e,right:n,bottom:i,left:s,disabled:t===!1}}function Ad(t,e){const n=[],i=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Md(t,e,n,i={}){const s=t.keys,o=i.mode==="single";let r,l,c,d;if(e===null)return;let u=!1;for(r=0,l=s.length;r<l;++r){if(c=+s[r],c===n){if(u=!0,i.all)continue;break}d=t.values[c],Pe(d)&&(o||e===0||Ot(e)===Ot(d))&&(e+=d)}return!u&&!i.all?0:e}function tw(t,e){const{iScale:n,vScale:i}=e,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(t),l=new Array(r.length);let c,d,u;for(c=0,d=r.length;c<d;++c)u=r[c],l[c]={[s]:u,[o]:t[u]};return l}function Dr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function nw(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function iw(t){const{min:e,max:n,minDefined:i,maxDefined:s}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function sw(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Vd(t,e,n,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const o=t[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Rd(t,e){const{chart:n,_cachedMeta:i}=t,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:l}=i,c=o.axis,d=r.axis,u=nw(o,r,i),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[c]:g,[d]:y}=p,b=p._stacks||(p._stacks={});h=b[d]=sw(s,u,g),h[l]=y,h._top=Vd(h,r,!0,i.type),h._bottom=Vd(h,r,!1,i.type);const x=h._visualValues||(h._visualValues={});x[l]=y}}function Tr(t,e){const n=t.scales;return Object.keys(n).filter(i=>n[i].axis===e).shift()}function ow(t,e){return an(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function rw(t,e,n){return an(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Fi(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const s of e){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const Br=t=>t==="reset"||t==="none",Fd=(t,e)=>e?t:Object.assign({},t),aw=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Ad(n,!0),values:null};class lt{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=Dr(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&&Fi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,o=n.xAxisID=ae(i.xAxisID,Tr(e,"x")),r=n.yAxisID=ae(i.yAxisID,Tr(e,"y")),l=n.rAxisID=ae(i.rAxisID,Tr(e,"r")),c=n.indexAxis,d=n.iAxisID=s(c,o,r,l),u=n.vAxisID=s(c,r,o,l);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Qc(this._data,this),e._stacked&&Fi(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(de(n)){const s=this._cachedMeta;this._data=tw(n,s)}else if(i!==n){if(i){Qc(i,this);const s=this._cachedMeta;Fi(s),s._parsed=[]}n&&Object.isExtensible(n)&&Yk(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,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Dr(n.vScale,n),n.stack!==i.stack&&(s=!0,Fi(n),n.stack=i.stack),this._resyncElements(e),(s||o!==n._stacked)&&(Rd(this,n._parsed),n._stacked=Dr(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,l=o.axis;let c=e===0&&n===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],u,f,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Oe(s[e])?h=this.parseArrayData(i,s,e,n):de(s[e])?h=this.parseObjectData(i,s,e,n):h=this.parsePrimitiveData(i,s,e,n);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<n;++u)i._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);i._sorted=c}r&&Rd(this,h)}parsePrimitiveData(e,n,i,s){const{iScale:o,vScale:r}=e,l=o.axis,c=r.axis,d=o.getLabels(),u=o===r,f=new Array(s);let h,m,p;for(h=0,m=s;h<m;++h)p=h+i,f[h]={[l]:u||o.parse(d[p],p),[c]:r.parse(n[p],p)};return f}parseArrayData(e,n,i,s){const{xScale:o,yScale:r}=e,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=n[u],l[c]={x:o.parse(f[0],u),y:r.parse(f[1],u)};return l}parseObjectData(e,n,i,s){const{xScale:o,yScale:r}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,f,h,m;for(u=0,f=s;u<f;++u)h=u+i,m=n[h],d[u]={x:o.parse(sn(m,l),h),y:r.parse(sn(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,i){const s=this.chart,o=this._cachedMeta,r=n[e.axis],l={keys:Ad(s,!0),values:n._stacks[e.axis]._visualValues};return Md(l,r,o.index,{mode:i})}updateRangeFromParsed(e,n,i,s){const o=i[n.axis];let r=o===null?NaN:o;const l=s&&i._stacks[n.axis];s&&l&&(s.values=l,r=Md(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&e===i.iScale,r=s.length,l=this._getOtherScale(e),c=aw(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=iw(l);let h,m;function p(){m=s[h];const g=m[l.axis];return!Pe(m[e.axis])||u>g||f<g}for(h=0;h<r&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),o));++h);if(o){for(h=r-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][e.axis],Pe(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=ew(ae(this.options.clip,ZS(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(e,o,l,c),u=l;u<l+c;++u){const f=s[u];f.hidden||(f.active&&d?r.push(f):f.draw(e,o))}for(u=0;u<r.length;++u)r[u].draw(e,o)}getStyle(e,n){const i=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,n,i){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const r=this._cachedMeta.data[e];o=r.$context||(r.$context=rw(this.getContext(),e,r)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=ow(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",i){const s=n==="active",o=this._cachedDataOpts,r=e+"-"+n,l=o[r],c=this.enableOptionSharing&&Ni(i);if(l)return Fd(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ee.elements[e]),p=()=>this.getContext(i,s,n),g=d.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=c,o[r]=Object.freeze(Fd(g,c))),g}_resolveAnimations(e,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,l=o[r];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,i,n))}const d=new Nr(s,c&&c.animations);return c&&c._cacheable&&(o[r]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Br(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(e,n,i,s){Br(s)?Object.assign(e,i):this._resolveAnimations(n,s).update(e,i)}updateSharedOptions(e,n,i){e&&!Br(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,s){e.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"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,i=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,n,i=!0){const s=this._cachedMeta,o=s.data,r=e+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=r;l--)d[l]=d[l-n]};for(c(o),l=e;l<r;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,n),i&&this.updateElements(o,e,n,"reset")}updateElements(e,n,i,s){}_removeElements(e,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,n);i._stacked&&Fi(i,s)}i.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,i,s]=e;this[n](i,s)}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 i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}z(lt,"defaults",{}),z(lt,"datasetElementType",null),z(lt,"dataElementType",null);function lw(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(t));t._cache.$bar=Zc(i.sort((s,o)=>s-o))}return t._cache.$bar}function cw(t){const e=t.iScale,n=lw(e,t.type);let i=e._length,s,o,r,l;const c=()=>{r===32767||r===-32768||(Ni(l)&&(i=Math.min(i,Math.abs(r-l)||i)),l=r)};for(s=0,o=n.length;s<o;++s)r=e.getPixelForValue(n[s]),c();for(l=void 0,s=0,o=e.ticks.length;s<o;++s)r=e.getPixelForTick(s),c();return i}function dw(t,e,n,i){const s=n.barThickness;let o,r;return fe(s)?(o=e.min*n.categoryPercentage,r=n.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:e.pixels[t]-o/2}}function uw(t,e,n,i){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,l=t<s.length-1?s[t+1]:null;const c=n.categoryPercentage;r===null&&(r=o-(l===null?e.end-e.start:l-o)),l===null&&(l=o+o-r);const d=o-(o-Math.min(r,l))/2*c;return{chunk:Math.abs(l-r)/2*c/i,ratio:n.barPercentage,start:d}}function fw(t,e,n,i){const s=n.parse(t[0],i),o=n.parse(t[1],i),r=Math.min(s,o),l=Math.max(s,o);let c=r,d=l;Math.abs(r)>Math.abs(l)&&(c=l,d=r),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:o,min:r,max:l}}function $d(t,e,n,i){return Oe(t)?fw(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Ld(t,e,n,i){const s=t.iScale,o=t.vScale,r=s.getLabels(),l=s===o,c=[];let d,u,f,h;for(d=n,u=n+i;d<u;++d)h=e[d],f={},f[s.axis]=l||s.parse(r[d],d),c.push($d(h,f,o,d));return c}function Pr(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function hw(t,e,n){return t!==0?Ot(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function mw(t){let e,n,i,s,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:e,top:s,bottom:o}}function pw(t,e,n,i){let s=e.borderSkipped;const o={};if(!s){t.borderSkipped=o;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:l,reverse:c,top:d,bottom:u}=mw(t);s==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?s=d:(n._bottom||0)===i?s=u:(o[Id(u,r,l,c)]=!0,s=d)),o[Id(s,r,l,c)]=!0,t.borderSkipped=o}function Id(t,e,n,i){return i?(t=gw(t,e,n),t=jd(t,n,e)):t=jd(t,e,n),t}function gw(t,e,n){return t===e?n:t===n?e:t}function jd(t,e,n){return t==="start"?e:t==="end"?n:t}function yw(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class $i extends lt{parsePrimitiveData(e,n,i,s){return Ld(e,n,i,s)}parseArrayData(e,n,i,s){return Ld(e,n,i,s)}parseObjectData(e,n,i,s){const{iScale:o,vScale:r}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,u=r.axis==="x"?l:c,f=[];let h,m,p,g;for(h=i,m=i+s;h<m;++h)g=n[h],p={},p[o.axis]=o.parse(sn(g,d),h),f.push($d(sn(g,u),p,r,h));return f}updateRangeFromParsed(e,n,i,s){super.updateRangeFromParsed(e,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(e),r=o._custom,l=Pr(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:l}}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,i,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),g=o||fe(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),b=(p._stacks||{})[l.axis],x={horizontal:d,base:g.base,enableBorderRadius:!b||Pr(p._custom)||r===b._top||r===b._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};h&&(x.options=f||this.resolveDataElementOptions(m,e[m].active?"active":s));const w=x.options||e[m].options;pw(x,w,b,r),yw(x,w,u.ratio),this.updateElement(e[m],m,x,s)}}_getStacks(e,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,r=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[i.axis],d=u=>{const f=u._parsed.find(m=>m[i.axis]===c),h=f&&f[u.vScale.axis];if(fe(h)||isNaN(h))return!0};for(const u of s)if(!(n!==void 0&&d(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===e))break;return r.length||r.push(void 0),r}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const s=this._getStacks(e,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,r;for(o=0,r=n.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const l=e.barThickness;return{min:l||cw(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,l=o||0,c=this.getParsed(e),d=c._custom,u=Pr(d);let f=c[n.axis],h=0,m=i?this.applyStack(n,c,i):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Ot(f)!==Ot(d.barEnd)&&(h=0),h+=f);const y=!fe(o)&&!u?o:h;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(h+m):p=b,g=p-b,Math.abs(g)<r){g=hw(g,n,l)*r,f===l&&(b-=g/2);const x=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),E=Math.min(x,w),k=Math.max(x,w);b=Math.max(Math.min(b,k),E),p=b+g,i&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(l)){const x=Ot(g)*n.getLineWidthForValue(l)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,n){const i=n.scale,s=this.options,o=s.skipNull,r=ae(s.maxBarThickness,1/0);let l,c;if(n.grouped){const d=o?this._getStackCount(e):n.stackCount,u=s.barThickness==="flex"?uw(e,n,s,d):dw(e,n,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);l=u.start+u.chunk*f+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(r,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,i=e.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}z($i,"id","bar"),z($i,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z($i,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Li extends lt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,i,s){const o=super.parsePrimitiveData(e,n,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(e,n,i,s){const o=super.parseArrayData(e,n,i,s);for(let r=0;r<o.length;r++){const l=n[i+r];o[r]._custom=ae(l[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(e,n,i,s){const o=super.parseObjectData(e,n,i,s);for(let r=0;r<o.length;r++){const l=n[i+r];o[r]._custom=ae(l&&l.r&&+l.r,this.resolveDataElementOptions(r+i).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let i=e.length-1;i>=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,r=this.getParsed(e),l=s.getLabelForValue(r.x),c=o.getLabelForValue(r.y),d=r._custom;return{label:i[e]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,s){const o=s==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,s),u=r.axis,f=l.axis;for(let h=n;h<n+i;h++){const m=e[h],p=!o&&this.getParsed(h),g={},y=g[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),b=g[f]=o?l.getBasePixel():l.getPixelForValue(p[f]);g.skip=isNaN(y)||isNaN(b),d&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(e,n){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=ae(i&&i._custom,o),s}}z(Li,"id","bubble"),z(Li,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Li,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function bw(t,e,n){let i=1,s=1,o=0,r=0;if(e<we){const l=t,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,E,k)=>Ti(w,l,c,!0)?1:Math.max(E,E*n,k,k*n),p=(w,E,k)=>Ti(w,l,c,!0)?-1:Math.min(E,E*n,k,k*n),g=m(0,d,f),y=m(Me,u,h),b=p(Se,d,f),x=p(Se+Me,u,h);i=(g-b)/2,s=(y-x)/2,o=-(g+b)/2,r=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class ln extends lt{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(de(i[e])){const{key:c="value"}=this._parsing;o=d=>+sn(i[d],c)}let r,l;for(r=e,l=e+n;r<l;++r)s._parsed[r]=o(r)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let e=we,n=-we;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();e=Math.min(e,o),n=Math.max(n,o+r)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-r)/2,0),c=Math.min(Ak(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=bw(f,u,c),y=(i.width-r)/h,b=(i.height-r)/m,x=Math.max(Math.min(y,b)/2,0),w=zc(this.options.radius,x),E=Math.max(w*c,0),k=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/we)}updateElements(e,n,i,s){const o=s==="reset",r=this.chart,l=r.chartArea,d=r.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=o&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+i;++x){const w=this._circumference(x,o),E=e[x],k={x:u+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:m};y&&(k.options=g||this.resolveDataElementOptions(x,E.active?"active":s)),b+=w,this.updateElement(E,x,k,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let i=0,s;for(s=0;s<n.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?we*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Pi(n._parsed[e],i.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let n=0;const i=this.chart;let s,o,r,l,c;if(!e){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),e=r.data,l=r.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let i=0,s=e.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(e){return Math.max(ae(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(ln,"id","doughnut"),z(ln,"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"}),z(ln,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),z(ln,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((o,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class Ii extends lt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:l,count:c}=nd(n,s,r);this._drawStart=l,this._drawCount=c,id(n)&&(l=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:d},e),this.updateElements(s,l,c,e)}updateElements(e,n,i,s){const o=s==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),h=r.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=Un(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+i,w=e.length;let E=n>0&&this.getParsed(n-1);for(let k=0;k<w;++k){const C=e[k],S=b?C:{};if(k<n||k>=x){S.skip=!0;continue}const _=this.getParsed(k),O=fe(_[m]),P=S[h]=r.getPixelForValue(_[h],k),v=S[m]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,_,c):_[m],k);S.skip=isNaN(P)||isNaN(v)||O,S.stop=k>0&&Math.abs(_[h]-E[h])>y,g&&(S.parsed=_,S.raw=d.data[k]),f&&(S.options=u||this.resolveDataElementOptions(k,C.active?"active":s)),b||this.updateElement(C,k,S,s),E=_}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}z(Ii,"id","line"),z(Ii,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Ii,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Yn extends lt{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Pi(n._parsed[e].r,i.options.locale);return{label:s[e]||"",value:o}}parseObjectData(e,n,i,s){return bd.bind(this)(e,n,i,s)}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((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-r)/e.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,n,i,s){const o=s==="reset",r=this.chart,c=r.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,h=d.getIndexAngle(0)-.5*Se;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){const y=e[p];let b=m,x=m+this._computeAngle(p,s,g),w=r.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(c.animateScale&&(w=0),c.animateRotate&&(b=x=h));const E={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,E,s)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?yt(this.resolveDataElementOptions(e,n).angle||i):0}}z(Yn,"id","polarArea"),z(Yn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Yn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((o,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xs extends ln{}z(Xs,"id","pie"),z(Xs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ji extends lt{getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,s){return bd.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,e!=="resize"){const r=this.resolveDatasetElementOptions(e);this.options.showLine||(r.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,l,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let l=n;l<n+i;l++){const c=e[l],d=this.resolveDataElementOptions(l,c.active?"active":s),u=o.getPointPositionForValue(l,this.getParsed(l).r),f=r?o.xCenter:u.x,h=r?o.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:d};this.updateElement(c,l,m,s)}}}z(ji,"id","radar"),z(ji,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(ji,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class zi extends lt{getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,r=this.getParsed(e),l=s.getLabelForValue(r.x),c=o.getLabelForValue(r.y);return{label:i[e]||"",value:"("+l+", "+c+")"}}update(e){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:r}=nd(n,i,s);if(this._drawStart=o,this._drawCount=r,id(n)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=i;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,i,s){const o=s==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),f=this.getSharedOptions(u),h=this.includeOptions(s,f),m=r.axis,p=l.axis,{spanGaps:g,segment:y}=this.options,b=Un(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let w=n>0&&this.getParsed(n-1);for(let E=n;E<n+i;++E){const k=e[E],C=this.getParsed(E),S=x?k:{},_=fe(C[p]),O=S[m]=r.getPixelForValue(C[m],E),P=S[p]=o||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],E);S.skip=isNaN(O)||isNaN(P)||_,S.stop=E>0&&Math.abs(C[m]-w[m])>b,y&&(S.parsed=C,S.raw=d.data[E]),h&&(S.options=f||this.resolveDataElementOptions(E,k.active?"active":s)),x||this.updateElement(k,E,S,s),w=C}this.updateSharedOptions(f,s,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}}z(zi,"id","scatter"),z(zi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(zi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var zd=Object.freeze({__proto__:null,BarController:$i,BubbleController:Li,DoughnutController:ln,LineController:Ii,PieController:Xs,PolarAreaController:Yn,RadarController:ji,ScatterController:zi});function Dn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ar{constructor(e){z(this,"options");this.options=e||{}}static override(e){Object.assign(Ar.prototype,e)}init(){}formats(){return Dn()}parse(){return Dn()}format(){return Dn()}add(){return Dn()}diff(){return Dn()}startOf(){return Dn()}endOf(){return Dn()}}var Ud={_date:Ar};function xw(t,e,n,i){const{controller:s,data:o,_sorted:r}=t,l=s._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&r&&o.length){const c=l._reversePixels?Hk:zt;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,n-u),h=c(o,e,n+u);return{lo:f.lo,hi:h.hi}}}}else return c(o,e,n)}return{lo:0,hi:o.length-1}}function Ui(t,e,n,i,s){const o=t.getSortedVisibleDatasetMetas(),r=n[e];for(let l=0,c=o.length;l<c;++l){const{index:d,data:u}=o[l],{lo:f,hi:h}=xw(o[l],e,r,s);for(let m=f;m<=h;++m){const p=u[m];p.skip||i(p,d,m)}}}function _w(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(i,s){const o=e?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Mr(t,e,n,i,s){const o=[];return!s&&!t.isPointInArea(e)||Ui(t,n,e,function(l,c,d){!s&&!Ut(l,t.chartArea,0)||l.inRange(e.x,e.y,i)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function kw(t,e,n,i){let s=[];function o(r,l,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:f}=Gc(r,{x:e.x,y:e.y});Ti(f,d,u)&&s.push({element:r,datasetIndex:l,index:c})}return Ui(t,n,e,o),s}function Sw(t,e,n,i,s,o){let r=[];const l=_w(n);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||t.isPointInArea(p))&&!m)return;const y=l(e,p);y<c?(r=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&r.push({element:u,datasetIndex:f,index:h})}return Ui(t,n,e,d),r}function Vr(t,e,n,i,s,o){return!o&&!t.isPointInArea(e)?[]:n==="r"&&!i?kw(t,e,n,s):Sw(t,e,n,i,s,o)}function Wd(t,e,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let l=!1;return Ui(t,n,e,(c,d,u)=>{c[r]&&c[r](e[n],s)&&(o.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,s))}),i&&!l?[]:o}var Hd={evaluateInteractionItems:Ui,modes:{index(t,e,n,i){const s=vn(e,t),o=n.axis||"x",r=n.includeInvisible||!1,l=n.intersect?Mr(t,s,o,i,r):Vr(t,s,o,!1,i,r),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",r=n.includeInvisible||!1;let l=n.intersect?Mr(t,s,o,i,r):Vr(t,s,o,!1,i,r);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",r=n.includeInvisible||!1;return Mr(t,s,o,i,r)},nearest(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",r=n.includeInvisible||!1;return Vr(t,s,o,n.intersect,i,r)},x(t,e,n,i){const s=vn(e,t);return Wd(t,s,"x",n.intersect,i)},y(t,e,n,i){const s=vn(e,t);return Wd(t,s,"y",n.intersect,i)}}};const qd=["left","top","right","bottom"];function Wi(t,e){return t.filter(n=>n.pos===e)}function Yd(t,e){return t.filter(n=>qd.indexOf(n.pos)===-1&&n.box.axis===e)}function Hi(t,e){return t.sort((n,i)=>{const s=e?i:n,o=e?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ww(t){const e=[];let n,i,s,o,r,l;for(n=0,i=(t||[]).length;n<i;++n)s=t[n],{position:o,options:{stack:r,stackWeight:l=1}}=s,e.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:l});return e}function Ew(t){const e={};for(const n of t){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!qd.includes(s))continue;const r=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return e}function Cw(t,e){const n=Ew(t),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let o,r,l;for(o=0,r=t.length;o<r;++o){l=t[o];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*i:c&&e.availableWidth,l.height=s):(l.width=i,l.height=u?u*s:c&&e.availableHeight)}return n}function Ow(t){const e=ww(t),n=Hi(e.filter(d=>d.box.fullSize),!0),i=Hi(Wi(e,"left"),!0),s=Hi(Wi(e,"right")),o=Hi(Wi(e,"top"),!0),r=Hi(Wi(e,"bottom")),l=Yd(e,"x"),c=Yd(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(r).concat(l),chartArea:Wi(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(r).concat(l)}}function Kd(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Xd(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 vw(t,e,n,i){const{pos:s,box:o}=n,r=t.maxPadding;if(!de(s)){n.size&&(t[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,t[s]+=n.size}o.getPadding&&Xd(r,o.getPadding());const l=Math.max(0,e.outerWidth-Kd(r,t,"left","right")),c=Math.max(0,e.outerHeight-Kd(r,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function Nw(t){const e=t.maxPadding;function n(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Dw(t,e){const n=e.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(e[r],n[r])}),o}return i(t?["left","right"]:["top","bottom"])}function qi(t,e,n,i){const s=[];let o,r,l,c,d,u;for(o=0,r=t.length,d=0;o<r;++o){l=t[o],c=l.box,c.update(l.width||e.w,l.height||e.h,Dw(l.horizontal,e));const{same:f,other:h}=vw(e,n,l,i);d|=f&&s.length,u=u||h,c.fullSize||s.push(l)}return d&&qi(s,e,n,i)||u}function Gs(t,e,n,i,s){t.top=n,t.left=e,t.right=e+i,t.bottom=n+s,t.width=i,t.height=s}function Gd(t,e,n,i){const s=n.padding;let{x:o,y:r}=e;for(const l of t){const c=l.box,d=i[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;Ni(d.start)&&(r=d.start),c.fullSize?Gs(c,s.left,r,n.outerWidth-s.right-s.left,h):Gs(c,e.left+d.placed,r,f,h),d.start=r,d.placed+=f,r=c.bottom}else{const f=e.h*u,h=d.size||c.width;Ni(d.start)&&(o=d.start),c.fullSize?Gs(c,o,s.top,h,n.outerHeight-s.bottom-s.top):Gs(c,o,e.top+d.placed,h,f),d.start=o,d.placed+=f,o=c.right}}e.x=o,e.y=r}var je={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,i){if(!t)return;const s=He(t.options.layout.padding),o=Math.max(e-s.width,0),r=Math.max(n-s.height,0),l=Ow(t.boxes),c=l.vertical,d=l.horizontal;be(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),h=Object.assign({},s);Xd(h,He(i));const m=Object.assign({maxPadding:h,w:o,h:r,x:s.left,y:s.top},s),p=Cw(c.concat(d),f);qi(l.fullSize,m,f,p),qi(c,m,f,p),qi(d,m,f,p)&&qi(c,m,f,p),Nw(m),Gd(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Gd(l.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},be(l.chartArea,g=>{const y=g.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Rr{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,s){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Jd extends Rr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Js="$chartjs",Tw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Qd=t=>t===null||t==="";function Bw(t,e){const n=t.style,i=t.getAttribute("height"),s=t.getAttribute("width");if(t[Js]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Qd(s)){const o=kd(t,"width");o!==void 0&&(t.width=o)}if(Qd(i))if(t.style.height==="")t.height=t.width/(e||2);else{const o=kd(t,"height");o!==void 0&&(t.height=o)}return t}const Zd=$S?{passive:!0}:!1;function Pw(t,e,n){t&&t.addEventListener(e,n,Zd)}function Aw(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Zd)}function Mw(t,e){const n=Tw[t.type]||t.type,{x:i,y:s}=vn(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Qs(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Vw(t,e,n){const i=t.canvas,s=new MutationObserver(o=>{let r=!1;for(const l of o)r=r||Qs(l.addedNodes,i),r=r&&!Qs(l.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Rw(t,e,n){const i=t.canvas,s=new MutationObserver(o=>{let r=!1;for(const l of o)r=r||Qs(l.removedNodes,i),r=r&&!Qs(l.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Yi=new Map;let eu=0;function tu(){const t=window.devicePixelRatio;t!==eu&&(eu=t,Yi.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Fw(t,e){Yi.size||window.addEventListener("resize",tu),Yi.set(t,e)}function $w(t){Yi.delete(t),Yi.size||window.removeEventListener("resize",tu)}function Lw(t,e,n){const i=t.canvas,s=i&&vr(i);if(!s)return;const o=td((l,c)=>{const d=s.clientWidth;n(l,c),d<s.clientWidth&&n()},window),r=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||o(d,u)});return r.observe(s),Fw(t,o),r}function Fr(t,e,n){n&&n.disconnect(),e==="resize"&&$w(t)}function Iw(t,e,n){const i=t.canvas,s=td(o=>{t.ctx!==null&&n(Mw(o,t))},t);return Pw(i,e,s),s}class nu extends Rr{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Bw(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[Js])return!1;const i=n[Js].initial;["height","width"].forEach(o=>{const r=i[o];fe(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Js],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),r={attach:Vw,detach:Rw,resize:Lw}[n]||Iw;s[n]=r(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),s=i[n];if(!s)return;({attach:Fr,detach:Fr,resize:Fr}[n]||Aw)(e,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,s){return FS(e,n,i,s)}isAttached(e){const n=e&&vr(e);return!!(n&&n.isConnected)}}function iu(t){return!Or()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Jd:nu}let Nt=(po=class{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Un(this.x)&&Un(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const s={};return e.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},z(po,"defaults",{}),z(po,"defaultRoutes"),po);function jw(t,e){const n=t.options.ticks,i=zw(t),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Ww(e):[],r=o.length,l=o[0],c=o[r-1],d=[];if(r>s)return Hw(e,d,o,r/s),d;const u=Uw(o,e,s);if(r>0){let f,h;const m=r>1?Math.round((c-l)/(r-1)):null;for(Zs(e,d,u,fe(m)?0:l-m,l),f=0,h=r-1;f<h;f++)Zs(e,d,u,o[f],o[f+1]);return Zs(e,d,u,c,fe(m)?e.length:c+m),d}return Zs(e,d,u),d}function zw(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(i,s))}function Uw(t,e,n){const i=qw(t),s=e.length/n;if(!i)return Math.max(s,1);const o=jk(i);for(let r=0,l=o.length-1;r<l;r++){const c=o[r];if(c>s)return c}return Math.max(s,1)}function Ww(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}function Hw(t,e,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<t.length;r++)r===o&&(e.push(t[r]),s++,o=n[s*i])}function Zs(t,e,n,i,s){const o=ae(i,0),r=Math.min(ae(s,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),s&&(c=s-i,n=c/Math.floor(c/n)),u=o;u<0;)l++,u=Math.round(o+l*n);for(d=Math.max(o,0);d<r;d++)d===u&&(e.push(t[d]),l++,u=Math.round(o+l*n))}function qw(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}const Yw=t=>t==="left"?"right":t==="right"?"left":t,su=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,ou=(t,e)=>Math.min(e||t,t);function ru(t,e){const n=[],i=t.length/e,s=t.length;let o=0;for(;o<s;o+=i)n.push(t[Math.floor(o)]);return n}function Kw(t,e,n){const i=t.ticks.length,s=Math.min(e,i-1),o=t._startPixel,r=t._endPixel,l=1e-6;let c=t.getPixelForTick(s),d;if(!(n&&(i===1?d=Math.max(c-o,r-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<o-l||c>r+l)))return c}function Xw(t,e){be(t,n=>{const i=n.gc,s=i.length/2;let o;if(s>e){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ki(t){return t.drawTicks?t.tickLength:0}function au(t,e){if(!t.display)return 0;const n=$e(t.font,e),i=He(t.padding);return(Oe(t.text)?t.text.length:1)*n.lineHeight+i.height}function Gw(t,e){return an(t,{scale:e,type:"scale"})}function Jw(t,e,n){return an(t,{tick:n,index:e,type:"tick"})}function Qw(t,e,n){let i=gr(t);return(n&&e!=="right"||!n&&e==="right")&&(i=Yw(i)),i}function Zw(t,e,n,i){const{top:s,left:o,bottom:r,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,p;const g=r-s,y=l-o;if(t.isHorizontal()){if(m=We(i,o,l),de(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+g-e}else n==="center"?p=(d.bottom+d.top)/2+g-e:p=su(t,n,e);h=l-o}else{if(de(n)){const b=Object.keys(n)[0],x=n[b];m=u[b].getPixelForValue(x)-y+e}else n==="center"?m=(d.left+d.right)/2-y+e:m=su(t,n,e);p=We(i,r,s),f=n==="left"?-Me:Me}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class cn extends Nt{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:i,_suggestedMax:s}=this;return e=nt(e,Number.POSITIVE_INFINITY),n=nt(n,Number.NEGATIVE_INFINITY),i=nt(i,Number.POSITIVE_INFINITY),s=nt(s,Number.NEGATIVE_INFINITY),{min:nt(e,i),max:nt(n,s),minDefined:Pe(e),maxDefined:Pe(n)}}getMinMax(e){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)r=l[c].controller.getMinMax(this,e),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:nt(n,nt(i,n)),max:nt(i,nt(n,i))}}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(){ke(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,l=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=pS(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?ru(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=jw(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,e=!e),this._startPixel=n,this._endPixel=i,this._reversePixels=e,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ke(this.options.afterUpdate,[this])}beforeSetDimensions(){ke(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(){ke(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ke(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ke(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i],o.label=ke(n.callback,[o.value,i,e],this)}afterTickToLabelConversion(){ke(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ke(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,i=ou(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,l,c,d;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=Ie(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/i:m/(i-1),f+6>l&&(l=m/(i-(e.offset?.5:1)),c=this.maxHeight-Ki(e.grid)-n.padding-au(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),r=hr(Math.min(Math.asin(Ie((u.highest.height+6)/l,-1,1)),Math.asin(Ie(c/d,-1,1))-Math.asin(Ie(h/d,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){ke(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ke(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),l=this.isHorizontal();if(r){const c=au(s,n.options.font);if(l?(e.width=this.maxWidth,e.height=Ki(o)+c):(e.height=this.maxHeight,e.width=Ki(o)+c),i.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=i.padding*2,p=yt(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const b=i.mirror?0:y*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+b+m)}else{const b=i.mirror?0:g*f.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(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,i,s){const{ticks:{align:o,padding:r},position:l}=this.options,c=this.labelRotation!==0,d=l!=="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;c?d?(h=s*e.width,m=i*n.height):(h=i*e.height,m=s*n.width):o==="start"?m=n.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,m=n.width/2),this.paddingLeft=Math.max((h-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=e.height/2;o==="start"?(u=0,f=e.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ke(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,i;for(n=0,i=e.length;n<i;n++)fe(e[n].label)&&(e.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=ru(i,n)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,i){const{ctx:s,_longestTextCache:o}=this,r=[],l=[],c=Math.floor(n/ou(n,i));let d=0,u=0,f,h,m,p,g,y,b,x,w,E,k;for(f=0;f<n;f+=c){if(p=e[f].label,g=this._resolveTickFontOptions(f),s.font=y=g.string,b=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,w=E=0,!fe(p)&&!Oe(p))w=zs(s,b.data,b.gc,w,p),E=x;else if(Oe(p))for(h=0,m=p.length;h<m;++h)k=p[h],!fe(k)&&!Oe(k)&&(w=zs(s,b.data,b.gc,w,k),E+=x);r.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}Xw(o,n);const C=r.indexOf(d),S=l.indexOf(u),_=O=>({width:r[O]||0,height:l[O]||0});return{first:_(0),last:_(n-1),widest:_(C),highest:_(S),widths:r,heights:l}}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 Wk(this._alignToPixels?wn(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 i=n[e];return i.$context||(i.$context=Jw(this.getContext(),e,i))}return this.$context||(this.$context=Gw(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=yt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=e.autoSkipPadding||0,l=o?o.widest.width+r:0,c=o?o.highest.height+r:0;return this.isHorizontal()?c*i>l*s?l/i:c/s:c*s<l*i?c/i:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:l}=s,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Ki(o),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,b=function(L){return wn(i,L,g)};let x,w,E,k,C,S,_,O,P,v,T,R;if(r==="top")x=b(this.bottom),S=this.bottom-h,O=x-y,v=b(e.top)+y,R=e.bottom;else if(r==="bottom")x=b(this.top),v=e.top,R=b(e.bottom)-y,S=x+y,O=this.top+h;else if(r==="left")x=b(this.right),C=this.right-h,_=x-y,P=b(e.left)+y,T=e.right;else if(r==="right")x=b(this.left),P=e.left,T=b(e.right)-y,C=x+y,_=this.left+h;else if(n==="x"){if(r==="center")x=b((e.top+e.bottom)/2+.5);else if(de(r)){const L=Object.keys(r)[0],j=r[L];x=b(this.chart.scales[L].getPixelForValue(j))}v=e.top,R=e.bottom,S=x+y,O=S+h}else if(n==="y"){if(r==="center")x=b((e.left+e.right)/2);else if(de(r)){const L=Object.keys(r)[0],j=r[L];x=b(this.chart.scales[L].getPixelForValue(j))}C=x-y,_=C-h,P=e.left,T=e.right}const U=ae(s.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/U));for(w=0;w<f;w+=Y){const L=this.getContext(w),j=o.setContext(L),$=l.setContext(L),A=j.lineWidth,I=j.color,Q=$.dash||[],ne=$.dashOffset,se=j.tickWidth,K=j.tickColor,J=j.tickBorderDash||[],oe=j.tickBorderDashOffset;E=Kw(this,w,c),E!==void 0&&(k=wn(i,E,A),d?C=_=P=T=k:S=O=v=R=k,m.push({tx1:C,ty1:S,tx2:_,ty2:O,x1:P,y1:v,x2:T,y2:R,width:A,color:I,borderDash:Q,borderDashOffset:ne,tickWidth:se,tickColor:K,tickBorderDash:J,tickBorderDashOffset:oe}))}return this._ticksLength=f,this._borderValue=x,m}_computeLabelItems(e){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=o,h=Ki(i.grid),m=h+u,p=f?-u:m,g=-yt(this.labelRotation),y=[];let b,x,w,E,k,C,S,_,O,P,v,T,R="middle";if(s==="top")C=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const Y=this._getYAxisLabelAlignment(h);S=Y.textAlign,k=Y.x}else if(s==="right"){const Y=this._getYAxisLabelAlignment(h);S=Y.textAlign,k=Y.x}else if(n==="x"){if(s==="center")C=(e.top+e.bottom)/2+m;else if(de(s)){const Y=Object.keys(s)[0],L=s[Y];C=this.chart.scales[Y].getPixelForValue(L)+m}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(e.left+e.right)/2-m;else if(de(s)){const Y=Object.keys(s)[0],L=s[Y];k=this.chart.scales[Y].getPixelForValue(L)}S=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(c==="start"?R="top":c==="end"&&(R="bottom"));const U=this._getLabelSizes();for(b=0,x=l.length;b<x;++b){w=l[b],E=w.label;const Y=o.setContext(this.getContext(b));_=this.getPixelForTick(b)+o.labelOffset,O=this._resolveTickFontOptions(b),P=O.lineHeight,v=Oe(E)?E.length:1;const L=v/2,j=Y.color,$=Y.textStrokeColor,A=Y.textStrokeWidth;let I=S;r?(k=_,S==="inner"&&(b===x-1?I=this.options.reverse?"left":"right":b===0?I=this.options.reverse?"right":"left":I="center"),s==="top"?d==="near"||g!==0?T=-v*P+P/2:d==="center"?T=-U.highest.height/2-L*P+P:T=-U.highest.height+P/2:d==="near"||g!==0?T=P/2:d==="center"?T=U.highest.height/2-L*P:T=U.highest.height-v*P,f&&(T*=-1),g!==0&&!Y.showLabelBackdrop&&(k+=P/2*Math.sin(g))):(C=_,T=(1-v)*P/2);let Q;if(Y.showLabelBackdrop){const ne=He(Y.backdropPadding),se=U.heights[b],K=U.widths[b];let J=T-ne.top,oe=0-ne.left;switch(R){case"middle":J-=se/2;break;case"bottom":J-=se;break}switch(S){case"center":oe-=K/2;break;case"right":oe-=K;break;case"inner":b===x-1?oe-=K:b>0&&(oe-=K/2);break}Q={left:oe,top:J,width:K+ne.width,height:se+ne.height,color:Y.backdropColor}}y.push({label:E,font:O,textOffset:T,options:{rotation:g,color:j,strokeColor:$,strokeWidth:A,textAlign:I,textBaseline:R,translation:[k,C],backdrop:Q}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-yt(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),l=e+o,c=r.widest.width;let d,u;return n==="left"?s?(u=this.right+o,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,s,o,r),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,r;const l=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){const c=s[o];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=wn(e,this.left,r)-r/2,u=wn(e,this.right,l)+l/2,f=h=c):(f=wn(e,this.top,r)-r/2,h=wn(e,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Us(i,s);const o=this.getLabelItems(e);for(const r of o){const l=r.options,c=r.font,d=r.label,u=r.textOffset;En(i,d,0,u,c,l)}s&&Ws(i)}drawTitle(){const{ctx:e,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=$e(i.font),r=He(i.padding),l=i.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||de(n)?(c+=r.bottom,Oe(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=r.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=Zw(this,c,n,l);En(e,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:h,textAlign:Qw(l,n,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,i=ae(e.grid&&e.grid.z,-1),s=ae(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==cn.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o<r;++o){const l=n[o];l[i]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return $e(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class eo{constructor(e,n,i){this.type=e,this.scope=n,this.override=i,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 i;nE(n)&&(i=this.register(n));const s=this.items,o=e.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,eE(e,r,i),this.override&&Ee.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const n=this.items,i=e.id,s=this.scope;i in n&&delete n[i],s&&i in Ee[s]&&(delete Ee[s][i],this.override&&delete Sn[i])}}function eE(t,e,n){const i=Oi(Object.create(null),[n?Ee.get(n):{},Ee.get(e),t.defaults]);Ee.set(e,i),t.defaultRoutes&&tE(e,t.defaultRoutes),t.descriptors&&Ee.describe(e,t.descriptors)}function tE(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),s=i.pop(),o=[t].concat(i).join("."),r=e[n].split("."),l=r.pop(),c=r.join(".");Ee.route(o,s,c,l)})}function nE(t){return"id"in t&&"defaults"in t}class iE{constructor(){this.controllers=new eo(lt,"datasets",!0),this.elements=new eo(Nt,"elements"),this.plugins=new eo(Object,"plugins"),this.scales=new eo(cn,"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,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):be(s,r=>{const l=i||this._getRegistryForType(r);this._exec(e,l,r)})})}_exec(e,n,i){const s=fr(e);ke(i["before"+s],[],i),n[e](i),ke(i["after"+s],[],i)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(e))return i}return this.plugins}_get(e,n,i){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var bt=new iE;class sE{constructor(){this._init=[]}notify(e,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),r=this._notify(o,e,n,i);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,n,i,s){s=s||{};for(const o of e){const r=o.plugin,l=r[i],c=[n,s,o.options];if(ke(l,c,r)===!1&&s.cancelable)return!1}return!0}invalidate(){fe(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 i=e&&e.config,s=ae(i.options&&i.options.plugins,{}),o=oE(i);return s===!1&&!n?[]:aE(e,o,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(l=>!r.some(c=>l.plugin.id===c.plugin.id));this._notify(s(n,i),e,"stop"),this._notify(s(i,n),e,"start")}}function oE(t){const e={},n=[],i=Object.keys(bt.plugins.items);for(let o=0;o<i.length;o++)n.push(bt.getPlugin(i[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];n.indexOf(r)===-1&&(n.push(r),e[r.id]=!0)}return{plugins:n,localIds:e}}function rE(t,e){return!e&&t===!1?null:t===!0?{}:t}function aE(t,{plugins:e,localIds:n},i,s){const o=[],r=t.getContext();for(const l of e){const c=l.id,d=rE(i[c],s);d!==null&&o.push({plugin:l,options:lE(t.config,{plugin:l,local:n[c]},d,r)})}return o}function lE(t,{plugin:e,local:n},i,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(i,o);return n&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $r(t,e){const n=Ee.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function cE(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function dE(t,e){return t===e?"_index_":"_value_"}function lu(t){if(t==="x"||t==="y"||t==="r")return t}function uE(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Lr(t,...e){if(lu(t))return t;for(const n of e){const i=n.axis||uE(n.position)||t.length>1&&lu(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function cu(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function fE(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(n.length)return cu(t,"x",n[0])||cu(t,"y",n[0])}return{}}function hE(t,e){const n=Sn[t.type]||{scales:{}},i=e.scales||{},s=$r(t.type,e),o=Object.create(null);return Object.keys(i).forEach(r=>{const l=i[r];if(!de(l))return console.error(`Invalid scale configuration for scale: ${r}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=Lr(r,l,fE(r,t),Ee.scales[l.type]),d=dE(c,s),u=n.scales||{};o[r]=vi(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(r=>{const l=r.type||t.type,c=r.indexAxis||$r(l,e),u=(Sn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=cE(f,c),m=r[h+"AxisID"]||h;o[m]=o[m]||Object.create(null),vi(o[m],[{axis:h},i[m],u[f]])})}),Object.keys(o).forEach(r=>{const l=o[r];vi(l,[Ee.scales[l.type],Ee.scale])}),o}function du(t){const e=t.options||(t.options={});e.plugins=ae(e.plugins,{}),e.scales=hE(t,e)}function uu(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function mE(t){return t=t||{},t.data=uu(t.data),du(t),t}const fu=new Map,hu=new Set;function to(t,e){let n=fu.get(t);return n||(n=e(),fu.set(t,n),hu.add(n)),n}const Xi=(t,e,n)=>{const i=sn(e,n);i!==void 0&&t.add(i)};class pE{constructor(e){this._config=mE(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=uu(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(),du(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return to(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return to(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return to(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return to(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let s=i.get(e);return(!s||n)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,n,i){const{options:s,type:o}=this,r=this._cachedScopes(e,i),l=r.get(n);if(l)return l;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>Xi(c,e,f))),u.forEach(f=>Xi(c,s,f)),u.forEach(f=>Xi(c,Sn[o]||{},f)),u.forEach(f=>Xi(c,Ee,f)),u.forEach(f=>Xi(c,xr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),hu.has(n)&&r.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,Sn[n]||{},Ee.datasets[n]||{},{type:n},Ee,xr]}resolveNamedOptions(e,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:l}=mu(this._resolverCache,e,s);let c=r;if(yE(r,n)){o.$shared=!1,i=on(i)?i():i;const d=this.createResolver(e,i,l);c=Wn(r,i,d)}for(const d of n)o[d]=c[d];return o}createResolver(e,n,i=[""],s){const{resolver:o}=mu(this._resolverCache,e,i);return de(n)?Wn(o,n,void 0,s):o}}function mu(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const s=n.join();let o=i.get(s);return o||(o={resolver:wr(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(s,o)),o}const gE=t=>de(t)&&Object.getOwnPropertyNames(t).some(e=>on(t[e]));function yE(t,e){const{isScriptable:n,isIndexable:i}=fd(t);for(const s of e){const o=n(s),r=i(s),l=(r||o)&&t[s];if(o&&(on(l)||gE(l))||r&&Oe(l))return!0}return!1}var bE="4.4.7";const xE=["top","bottom","left","right","chartArea"];function pu(t,e){return t==="top"||t==="bottom"||xE.indexOf(t)===-1&&e==="x"}function gu(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function yu(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ke(n&&n.onComplete,[t],e)}function _E(t){const e=t.chart,n=e.options.animation;ke(n&&n.onProgress,[t],e)}function bu(t){return Or()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const no={},xu=t=>{const e=bu(t);return Object.values(no).filter(n=>n.canvas===e).pop()};function kE(t,e,n){const i=Object.keys(t);for(const s of i){const o=+s;if(o>=e){const r=t[s];delete t[s],(n>0||o>e)&&(t[o+n]=r)}}}function SE(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}function io(t,e,n){return t.options.clip?t[n]:e[n]}function wE(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:io(n,e,"left"),right:io(n,e,"right"),top:io(i,e,"top"),bottom:io(i,e,"bottom")}:e}class Dt{static register(...e){bt.add(...e),_u()}static unregister(...e){bt.remove(...e),_u()}constructor(e,n){const i=this.config=new pE(n),s=bu(e),o=xu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||iu(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,r.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Pk(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new sE,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kk(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],no[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}vt.listen(this,"complete",yu),vt.listen(this,"progress",_E),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return fe(e)?n&&o?o:s?i/s: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 bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_d(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cd(this.canvas,this.ctx),this}stop(){return vt.stop(this),this}resize(e,n){vt.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,e,n,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,_d(this,l,!0)&&(this.notifyPlugins("resize",{size:r}),ke(i.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};be(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,s=Object.keys(i).reduce((r,l)=>(r[l]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const l=n[r],c=Lr(r,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),be(o,r=>{const l=r.options,c=l.id,d=Lr(c,l),u=ae(l.type,r.dtype);(l.position===void 0||pu(l.position,d)!==pu(r.dposition))&&(l.position=r.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===u)f=i[c];else{const h=bt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(l,e)}),be(s,(r,l)=>{r||delete i[l]}),be(i,r=>{je.configure(this,r,r.options),je.addBox(this,r)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);e.splice(n,i-n)}this._sortedMetasets=e.slice(0).sort(gu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let r=this.getDatasetMeta(i);const l=o.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=l,r.indexAxis=o.indexAxis||$r(l,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const c=bt.getController(l),{datasetElementType:d,dataElementType:u}=Ee.datasets[l];Object.assign(c,{dataElementType:bt.getElement(u),datasetElementType:d&&bt.getElement(d)}),r.controller=new c(this,i),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){be(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 i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(h),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||be(o,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(gu("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){be(this.scales,e=>{je.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Hc(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;kE(e,s,r)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(e.filter(r=>r[0]===o).map((r,l)=>l+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!Hc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;je.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],be(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,on(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(vt.has(this)?this.attached&&!vt.running(this)&&vt.start(this):(this.draw(),yu({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}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,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const r=n[s];(!e||r.visible)&&i.push(r)}return i}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,i=e._clip,s=!i.disabled,o=wE(e,this.chartArea),r={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Us(n,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),e.controller.draw(),s&&Ws(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return Ut(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,s){const o=Hd.modes[n];return typeof o=="function"?o(this,e,i,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=an(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(e),r=o.controller._resolveAnimations(void 0,s);Ni(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(o,{visible:i}),this.update(l=>l.datasetIndex===e?s: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(),vt.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(),cd(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete no[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,i=(o,r)=>{n.addEventListener(this,o,r),e[o]=r},s=(o,r,l)=>{o.offsetX=r,o.offsetY=l,this._eventHandler(o)};be(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let r;const l=()=>{s("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():r()}unbindEvents(){be(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},be(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const s=i?"set":"remove";let o,r,l,c;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){r=e[l];const d=r&&this.getDatasetMeta(r.datasetIndex).controller;d&&d[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],i=e.map(({datasetIndex:o,index:r})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[r],index:r}});!$s(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,i){const s=this.options.hover,o=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=o(n,e),l=i?e:o(e,n);r.length&&this.updateHoverStyle(r,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=r=>(r.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:s=[],options:o}=this,r=n,l=this._getActiveElements(e,s,i,r),c=$k(e),d=SE(e,this._lastEvent,i,c);i&&(this._lastEvent=null,ke(o.onHover,[e,l,this],this),c&&ke(o.onClick,[e,l,this],this));const u=!$s(l,s);return(u||n)&&(this._active=l,this._updateHoverStyles(l,s,n)),this._lastEvent=d,u}_getActiveElements(e,n,i,s){if(e.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}z(Dt,"defaults",Ee),z(Dt,"instances",no),z(Dt,"overrides",Sn),z(Dt,"registry",bt),z(Dt,"version",bE),z(Dt,"getChart",xu);function _u(){return be(Dt.instances,t=>t._plugins.invalidate())}function EE(t,e,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:l,innerRadius:c}=e;let d=s/l;t.beginPath(),t.arc(o,r,l,i-d,n+d),c>s?(d=s/c,t.arc(o,r,c,n+d,i-d,!0)):t.arc(o,r,s,n+Me,i-Me),t.closePath(),t.clip()}function CE(t){return Sr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function OE(t,e,n,i){const s=CE(t.options.borderRadius),o=(n-e)/2,r=Math.min(o,i*e/2),l=c=>{const d=(n-Math.min(o,c))*i/2;return Ie(c,0,Math.min(o,d))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Ie(s.innerStart,0,r),innerEnd:Ie(s.innerEnd,0,r)}}function Kn(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function so(t,e,n,i,s,o){const{x:r,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+i+n-d,0),h=u>0?u+i+n+d:0;let m=0;const p=s-c;if(i){const Y=u>0?u-i:0,L=f>0?f-i:0,j=(Y+L)/2,$=j!==0?p*j/(j+i):p;m=(p-$)/2}const g=Math.max(.001,p*f-n/Se)/f,y=(p-g)/2,b=c+y+m,x=s-y-m,{outerStart:w,outerEnd:E,innerStart:k,innerEnd:C}=OE(e,h,f,x-b),S=f-w,_=f-E,O=b+w/S,P=x-E/_,v=h+k,T=h+C,R=b+k/v,U=x-C/T;if(t.beginPath(),o){const Y=(O+P)/2;if(t.arc(r,l,f,O,Y),t.arc(r,l,f,Y,P),E>0){const A=Kn(_,P,r,l);t.arc(A.x,A.y,E,P,x+Me)}const L=Kn(T,x,r,l);if(t.lineTo(L.x,L.y),C>0){const A=Kn(T,U,r,l);t.arc(A.x,A.y,C,x+Me,U+Math.PI)}const j=(x-C/h+(b+k/h))/2;if(t.arc(r,l,h,x-C/h,j,!0),t.arc(r,l,h,j,b+k/h,!0),k>0){const A=Kn(v,R,r,l);t.arc(A.x,A.y,k,R+Math.PI,b-Me)}const $=Kn(S,b,r,l);if(t.lineTo($.x,$.y),w>0){const A=Kn(S,O,r,l);t.arc(A.x,A.y,w,b-Me,O)}}else{t.moveTo(r,l);const Y=Math.cos(O)*f+r,L=Math.sin(O)*f+l;t.lineTo(Y,L);const j=Math.cos(P)*f+r,$=Math.sin(P)*f+l;t.lineTo(j,$)}t.closePath()}function vE(t,e,n,i,s){const{fullCircles:o,startAngle:r,circumference:l}=e;let c=e.endAngle;if(o){so(t,e,n,i,c,s);for(let d=0;d<o;++d)t.fill();isNaN(l)||(c=r+(l%we||we))}return so(t,e,n,i,c,s),t.fill(),c}function NE(t,e,n,i,s){const{fullCircles:o,startAngle:r,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=c,m=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,m?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let p=e.endAngle;if(o){so(t,e,n,i,p,s);for(let g=0;g<o;++g)t.stroke();isNaN(l)||(p=r+(l%we||we))}m&&EE(t,e,p),o||(so(t,e,n,i,p,s),t.stroke())}class Xn extends Nt{constructor(n){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(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,i,s){const o=this.getProps(["x","y"],s),{angle:r,distance:l}=Gc(o,{x:n,y:i}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=ae(h,d-c),g=Ti(r,c,d)&&c!==d,y=p>=we||g,b=jt(l,u+m,f+m);return y&&b}getCenterPoint(n){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(o+r)/2,h=(l+c+u+d)/2;return{x:i+Math.cos(f)*h,y:s+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>we?Math.floor(s/we):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(Se,s||0)),u=o*d;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,vE(n,this,u,r,l),NE(n,this,u,r,l),n.restore()}}z(Xn,"id","arc"),z(Xn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(Xn,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(Xn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function ku(t,e,n=e){t.lineCap=ae(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ae(n.borderDash,e.borderDash)),t.lineDashOffset=ae(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ae(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ae(n.borderWidth,e.borderWidth),t.strokeStyle=ae(n.borderColor,e.borderColor)}function DE(t,e,n){t.lineTo(n.x,n.y)}function TE(t){return t.stepped?rS:t.tension||t.cubicInterpolationMode==="monotone"?aS:DE}function Su(t,e,n={}){const i=t.length,{start:s=0,end:o=i-1}=n,{start:r,end:l}=e,c=Math.max(s,r),d=Math.min(o,l),u=s<r&&o<r||s>l&&o>l;return{count:i,start:c,loop:e.loop,ilen:d<c&&!u?i+d-c:d-c}}function BE(t,e,n,i){const{points:s,options:o}=e,{count:r,start:l,loop:c,ilen:d}=Su(s,n,i),u=TE(o);let{move:f=!0,reverse:h}=i||{},m,p,g;for(m=0;m<=d;++m)p=s[(l+(h?d-m:m))%r],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,g,p,h,o.stepped),g=p);return c&&(p=s[(l+(h?d:0))%r],u(t,g,p,h,o.stepped)),!!c}function PE(t,e,n,i){const s=e.points,{count:o,start:r,ilen:l}=Su(s,n,i),{move:c=!0,reverse:d}=i||{};let u=0,f=0,h,m,p,g,y,b;const x=E=>(r+(d?l-E:E))%o,w=()=>{g!==y&&(t.lineTo(u,y),t.lineTo(u,g),t.lineTo(u,b))};for(c&&(m=s[x(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=s[x(h)],m.skip)continue;const E=m.x,k=m.y,C=E|0;C===p?(k<g?g=k:k>y&&(y=k),u=(f*u+E)/++f):(w(),t.lineTo(E,k),p=C,f=0,g=y=k),b=k}w()}function Ir(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?PE:BE}function AE(t){return t.stepped?LS:t.tension||t.cubicInterpolationMode==="monotone"?IS:Nn}function ME(t,e,n,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,i)&&s.closePath()),ku(t,e.options),t.stroke(s)}function VE(t,e,n,i){const{segments:s,options:o}=e,r=Ir(e);for(const l of s)ku(t,o,l.style),t.beginPath(),r(t,e,l,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const RE=typeof Path2D=="function";function FE(t,e,n,i){RE&&!e.options.segment?ME(t,e,n,i):VE(t,e,n,i)}class Wt extends Nt{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;BS(this._points,i,e,s,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=qS(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,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,s=e[n],o=this.points,r=vd(this,{property:n,start:s,end:s});if(!r.length)return;const l=[],c=AE(i);let d,u;for(d=0,u=r.length;d<u;++d){const{start:f,end:h}=r[d],m=o[f],p=o[h];if(m===p){l.push(m);continue}const g=Math.abs((s-m[n])/(p[n]-m[n])),y=c(m,p,g,i.stepped);y[n]=e[n],l.push(y)}return l.length===1?l[0]:l}pathSegment(e,n,i){return Ir(this)(e,this,n,i)}path(e,n,i){const s=this.segments,o=Ir(this);let r=this._loop;n=n||0,i=i||this.points.length-n;for(const l of s)r&=o(e,this,l,{start:n,end:n+i-1});return!!r}draw(e,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),FE(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(Wt,"id","line"),z(Wt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(Wt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(Wt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function wu(t,e,n,i){const s=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<s.radius+s.hitRadius}class Gi extends Nt{constructor(n){super();z(this,"parsed");z(this,"skip");z(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,i,s){const o=this.options,{x:r,y:l}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return wu(this,n,"x",i)}inYRange(n,i){return wu(this,n,"y",i)}getCenterPoint(n){const{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);const s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){const s=this.options;this.skip||s.radius<.1||!Ut(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,kr(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}z(Gi,"id","point"),z(Gi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Eu(t,e){const{x:n,y:i,base:s,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return t.horizontal?(f=r/2,l=Math.min(n,s),c=Math.max(n,s),d=i-f,u=i+f):(f=o/2,l=n-f,c=n+f,d=Math.min(i,s),u=Math.max(i,s)),{left:l,top:d,right:c,bottom:u}}function dn(t,e,n,i){return t?0:Ie(e,n,i)}function $E(t,e,n){const i=t.options.borderWidth,s=t.borderSkipped,o=ud(i);return{t:dn(s.top,o.top,0,n),r:dn(s.right,o.right,0,e),b:dn(s.bottom,o.bottom,0,n),l:dn(s.left,o.left,0,e)}}function LE(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=Cn(s),r=Math.min(e,n),l=t.borderSkipped,c=i||de(s);return{topLeft:dn(!c||l.top||l.left,o.topLeft,0,r),topRight:dn(!c||l.top||l.right,o.topRight,0,r),bottomLeft:dn(!c||l.bottom||l.left,o.bottomLeft,0,r),bottomRight:dn(!c||l.bottom||l.right,o.bottomRight,0,r)}}function IE(t){const e=Eu(t),n=e.right-e.left,i=e.bottom-e.top,s=$E(t,n/2,i/2),o=LE(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function jr(t,e,n,i){const s=e===null,o=n===null,l=t&&!(s&&o)&&Eu(t,i);return l&&(s||jt(e,l.left,l.right))&&(o||jt(n,l.top,l.bottom))}function jE(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function zE(t,e){t.rect(e.x,e.y,e.w,e.h)}function zr(t,e,n={}){const i=t.x!==n.x?-e:0,s=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,r=(t.y+t.h!==n.y+n.h?e:0)-s;return{x:t.x+i,y:t.y+s,w:t.w+o,h:t.h+r,radius:t.radius}}class Ji extends Nt{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:i,backgroundColor:s}}=this,{inner:o,outer:r}=IE(this),l=jE(r.radius)?Vi:zE;e.save(),(r.w!==o.w||r.h!==o.h)&&(e.beginPath(),l(e,zr(r,n,o)),e.clip(),l(e,zr(o,-n,r)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),l(e,zr(o,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,i){return jr(this,e,n,i)}inXRange(e,n){return jr(this,e,null,n)}inYRange(e,n){return jr(this,null,e,n)}getCenterPoint(e){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}z(Ji,"id","bar"),z(Ji,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(Ji,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Cu=Object.freeze({__proto__:null,ArcElement:Xn,BarElement:Ji,LineElement:Wt,PointElement:Gi});const Ur=["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)"],Ou=Ur.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function vu(t){return Ur[t%Ur.length]}function Nu(t){return Ou[t%Ou.length]}function UE(t,e){return t.borderColor=vu(e),t.backgroundColor=Nu(e),++e}function WE(t,e){return t.backgroundColor=t.data.map(()=>vu(e++)),e}function HE(t,e){return t.backgroundColor=t.data.map(()=>Nu(e++)),e}function qE(t){let e=0;return(n,i)=>{const s=t.getDatasetMeta(i).controller;s instanceof ln?e=WE(n,e):s instanceof Yn?e=HE(n,e):s&&(e=UE(n,e))}}function Du(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function YE(t){return t&&(t.borderColor||t.backgroundColor)}function KE(){return Ee.borderColor!=="rgba(0,0,0,0.1)"||Ee.backgroundColor!=="rgba(0,0,0,0.1)"}var Tu={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=t.config,{elements:o}=s,r=Du(i)||YE(s)||o&&Du(o)||KE();if(!n.forceOverride&&r)return;const l=qE(t);i.forEach(l)}};function XE(t,e,n,i,s){const o=s.samples||i;if(o>=n)return t.slice(e,e+n);const r=[],l=(n-2)/(o-2);let c=0;const d=e+n-1;let u=e,f,h,m,p,g;for(r[c++]=t[u],f=0;f<o-2;f++){let y=0,b=0,x;const w=Math.floor((f+1)*l)+1+e,E=Math.min(Math.floor((f+2)*l)+1,n)+e,k=E-w;for(x=w;x<E;x++)y+=t[x].x,b+=t[x].y;y/=k,b/=k;const C=Math.floor(f*l)+1+e,S=Math.min(Math.floor((f+1)*l)+1,n)+e,{x:_,y:O}=t[u];for(m=p=-1,x=C;x<S;x++)p=.5*Math.abs((_-y)*(t[x].y-O)-(_-t[x].x)*(b-O)),p>m&&(m=p,h=t[x],g=x);r[c++]=h,u=g}return r[c++]=t[d],r}function GE(t,e,n,i){let s=0,o=0,r,l,c,d,u,f,h,m,p,g;const y=[],b=e+n-1,x=t[e].x,E=t[b].x-x;for(r=e;r<e+n;++r){l=t[r],c=(l.x-x)/E*i,d=l.y;const k=c|0;if(k===u)d<p?(p=d,f=r):d>g&&(g=d,h=r),s=(o*s+l.x)/++o;else{const C=r-1;if(!fe(f)&&!fe(h)){const S=Math.min(f,h),_=Math.max(f,h);S!==m&&S!==C&&y.push({...t[S],x:s}),_!==m&&_!==C&&y.push({...t[_],x:s})}r>0&&C!==m&&y.push(t[C]),y.push(l),u=k,o=0,p=g=d,f=h=m=r}}return y}function Bu(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 Pu(t){t.data.datasets.forEach(e=>{Bu(e)})}function JE(t,e){const n=e.length;let i=0,s;const{iScale:o}=t,{min:r,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=Ie(zt(e,o.axis,r).lo,0,n-1)),d?s=Ie(zt(e,o.axis,l).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var Au={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Pu(t);return}const i=t.width;t.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:l}=s,c=t.getDatasetMeta(o),d=r||s.data;if(Ri([l,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:h}=JE(c,d);const m=n.threshold||4*i;if(h<=m){Bu(s);return}fe(r)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=XE(d,f,h,i,n);break;case"min-max":p=GE(d,f,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(t){Pu(t)}};function QE(t,e,n){const i=t.segments,s=t.points,o=e.points,r=[];for(const l of i){let{start:c,end:d}=l;d=Hr(c,d,s);const u=Wr(n,s[c],s[d],l.loop);if(!e.segments){r.push({source:l,target:u,start:s[c],end:s[d]});continue}const f=vd(e,u);for(const h of f){const m=Wr(n,o[h.start],o[h.end],h.loop),p=Od(l,s,m);for(const g of p)r.push({source:g,target:h,start:{[n]:Mu(u,m,"start",Math.max)},end:{[n]:Mu(u,m,"end",Math.min)}})}}return r}function Wr(t,e,n,i){if(i)return;let s=e[t],o=n[t];return t==="angle"&&(s=it(s),o=it(o)),{property:t,start:s,end:o}}function ZE(t,e){const{x:n=null,y:i=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:r,end:l})=>{l=Hr(r,l,s);const c=s[r],d=s[l];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:d.y}))}),o}function Hr(t,e,n){for(;e>t;e--){const i=n[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Mu(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Vu(t,e){let n=[],i=!1;return Oe(t)?(i=!0,n=t):n=ZE(t,e),n.length?new Wt({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ru(t){return t&&t.fill!==!1}function eC(t,e,n){let s=t[e].fill;const o=[e];let r;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Pe(s))return s;if(r=t[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function tC(t,e,n){const i=oC(t);if(de(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Pe(s)&&Math.floor(s)===s?nC(i[0],e,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function nC(t,e,n,i){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=i?!1:n}function iC(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:de(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function sC(t,e,n){let i;return t==="start"?i=n:t==="end"?i=e.options.reverse?e.min:e.max:de(t)?i=t.value:i=e.getBaseValue(),i}function oC(t){const e=t.options,n=e.fill;let i=ae(n&&n.target,n);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function rC(t){const{scale:e,index:n,line:i}=t,s=[],o=i.segments,r=i.points,l=aC(e,n);l.push(Vu({x:null,y:e.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let u=d.start;u<=d.end;u++)lC(s,r[u],l)}return new Wt({points:s,options:{}})}function aC(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===e)break;o.hidden||n.unshift(o.dataset)}return n}function lC(t,e,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:r,last:l,point:c}=cC(o,e,"x");if(!(!c||r&&l)){if(r)i.unshift(c);else if(t.push(c),!l)break}}t.push(...i)}function cC(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const s=i[n],o=t.segments,r=t.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const u=o[d],f=r[u.start][n],h=r[u.end][n];if(jt(s,f,h)){l=s===f,c=s===h;break}}return{first:l,last:c,point:i}}class Fu{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,i){const{x:s,y:o,radius:r}=this;return n=n||{start:0,end:we},e.arc(s,o,r,n.end,n.start,!0),!i.bounds}interpolate(e){const{x:n,y:i,radius:s}=this,o=e.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function dC(t){const{chart:e,fill:n,line:i}=t;if(Pe(n))return uC(e,n);if(n==="stack")return rC(t);if(n==="shape")return!0;const s=fC(t);return s instanceof Fu?s:Vu(s,i)}function uC(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function fC(t){return(t.scale||{}).getPointPositionForValue?mC(t):hC(t)}function hC(t){const{scale:e={},fill:n}=t,i=iC(n,e);if(Pe(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function mC(t){const{scale:e,fill:n}=t,i=e.options,s=e.getLabels().length,o=i.reverse?e.max:e.min,r=sC(n,e,o),l=[];if(i.grid.circular){const c=e.getPointPositionForValue(0,o);return new Fu({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(r)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,r));return l}function qr(t,e,n){const i=dC(e),{line:s,scale:o,axis:r}=e,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:f=d}=c||{};i&&s.points.length&&(Us(t,n),pC(t,{line:s,target:i,above:u,below:f,area:n,scale:o,axis:r}),Ws(t))}function pC(t,e){const{line:n,target:i,above:s,below:o,area:r,scale:l}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&o!==s&&($u(t,i,r.top),Lu(t,{line:n,target:i,color:s,scale:l,property:c}),t.restore(),t.save(),$u(t,i,r.bottom)),Lu(t,{line:n,target:i,color:o,scale:l,property:c}),t.restore()}function $u(t,e,n){const{segments:i,points:s}=e;let o=!0,r=!1;t.beginPath();for(const l of i){const{start:c,end:d}=l,u=s[c],f=s[Hr(c,d,s)];o?(t.moveTo(u.x,u.y),o=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),r=!!e.pathSegment(t,l,{move:r}),r?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Lu(t,e){const{line:n,target:i,property:s,color:o,scale:r}=e,l=QE(n,i,s);for(const{source:c,target:d,start:u,end:f}of l){const{style:{backgroundColor:h=o}={}}=c,m=i!==!0;t.save(),t.fillStyle=h,gC(t,r,m&&Wr(s,u,f)),t.beginPath();const p=!!n.pathSegment(t,c);let g;if(m){p?t.closePath():Iu(t,i,f,s);const y=!!i.pathSegment(t,d,{move:p,reverse:!0});g=p&&y,g||Iu(t,i,u,s)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function gC(t,e,n){const{top:i,bottom:s}=e.chart.chartArea,{property:o,start:r,end:l}=n||{};o==="x"&&(t.beginPath(),t.rect(r,i,l-r,s-i),t.clip())}function Iu(t,e,n,i){const s=e.interpolate(n,i);s&&t.lineTo(s.x,s.y)}var ju={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,s=[];let o,r,l,c;for(r=0;r<i;++r)o=t.getDatasetMeta(r),l=o.dataset,c=null,l&&l.options&&l instanceof Wt&&(c={visible:t.isDatasetVisible(r),index:r,fill:tC(l,r,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(r=0;r<i;++r)c=s[r],!(!c||c.fill===!1)&&(c.fill=eC(s,r,n.propagate))},beforeDraw(t,e,n){const i=n.drawTime==="beforeDraw",s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let r=s.length-1;r>=0;--r){const l=s[r].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&qr(t.ctx,l,o))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=t.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Ru(o)&&qr(t.ctx,o,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;!Ru(i)||n.drawTime!=="beforeDatasetDraw"||qr(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const zu=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}},yC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Uu extends Nt{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,i){this.maxWidth=e,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=ke(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(i=>e.filter(i,this.chart.data))),e.sort&&(n=n.sort((i,s)=>e.sort(i,s,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 i=e.labels,s=$e(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=zu(i,o);let d,u;n.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(r,o,l,c)+10):(u=this.maxHeight,d=this._fitCols(r,s,l,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+l;let f=e;o.textAlign="left",o.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=i+n/2+o.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>r)&&(f+=u,d[d.length-(g>0?0:1)]=0,m+=u,h++),c[g]={left:0,top:m,row:h,width:y,height:s},d[d.length-1]+=y+l}),f}_fitCols(e,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=r-e;let f=l,h=0,m=0,p=0,g=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:w}=bC(i,n,o,y,s);b>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,g++,h=m=0),c[b]={left:p,top:m,col:g,width:x,height:w},h=Math.max(h,x),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=qn(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=We(i,this.left+s,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,c=We(i,this.left+s,this.right-this.lineWidths[l])),d.top+=this.top+e+s,d.left=r.leftForLtr(r.x(c),d.width),c+=d.width+s}else{let l=0,c=We(i,this.top+e+s,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,c=We(i,this.top+e+s,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+s,d.left=r.leftForLtr(r.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Us(e,this),this._draw(),Ws(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=e,l=Ee.color,c=qn(e.rtl,this.left,this.width),d=$e(r.font),{padding:u}=r,f=d.size,h=f/2;let m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=zu(r,f),b=function(C,S,_){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const O=ae(_.lineWidth,1);if(s.fillStyle=ae(_.fillStyle,l),s.lineCap=ae(_.lineCap,"butt"),s.lineDashOffset=ae(_.lineDashOffset,0),s.lineJoin=ae(_.lineJoin,"miter"),s.lineWidth=O,s.strokeStyle=ae(_.strokeStyle,l),s.setLineDash(ae(_.lineDash,[])),r.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},v=c.xPlus(C,p/2),T=S+h;dd(s,P,v,T,r.pointStyleWidth&&p)}else{const P=S+Math.max((f-g)/2,0),v=c.leftForLtr(C,p),T=Cn(_.borderRadius);s.beginPath(),Object.values(T).some(R=>R!==0)?Vi(s,{x:v,y:P,w:p,h:g,radius:T}):s.rect(v,P,p,g),s.fill(),O!==0&&s.stroke()}s.restore()},x=function(C,S,_){En(s,_.text,C,S+y/2,d,{strikethrough:_.hidden,textAlign:c.textAlign(_.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:We(o,this.left+u,this.right-i[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:We(o,this.top+E+u,this.bottom-n[0].height),line:0},Sd(this.ctx,e.textDirection);const k=y+u;this.legendItems.forEach((C,S)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const _=s.measureText(C.text).width,O=c.textAlign(C.textAlign||(C.textAlign=r.textAlign)),P=p+h+_;let v=m.x,T=m.y;c.setWidth(this.width),w?S>0&&v+P+u>this.right&&(T=m.y+=k,m.line++,v=m.x=We(o,this.left+u,this.right-i[m.line])):S>0&&T+k>this.bottom&&(v=m.x=v+n[m.line].width+u,m.line++,T=m.y=We(o,this.top+E+u,this.bottom-n[m.line].height));const R=c.x(v);if(b(R,T,C),v=Xk(O,v+p+h,w?v+P:this.right,e.rtl),x(c.x(v),T,C),w)m.x+=P+u;else if(typeof C.text!="string"){const U=d.lineHeight;m.y+=Wu(C,U)+u}else m.y+=k}),wd(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,i=$e(n.font),s=He(n.padding);if(!n.display)return;const o=qn(e.rtl,this.left,this.width),r=this.ctx,l=n.position,c=i.size/2,d=s.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=We(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+We(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=We(l,f,f+h);r.textAlign=o.textAlign(gr(l)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,En(r,n.text,m,u,i)}_computeTitleHeight(){const e=this.options.title,n=$e(e.font),i=He(e.padding);return e.display?n.lineHeight+i.height:0}_getLegendItemAt(e,n){let i,s,o;if(jt(e,this.left,this.right)&&jt(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],jt(e,s.left,s.left+s.width)&&jt(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){const n=this.options;if(!kC(e.type,n))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=yC(s,i);s&&!o&&ke(n.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!o&&ke(n.onHover,[e,i,this],this)}else i&&ke(n.onClick,[e,i,this],this)}}function bC(t,e,n,i,s){const o=xC(i,t,e,n),r=_C(s,i,e.lineHeight);return{itemWidth:o,itemHeight:r}}function xC(t,e,n,i){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),e+n.size/2+i.measureText(s).width}function _C(t,e,n){let i=t;return typeof e.text!="string"&&(i=Wu(e,n)),i}function Wu(t,e){const n=t.text?t.text.length:0;return e*n}function kC(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Hu={id:"legend",_element:Uu,start(t,e,n){const i=t.legend=new Uu({ctx:t.ctx,options:n,chart:t});je.configure(t,i,n),je.addBox(t,i)},stop(t){je.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;je.configure(t,i,n),i.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 i=e.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),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:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=He(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:r&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Yr extends Nt{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=Oe(i.text)?i.text.length:1;this._padding=He(i.padding);const o=s*$e(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:i,bottom:s,right:o,options:r}=this,l=r.align;let c=0,d,u,f;return this.isHorizontal()?(u=We(l,i,o),f=n+e,d=o-i):(r.position==="left"?(u=i+e,f=We(l,s,n),c=Se*-.5):(u=o-e,f=We(l,n,s),c=Se*.5),d=s-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const i=$e(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);En(e,n.text,0,0,i,{color:n.color,maxWidth:c,rotation:d,textAlign:gr(n.align),textBaseline:"middle",translation:[r,l]})}}function SC(t,e){const n=new Yr({ctx:t.ctx,options:e,chart:t});je.configure(t,n,e),je.addBox(t,n),t.titleBlock=n}var qu={id:"title",_element:Yr,start(t,e,n){SC(t,n)},stop(t){const e=t.titleBlock;je.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;je.configure(t,i,n),i.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 oo=new WeakMap;var Yu={id:"subtitle",start(t,e,n){const i=new Yr({ctx:t.ctx,options:n,chart:t});je.configure(t,i,n),je.addBox(t,i),oo.set(t,i)},stop(t){je.removeBox(t,oo.get(t)),oo.delete(t)},beforeUpdate(t,e,n){const i=oo.get(t);je.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qi={average(t){if(!t.length)return!1;let e,n,i=new Set,s=0,o=0;for(e=0,n=t.length;e<n;++e){const l=t[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((l,c)=>l+c)/i.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let n=e.x,i=e.y,s=Number.POSITIVE_INFINITY,o,r,l;for(o=0,r=t.length;o<r;++o){const c=t[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=mr(e,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,i=c.y}return{x:n,y:i}}};function Tt(t,e){return e&&(Oe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ht(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
181
|
+
`)>-1?t.split(`
|
|
182
|
+
`):t}function wC(t,e){const{element:n,datasetIndex:i,index:s}=e,o=t.getDatasetMeta(i).controller,{label:r,value:l}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Ku(t,e){const n=t.chart.ctx,{body:i,footer:s,title:o}=t,{boxWidth:r,boxHeight:l}=e,c=$e(e.bodyFont),d=$e(e.titleFont),u=$e(e.footerFont),f=o.length,h=s.length,m=i.length,p=He(e.padding);let g=p.height,y=0,b=i.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*E+(b-m)*c.lineHeight+(b-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let x=0;const w=function(E){y=Math.max(y,n.measureText(E).width+x)};return n.save(),n.font=d.string,be(t.title,w),n.font=c.string,be(t.beforeBody.concat(t.afterBody),w),x=e.displayColors?r+2+e.boxPadding:0,be(i,E=>{be(E.before,w),be(E.lines,w),be(E.after,w)}),x=0,n.font=u.string,be(t.footer,w),n.restore(),y+=p.width,{width:y,height:g}}function EC(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function CC(t,e,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(t==="left"&&s+o+r>e.width||t==="right"&&s-o-r<0)return!0}function OC(t,e,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:l,right:c}}=t;let d="center";return i==="center"?d=s<=(l+c)/2?"left":"right":s<=o/2?d="left":s>=r-o/2&&(d="right"),CC(d,t,e,n)&&(d="center"),d}function Xu(t,e,n){const i=n.yAlign||e.yAlign||EC(t,n);return{xAlign:n.xAlign||e.xAlign||OC(t,e,n,i),yAlign:i}}function vC(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function NC(t,e,n){let{y:i,height:s}=t;return e==="top"?i+=n:e==="bottom"?i-=s+n:i-=s/2,i}function Gu(t,e,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:l,yAlign:c}=n,d=s+o,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Cn(r);let p=vC(e,l);const g=NC(e,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+s:l==="right"&&(p+=Math.max(f,m)+s),{x:Ie(p,0,i.width-e.width),y:Ie(g,0,i.height-e.height)}}function ro(t,e,n){const i=He(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function Ju(t){return Tt([],Ht(t))}function DC(t,e,n){return an(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Qu(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Zu={beforeTitle:It,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:It,beforeBody:It,beforeLabel:It,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 fe(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:It,afterBody:It,beforeFooter:It,footer:It,afterFooter:It};function Je(t,e,n,i){const s=t[e].call(n,i);return typeof s>"u"?Zu[e].call(n,i):s}class Kr extends Nt{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new Nr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=DC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,s=Je(i,"beforeTitle",this,e),o=Je(i,"title",this,e),r=Je(i,"afterTitle",this,e);let l=[];return l=Tt(l,Ht(s)),l=Tt(l,Ht(o)),l=Tt(l,Ht(r)),l}getBeforeBody(e,n){return Ju(Je(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:i}=n,s=[];return be(e,o=>{const r={before:[],lines:[],after:[]},l=Qu(i,o);Tt(r.before,Ht(Je(l,"beforeLabel",this,o))),Tt(r.lines,Je(l,"label",this,o)),Tt(r.after,Ht(Je(l,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(e,n){return Ju(Je(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:i}=n,s=Je(i,"beforeFooter",this,e),o=Je(i,"footer",this,e),r=Je(i,"afterFooter",this,e);let l=[];return l=Tt(l,Ht(s)),l=Tt(l,Ht(o)),l=Tt(l,Ht(r)),l}_createItems(e){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(wC(this.chart,n[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,i))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,i))),be(l,u=>{const f=Qu(e.callbacks,u);s.push(Je(f,"labelColor",this,u)),o.push(Je(f,"labelPointStyle",this,u)),r.push(Je(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(e,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Qi[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const c=this._size=Ku(this,i),d=Object.assign({},l,c),u=Xu(this.chart,i,d),f=Gu(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,s){const o=this.getCaretPosition(e,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Cn(l),{x:h,y:m}=e,{width:p,height:g}=n;let y,b,x,w,E,k;return o==="center"?(E=m+g/2,s==="left"?(y=h,b=y-r,w=E+r,k=E-r):(y=h+p,b=y+r,w=E-r,k=E+r),x=y):(s==="left"?b=h+Math.max(c,u)+r:s==="right"?b=h+p-Math.max(d,f)-r:b=this.caretX,o==="top"?(w=m,E=w-r,y=b-r,x=b+r):(w=m+g,E=w+r,y=b+r,x=b-r),k=w),{x1:y,x2:b,x3:x,y1:w,y2:E,y3:k}}drawTitle(e,n,i){const s=this.title,o=s.length;let r,l,c;if(o){const d=qn(i.rtl,this.x,this.width);for(e.x=ro(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",r=$e(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,c=0;c<o;++c)n.fillText(s[c],d.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+l,c+1===o&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,n,i,s,o){const r=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,u=$e(o.bodyFont),f=ro(this,"left",o),h=s.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=s.leftForLtr(h,d)+d/2,b=p+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,kr(e,g,y,b),e.strokeStyle=r.borderColor,e.fillStyle=r.backgroundColor,kr(e,g,y,b)}else{e.lineWidth=de(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,e.strokeStyle=r.borderColor,e.setLineDash(r.borderDash||[]),e.lineDashOffset=r.borderDashOffset||0;const g=s.leftForLtr(h,d),y=s.leftForLtr(s.xPlus(h,1),d-2),b=Cn(r.borderRadius);Object.values(b).some(x=>x!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,Vi(e,{x:g,y:p,w:d,h:c,radius:b}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),Vi(e,{x:y,y:p+1,w:d-2,h:c-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=r.backgroundColor,e.fillRect(y,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=i,f=$e(i.bodyFont);let h=f.lineHeight,m=0;const p=qn(i.rtl,this.x,this.width),g=function(_){n.fillText(_,p.x(e.x+m),e.y+h/2),e.y+=h+o},y=p.textAlign(r);let b,x,w,E,k,C,S;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,e.x=ro(this,y,i),n.fillStyle=i.bodyColor,be(this.beforeBody,g),m=l&&y!=="right"?r==="center"?d/2+u:d+2+u:0,E=0,C=s.length;E<C;++E){for(b=s[E],x=this.labelTextColors[E],n.fillStyle=x,be(b.before,g),w=b.lines,l&&w.length&&(this._drawColorBox(n,e,E,p,i),h=Math.max(f.lineHeight,c)),k=0,S=w.length;k<S;++k)g(w[k]),h=f.lineHeight;be(b.after,g)}m=0,h=f.lineHeight,be(this.afterBody,g),e.y-=o}drawFooter(e,n,i){const s=this.footer,o=s.length;let r,l;if(o){const c=qn(i.rtl,this.x,this.width);for(e.x=ro(this,i.footerAlign,i),e.y+=i.footerMarginTop,n.textAlign=c.textAlign(i.footerAlign),n.textBaseline="middle",r=$e(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+i.footerSpacing}}drawBackground(e,n,i,s){const{xAlign:o,yAlign:r}=this,{x:l,y:c}=e,{width:d,height:u}=i,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=Cn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+f,c),r==="top"&&this.drawCaret(e,n,i,s),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),r==="center"&&o==="right"&&this.drawCaret(e,n,i,s),n.lineTo(l+d,c+u-p),n.quadraticCurveTo(l+d,c+u,l+d-p,c+u),r==="bottom"&&this.drawCaret(e,n,i,s),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),r==="center"&&o==="left"&&this.drawCaret(e,n,i,s),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Qi[e.position].call(this,this._active,this._eventPosition);if(!r)return;const l=this._size=Ku(this,e),c=Object.assign({},r,this._size),d=Xu(n,e,c),u=Gu(e,c,d,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=He(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,s,n),Sd(e,n.textDirection),o.y+=r.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),wd(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!$s(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(e,o,n,i),l=this._positionChanged(r,e),c=n||!$s(r,o)||l;return c&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,i,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(e,n){const{caretX:i,caretY:s,options:o}=this,r=Qi[o.position].call(this,e,n);return r!==!1&&(i!==r.x||s!==r.y)}}z(Kr,"positioners",Qi);var ef={id:"tooltip",_element:Kr,positioners:Qi,afterInit(t,e,n){n&&(t.tooltip=new Kr({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:Zu},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"]},tf=Object.freeze({__proto__:null,Colors:Tu,Decimation:Au,Filler:ju,Legend:Hu,SubTitle:Yu,Title:qu,Tooltip:ef});const TC=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function BC(t,e,n,i){const s=t.indexOf(e);if(s===-1)return TC(t,e,n,i);const o=t.lastIndexOf(e);return s!==o?n:s}const PC=(t,e)=>t===null?null:Ie(Math.round(t),0,e);function nf(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ao extends cn{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(fe(e))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===e?n:BC(i,e,ae(n,e),this._addedLabels),PC(n,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=e;r<=n;r++)s.push({value:r});return s}getLabelForValue(e){return nf.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}}z(ao,"id","category"),z(ao,"defaults",{ticks:{callback:nf}});function AC(t,e){const n=[],{bounds:s,step:o,min:r,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=o||1,p=u-1,{min:g,max:y}=e,b=!fe(r),x=!fe(l),w=!fe(d),E=(y-g)/(f+1);let k=Yc((y-g)/p/m)*m,C,S,_,O;if(k<1e-14&&!b&&!x)return[{value:g},{value:y}];O=Math.ceil(y/k)-Math.floor(g/k),O>p&&(k=Yc(O*k/p/m)*m),fe(c)||(C=Math.pow(10,c),k=Math.ceil(k*C)/C),s==="ticks"?(S=Math.floor(g/k)*k,_=Math.ceil(y/k)*k):(S=g,_=y),b&&x&&o&&zk((l-r)/o,k/1e3)?(O=Math.round(Math.min((l-r)/k,u)),k=(l-r)/O,S=r,_=l):w?(S=b?r:S,_=x?l:_,O=d-1,k=(_-S)/O):(O=(_-S)/k,Di(O,Math.round(O),k/1e3)?O=Math.round(O):O=Math.ceil(O));const P=Math.max(Xc(k),Xc(S));C=Math.pow(10,fe(c)?P:c),S=Math.round(S*C)/C,_=Math.round(_*C)/C;let v=0;for(b&&(h&&S!==r?(n.push({value:r}),S<r&&v++,Di(Math.round((S+v*k)*C)/C,r,sf(r,E,t))&&v++):S<r&&v++);v<O;++v){const T=Math.round((S+v*k)*C)/C;if(x&&T>l)break;n.push({value:T})}return x&&h&&_!==l?n.length&&Di(n[n.length-1].value,l,sf(l,E,t))?n[n.length-1].value=l:n.push({value:l}):(!x||_===l)&&n.push({value:_}),n}function sf(t,e,{horizontal:n,minRotation:i}){const s=yt(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class lo extends cn{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 fe(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=c=>s=n?s:c,l=c=>o=i?o:c;if(e){const c=Ot(s),d=Ot(o);c<0&&d<0?l(0):c>0&&d>0&&r(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),e||r(s-c)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},o=this._range||this,r=AC(s,o);return e.bounds==="ticks"&&Kc(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-n)/Math.max(e.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Pi(e,this.chart.options.locale,this.options.ticks.format)}}class co extends lo{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Pe(e)?e:0,this.max=Pe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=yt(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}z(co,"id","linear"),z(co,"defaults",{ticks:{callback:Ai.formatters.numeric}});const Zi=t=>Math.floor(rn(t)),Tn=(t,e)=>Math.pow(10,Zi(t)+e);function of(t){return t/Math.pow(10,Zi(t))===1}function rf(t,e,n){const i=Math.pow(10,n),s=Math.floor(t/i);return Math.ceil(e/i)-s}function MC(t,e){const n=e-t;let i=Zi(n);for(;rf(t,e,i)>10;)i++;for(;rf(t,e,i)<10;)i--;return Math.min(i,Zi(t))}function VC(t,{min:e,max:n}){e=nt(t.min,e);const i=[],s=Zi(e);let o=MC(e,n),r=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((e-c)*r)/r,u=Math.floor((e-c)/l/10)*l*10;let f=Math.floor((d-u)/Math.pow(10,o)),h=nt(t.min,Math.round((c+u+f*Math.pow(10,o))*r)/r);for(;h<n;)i.push({value:h,major:of(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),h=Math.round((c+u+f*Math.pow(10,o))*r)/r;const m=nt(t.max,h);return i.push({value:m,major:of(m),significand:f}),i}class uo extends cn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=lo.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return Pe(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Pe(e)?Math.max(0,e):null,this.max=Pe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pe(this._userMin)&&(this.min=e===Tn(this.min,0)?Tn(this.min,-1):Tn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=l=>i=e?i:l,r=l=>s=n?s:l;i===s&&(i<=0?(o(1),r(10)):(o(Tn(i,-1)),r(Tn(s,1)))),i<=0&&o(Tn(s,-1)),s<=0&&r(Tn(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=VC(n,this);return e.bounds==="ticks"&&Kc(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Pi(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=rn(e),this._valueRange=rn(this.max)-rn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(rn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}z(uo,"id","logarithmic"),z(uo,"defaults",{ticks:{callback:Ai.formatters.logarithmic,major:{enabled:!0}}});function Xr(t){const e=t.ticks;if(e.display&&t.display){const n=He(e.backdropPadding);return ae(e.font&&e.font.size,Ee.font.size)+n.height}return 0}function RC(t,e,n){return n=Oe(n)?n:[n],{w:oS(t,e.string,n),h:n.length*e.lineHeight}}function af(t,e,n,i,s){return t===i||t===s?{start:e-n/2,end:e+n/2}:t<i||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function FC(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),i=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,l=r.centerPointLabels?Se/o:0;for(let c=0;c<o;c++){const d=r.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],l),f=$e(d.font),h=RC(t.ctx,f,t._pointLabels[c]);i[c]=h;const m=it(t.getIndexAngle(c)+l),p=Math.round(hr(m)),g=af(p,u.x,h.w,0,180),y=af(p,u.y,h.h,90,270);$C(n,e,m,g,y)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=jC(t,i,s)}function $C(t,e,n,i,s){const o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let l=0,c=0;i.start<e.l?(l=(e.l-i.start)/o,t.l=Math.min(t.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/o,t.r=Math.max(t.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/r,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+c))}function LC(t,e,n){const i=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:l}=n,c=t.getPointPosition(e,i+s+r,o),d=Math.round(hr(it(c.angle+Me))),u=WC(c.y,l.h,d),f=zC(d),h=UC(c.x,l.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:h,top:u,right:h+l.w,bottom:u+l.h}}function IC(t,e){if(!e)return!0;const{left:n,top:i,right:s,bottom:o}=t;return!(Ut({x:n,y:i},e)||Ut({x:n,y:o},e)||Ut({x:s,y:i},e)||Ut({x:s,y:o},e))}function jC(t,e,n){const i=[],s=t._pointLabels.length,o=t.options,{centerPointLabels:r,display:l}=o.pointLabels,c={extra:Xr(o)/2,additionalAngle:r?Se/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const f=LC(t,u,c);i.push(f),l==="auto"&&(f.visible=IC(f,d),f.visible&&(d=f))}return i}function zC(t){return t===0||t===180?"center":t<180?"left":"right"}function UC(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function WC(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function HC(t,e,n){const{left:i,top:s,right:o,bottom:r}=n,{backdropColor:l}=e;if(!fe(l)){const c=Cn(e.borderRadius),d=He(e.backdropPadding);t.fillStyle=l;const u=i-d.left,f=s-d.top,h=o-i+d.width,m=r-s+d.height;Object.values(c).some(p=>p!==0)?(t.beginPath(),Vi(t,{x:u,y:f,w:h,h:m,radius:c}),t.fill()):t.fillRect(u,f,h,m)}}function qC(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let s=e-1;s>=0;s--){const o=t._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(t.getPointLabelContext(s));HC(n,r,o);const l=$e(r.font),{x:c,y:d,textAlign:u}=o;En(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:r.color,textAlign:u,textBaseline:"middle"})}}function lf(t,e,n,i){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,we);else{let o=t.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=t.getPointPosition(r,e),s.lineTo(o.x,o.y)}}function YC(t,e,n,i,s){const o=t.ctx,r=e.circular,{color:l,lineWidth:c}=e;!r&&!i||!l||!c||n<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),lf(t,n,r,i),o.closePath(),o.stroke(),o.restore())}function KC(t,e,n){return an(t,{label:n,index:e,type:"pointLabel"})}class Gn extends lo{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=He(Xr(this.options)/2),n=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Pe(e)&&!isNaN(e)?e:0,this.max=Pe(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Xr(this.options))}generateTickLabels(e){lo.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,i)=>{const s=ke(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?FC(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,s))}getIndexAngle(e){const n=we/(this._pointLabels.length||1),i=this.options.startAngle||0;return it(e*n+yt(i))}getDistanceFromCenterForValue(e){if(fe(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(fe(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 i=n[e];return KC(this.getContext(),e,i)}}getPointPosition(e,n,i=0){const s=this.getIndexAngle(e)-Me+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}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:i,right:s,bottom:o}=this._pointLabelItems[e];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),lf(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length;let l,c,d;if(n.pointLabels.display&&qC(this,r),s.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=s.setContext(h),p=o.setContext(h);YC(this,m,c,r,p)}}),i.display){for(e.save(),l=r-1;l>=0;l--){const u=i.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=i.setContext(this.getContext(c)),u=$e(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,r=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const f=He(d.backdropPadding);e.fillRect(-r/2-f.left,-o-u.size/2-f.top,r+f.width,u.size+f.height)}En(e,l.label,0,-o,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}z(Gn,"id","radialLinear"),z(Gn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ai.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),z(Gn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Gn,"descriptors",{angleLines:{_fallback:"grid"}});const fo={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}},Qe=Object.keys(fo);function cf(t,e){return t-e}function df(t,e){if(fe(e))return null;const n=t._adapter,{parser:i,round:s,isoWeekday:o}=t._parseOpts;let r=e;return typeof i=="function"&&(r=i(r)),Pe(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Un(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function uf(t,e,n,i){const s=Qe.length;for(let o=Qe.indexOf(t);o<s-1;++o){const r=fo[Qe[o]],l=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-e)/(l*r.size))<=i)return Qe[o]}return Qe[s-1]}function XC(t,e,n,i,s){for(let o=Qe.length-1;o>=Qe.indexOf(n);o--){const r=Qe[o];if(fo[r].common&&t._adapter.diff(s,i,r)>=e-1)return r}return Qe[n?Qe.indexOf(n):0]}function GC(t){for(let e=Qe.indexOf(t)+1,n=Qe.length;e<n;++e)if(fo[Qe[e]].common)return Qe[e]}function ff(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:i,hi:s}=pr(n,e),o=n[i]>=e?n[i]:n[s];t[o]=!0}}function JC(t,e,n,i){const s=t._adapter,o=+s.startOf(e[0].value,i),r=e[e.length-1].value;let l,c;for(l=o;l<=r;l=+s.add(l,1,i))c=n[l],c>=0&&(e[c].major=!0);return e}function hf(t,e,n){const i=[],s={},o=e.length;let r,l;for(r=0;r<o;++r)l=e[r],s[l]=r,i.push({value:l,major:!1});return o===0||!n?i:JC(t,i,s,n)}class Jn extends cn{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 i=e.time||(e.time={}),s=this._adapter=new Ud._date(e.adapters.date);s.init(n),vi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:df(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,i=e.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:l}=this.getUserBounds();function c(d){!r&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!r||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=Pe(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=Pe(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],i=e[e.length-1]),{min:n,max:i}}buildTicks(){const e=this.options,n=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,l=qk(s,o,r);return this._unit=n.unit||(i.autoSkip?uf(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):XC(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:GC(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),hf(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,i=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;n=Ie(n,0,r),i=Ie(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||uf(o.minUnit,n,i,this._getLabelCapacity(n)),l=ae(s.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,d=Un(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":r),e.diff(i,n,r)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<i;h=+e.add(h,l,r),m++)ff(u,h,p);return(h===i||s.bounds==="ticks"||m===1)&&ff(u,h,p),Object.keys(u).sort(cf).map(g=>+g)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(e,r)}_tickFormatFunction(e,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return ke(r,[e,n,i],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=i[n],m=d&&f&&h&&h.major;return this._adapter.format(e,s||(m?f:u))}generateTickLabels(e){let n,i,s;for(n=0,i=e.length;n<i;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,i=this.ctx.measureText(e).width,s=yt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:i*o+l*r,h:i*r+l*o}}_getLabelCapacity(e){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(e,0,hf(this,[e],this._majorUnit),s),r=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,i;if(e.length)return e;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)e.push(df(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Zc(e.sort(cf))}}z(Jn,"id","time"),z(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 ho(t,e,n){let i=0,s=t.length-1,o,r,l,c;n?(e>=t[i].pos&&e<=t[s].pos&&({lo:i,hi:s}=zt(t,"pos",e)),{pos:o,time:l}=t[i],{pos:r,time:c}=t[s]):(e>=t[i].time&&e<=t[s].time&&({lo:i,hi:s}=zt(t,"time",e)),{time:o,pos:l}=t[i],{time:r,pos:c}=t[s]);const d=r-o;return d?l+(c-l)*(e-o)/d:l}class mo 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=ho(n,this.min),this._tableRange=ho(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,s=[],o=[];let r,l,c,d,u;for(r=0,l=e.length;r<l;++r)d=e[r],d>=n&&d<=i&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,l=s.length;r<l;++r)u=s[r+1],c=s[r-1],d=s[r],Math.round((u+c)/2)!==d&&o.push({time:d,pos:r/(l-1)});return o}_generate(){const e=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(ho(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return ho(this._table,i*this._tableRange+this._minPos,!0)}}z(mo,"id","timeseries"),z(mo,"defaults",Jn.defaults);var mf=Object.freeze({__proto__:null,CategoryScale:ao,LinearScale:co,LogarithmicScale:uo,RadialLinearScale:Gn,TimeScale:Jn,TimeSeriesScale:mo});const pf=[zd,Cu,tf,mf];Dt.register(...pf);const QC=Object.freeze(Object.defineProperty({__proto__:null,Animation:Bd,Animations:Nr,ArcElement:Xn,BarController:$i,BarElement:Ji,BasePlatform:Rr,BasicPlatform:Jd,BubbleController:Li,CategoryScale:ao,Chart:Dt,Colors:Tu,DatasetController:lt,Decimation:Au,DomPlatform:nu,DoughnutController:ln,Element:Nt,Filler:ju,Interaction:Hd,Legend:Hu,LineController:Ii,LineElement:Wt,LinearScale:co,LogarithmicScale:uo,PieController:Xs,PointElement:Gi,PolarAreaController:Yn,RadarController:ji,RadialLinearScale:Gn,Scale:cn,ScatterController:zi,SubTitle:Yu,Ticks:Ai,TimeScale:Jn,TimeSeriesScale:mo,Title:qu,Tooltip:ef,_adapters:Ud,_detectPlatform:iu,animator:vt,controllers:zd,default:Dt,defaults:Ee,elements:Cu,layouts:je,plugins:tf,registerables:pf,registry:bt,scales:mf},Symbol.toStringTag,{value:"Module"}));Ve.default=i_,Ve.useAddEntityRecord=t_,Ve.useDeleteEntityRecord=n_,Ve.useEntitiesStore=Vl,Ve.useGetEntityRecord=e_,Ve.useGlobalConfigsStore=ot,Object.defineProperties(Ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|