@platforma-sdk/ui-vue 1.10.0 → 1.10.2
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/CHANGELOG.md +9 -0
- package/dist/lib.js +7496 -7082
- package/dist/lib.umd.cjs +34 -34
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts +3 -1
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/PlTableFilters.vue.d.ts +17 -0
- package/dist/src/components/PlAgDataTable/PlTableFilters.vue.d.ts.map +1 -0
- package/dist/src/components/PlAgDataTable/sources/table-source.d.ts +3 -3
- package/dist/src/components/PlAgDataTable/sources/table-source.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/types.d.ts +15 -1
- package/dist/src/components/PlAgDataTable/types.d.ts.map +1 -1
- package/dist/src/lib.d.ts +2 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/PlAgDataTable/PlAgDataTable.vue +49 -26
- package/src/components/PlAgDataTable/PlTableFilters.vue +471 -0
- package/src/components/PlAgDataTable/sources/table-source.ts +20 -23
- package/src/components/PlAgDataTable/types.ts +19 -0
- package/src/lib.ts +2 -1
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(R,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(R=typeof globalThis<"u"?globalThis:R||self,r(R.SdkVueLib={},R.Vue,R.core$1,R.core,R.clientSideRowModel,R.infiniteRowModel,R.serverSideRowModel,R.csvExport,R.clipboard,R.rangeSelection,R.richSelect,R.menu,R.excelExport,R.theming,R.vue3))})(this,function(R,r,Re,b,Jo,Kf,sd,Yf,ad,ld,Jf,Xf,Qf,em,tm){"use strict";var RF=Object.defineProperty;var Hf=R=>{throw TypeError(R)};var MF=(R,r,Re)=>r in R?RF(R,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):R[r]=Re;var Ze=(R,r,Re)=>MF(R,typeof r!="symbol"?r+"":r,Re),td=(R,r,Re)=>r.has(R)||Hf("Cannot "+Re);var w=(R,r,Re)=>(td(R,r,"read from private field"),Re?Re.call(R):r.get(R)),Le=(R,r,Re)=>r.has(R)?Hf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(R):r.set(R,Re),fe=(R,r,Re,b)=>(td(R,r,"write to private field"),b?b.call(R,Re):r.set(R,Re),Re),le=(R,r,Re)=>(td(R,r,"access private method"),Re);var ka=(R,r,Re,b)=>({set _(Jo){fe(R,r,Jo,Re)},get _(){return w(R,r,b)}});var up,fi,pp,hp,dn,Ot,un,pn,mi,gi,st,hn,it,je,be,St,Gt,_t,dt,fn,ut,mn,gn,zt,yn,gr,Et,ee,nd,Gr,Gn,Eo,Zt,qf,zr,yi,To,Br,Vr,rd,Sa,Ea,Ke,id,Yo,Ar,od;function nm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function rm(t){return t!==null&&typeof t=="object"}function Fn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Fn(t[n]);return e}else if(rm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Fn(t[n])}),e}else return t}function Ta(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function im(t){let e=0n,n;return async function(...i){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...i);return n=l,{ok:!0,value:await l}}}var Di=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function om(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sm=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((i,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return i;const l=i.length===0?"":",";return`${i}${l}${t(s)}:${t(e[s])}`},"")}}`};const Xr=om(sm);class Ba extends Error{}class Va extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function tm(t){return{ok:!0,value:t}}function od(t){if(!t)throw new ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function sd(t){return{value:t,errors:void 0}}function nm(t){if(t.errors)throw new xa(t.errors);if(!t.value)throw new ba;return t.value}function rm(t){return t!==void 0}function ka(t,e){return Pi(t)===Pi(e)}const Sa=t=>t,Ea=t=>t instanceof Error?t:Error(String(t)),Ta=t=>t.name==="ZodError",Ba=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Aa(t){const e=t.validate??Sa,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=F=>{s.value={model:Nn(F)}};r.watch(()=>t.get(),F=>l(F),{immediate:!0});const c=()=>{var F;t.onSave(e(Nn((F=s.value)==null?void 0:F.model)))},u=()=>{l(t.get()),i.value=void 0},p=F=>{const T=Ea(F);Ta(T)?i.value=Error(Ba(T)):i.value=T},f=F=>{i.value=void 0;try{e(F),n&&c()}catch(T){p(T)}},m=r.computed({get:()=>{var F;return(F=s.value)==null?void 0:F.model},set(F){l(F),f(F)}});r.watch(s,(F,T)=>{F&&F===T&&f(F.model)},{deep:!0});const v=r.computed(()=>!i.value),k=r.computed(()=>!ka(t.get(),r.unref(s))),S=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:v,isChanged:k,error:i,errorString:S,save:c,revert:u,setError:p})}function im(t,e){const n=t.validate??Sa,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=T=>{l.value={model:Object.assign(Nn(T),e??{}),stage:Symbol()}};r.watch(()=>t.get(),T=>c(T),{immediate:!0});const u=()=>{var T;t.onSave(n(Nn((T=l.value)==null?void 0:T.model)))},p=()=>{c(t.get()),s.value=void 0},f=T=>{const N=Ea(T);Ta(N)?s.value=Error(Ba(N)):s.value=N},m=T=>{s.value=void 0;try{n(T),i&&u()}catch(N){f(N)}},v=r.computed({get:()=>{var T;return(T=l.value)==null?void 0:T.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:v.value.args,ui:v.value.ui}),()=>{var T;return(T=l.value)==null?void 0:T.stage}],([T,N],[C,I])=>{N===I&&m(T)},{deep:!0});const k=r.computed(()=>!s.value),S=r.computed(()=>{var C;const{args:T,ui:N}=((C=r.unref(l))==null?void 0:C.model)??{};return!ka(t.get(),{args:T,ui:N})}),F=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:v,valid:k,isChanged:S,error:s,errorString:F,save:u,revert:p,setError:f})}const om=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function sm(t,e){const i=wa(e.setBlockArgs,100),s=wa(e.setBlockUiState,100),l=wa(e.setBlockArgsAndUiState,100),c=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async T=>{T.forEach(N=>{N.key==="args"&&(c.args=Object.freeze(N.value)),N.key==="ui"&&(c.ui=Object.freeze(N.value)),N.key==="outputs"&&(c.outputs=Object.freeze(N.value)),N.key==="navigationState"&&(c.navigationState=Object.freeze(N.value))}),await r.nextTick()});const u=()=>Nn(c.args),p=()=>Nn(c.ui),f=()=>Nn(c.navigationState),m={createArgsModel(T={}){return Aa({get(){return T.transform?T.transform(c.args):c.args},validate:T.validate,autoSave:!0,onSave(N){i(N)}})},createUiModel(T={},N){return Aa({get(){return T.transform?T.transform(c.ui):c.ui??N()},validate:T.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...T){const N=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(N,{value:this.unwrapOutputs(...T),errors:void 0})}catch(C){Object.assign(N,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),N},unwrapOutputs(...T){const N=c.outputs,C=T.map(I=>[I,od(N[I])]);return Object.fromEntries(C)},getOutputField(T){return c.outputs[T]},getOutputFieldOkOptional(T){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const N=this.getOutputField(T);if(N&&N.ok)return N.value},getOutputFieldErrorsOptional(T){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const N=this.getOutputField(T);if(N&&!N.ok)return N.errors},updateArgs(T){const N=u();return T(N),e.setBlockArgs(N)},updateUiState(T){const N=p();return e.setBlockUiState(T(N))},updateNavigationState(T){const N=f();return T(N),e.setNavigationState(N)},navigateTo(T){const N=f();return N.href=T,e.setNavigationState(N)}},v=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(T)}),k=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C&&!C.ok?new xa(C.errors):void 0]);return Object.fromEntries(T)}),S={snapshot:c,queryParams:r.computed(()=>om(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(T=>!(T!=null&&T.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),v.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),k.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},F=im({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(T){l(T.args,T.ui)}},{outputs:v,outputErrors:k});return r.reactive(Object.assign(F,m,S))}var Me;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Pa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Pa||(Pa={}));const ie=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=t=>{switch(typeof t){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}},J=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),am=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ft.create=t=>new Ft(t);const qr=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case J.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case J.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let ad=qr;function lm(t){ad=t}function Yo(){return ad}const Jo=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},cm=[];function ne(t,e){const n=Yo(),i=Jo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===qr?void 0:qr].filter(s=>!!s)});t.common.issues.push(i)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return ft.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),Kr=t=>({status:"dirty",value:t}),Ct=t=>({status:"valid",value:t}),Va=t=>t.status==="aborted",Na=t=>t.status==="dirty",Vi=t=>t.status==="valid",Ni=t=>typeof Promise<"u"&&t instanceof Promise;function Xo(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ld(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));var Di,Fi;class xn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cd=(t,e)=>{if(Vi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ft(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Kn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ni(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return cd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(Ni(s)?s:Promise.resolve(s));return cd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:J.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new on({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Sn.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Li.create([this,e],this._def)}and(e){return Oi.create(this,e,this._def)}transform(e){return new on({...Se(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Se(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Ra({typeName:ge.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Wi({...Se(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hi.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dm=/^c[^\s-]{8,}$/i,um=/^[0-9a-z]+$/,pm=/^[0-9A-HJKMNP-TV-Z]{26}$/,hm=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fm=/^[a-z0-9_-]{21}$/i,mm=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ym="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Da;const vm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_m=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Cm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dd="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wm=new RegExp(`^${dd}$`);function ud(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function bm(t){return new RegExp(`^${ud(t)}$`)}function pd(t){let e=`${dd}T${ud(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function xm(t,e){return!!((e==="v4"||!e)&&vm.test(t)||(e==="v6"||!e)&&_m.test(t))}class nn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.string,received:l.parsedType}),_e}const i=new ft;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Da||(Da=new RegExp(ym,"u")),Da.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")hm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")dm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")um.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")pm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:J.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:J.invalid_string,message:l.message}),i.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?pd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?bm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?mm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?xm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:J.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...ce.errToObj(i)})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ce.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ce.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ce.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ce.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ce.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ce.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ce.errToObj(n)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}nn.create=t=>{var e;return new nn({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function km(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class Yn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ie.number){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.number,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?km(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Yn.create=t=>new Yn({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Jn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ie.bigint){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Jn.create=t=>{var e;return new Jn({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Ri extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.boolean,received:i.parsedType}),_e}return Ct(e.data)}}Ri.create=t=>new Ri({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Er extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ie.date){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_date}),_e}const i=new ft;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Er.create=t=>new Er({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Se(t)});class Qo extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.symbol,received:i.parsedType}),_e}return Ct(e.data)}}Qo.create=t=>new Qo({typeName:ge.ZodSymbol,...Se(t)});class Mi extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.undefined,received:i.parsedType}),_e}return Ct(e.data)}}Mi.create=t=>new Mi({typeName:ge.ZodUndefined,...Se(t)});class Ii extends Be{_parse(e){if(this._getType(e)!==ie.null){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.null,received:i.parsedType}),_e}return Ct(e.data)}}Ii.create=t=>new Ii({typeName:ge.ZodNull,...Se(t)});class Yr extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return Ct(e.data)}}Yr.create=t=>new Yr({typeName:ge.ZodAny,...Se(t)});class Tr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ct(e.data)}}Tr.create=t=>new Tr({typeName:ge.ZodUnknown,...Se(t)});class Dn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:J.invalid_type,expected:ie.never,received:n.parsedType}),_e}}Dn.create=t=>new Dn({typeName:ge.ZodNever,...Se(t)});class es extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.void,received:i.parsedType}),_e}return Ct(e.data)}}es.create=t=>new es({typeName:ge.ZodVoid,...Se(t)});class rn extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:J.invalid_type,expected:ie.array,received:n.parsedType}),_e;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ne(n,{code:c?J.too_big:J.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new xn(n,c,n.path,u)))).then(c=>ft.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new xn(n,c,n.path,u)));return ft.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new rn({...this._def,minLength:{value:e,message:ce.toString(n)}})}max(e,n){return new rn({...this._def,maxLength:{value:e,message:ce.toString(n)}})}length(e,n){return new rn({...this._def,exactLength:{value:e,message:ce.toString(n)}})}nonempty(e){return this.min(1,e)}}rn.create=(t,e)=>new rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Se(e)});function Jr(t){if(t instanceof Ke){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Sn.create(Jr(i))}return new Ke({...t._def,shape:()=>e})}else return t instanceof rn?new rn({...t._def,type:Jr(t.element)}):t instanceof Sn?Sn.create(Jr(t.unwrap())):t instanceof Qn?Qn.create(Jr(t.unwrap())):t instanceof kn?kn.create(t.items.map(e=>Jr(e))):t}class Ke extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Me.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ie.object){const f=this._getOrReturnCtx(e);return ne(f,{code:J.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Dn&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],v=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new xn(s,v,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Dn){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ne(s,{code:J.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const v=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new xn(s,v,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const v=await m.key,k=await m.value;f.push({key:v,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>ft.mergeObjectSync(i,f)):ft.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ce.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ke({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof Sn;)l=l._def.innerType;n[i]=l}}),new Ke({...this._def,shape:()=>n})}keyof(){return hd(Me.objectKeys(this.shape))}}Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)});class Li extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Ft(u.ctx.common.issues));return ne(n,{code:J.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Ft(p));return ne(n,{code:J.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}Li.create=(t,e)=>new Li({options:t,typeName:ge.ZodUnion,...Se(e)});const Fn=t=>t instanceof zi?Fn(t.schema):t instanceof on?Fn(t.innerType()):t instanceof Zi?[t.value]:t instanceof Xn?t.options:t instanceof $i?Me.objectValues(t.enum):t instanceof Ui?Fn(t._def.innerType):t instanceof Mi?[void 0]:t instanceof Ii?[null]:t instanceof Sn?[void 0,...Fn(t.unwrap())]:t instanceof Qn?[null,...Fn(t.unwrap())]:t instanceof Ra||t instanceof ji?Fn(t.unwrap()):t instanceof Wi?Fn(t._def.innerType):[];class ts extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:J.invalid_type,expected:ie.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=Fn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new ts({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Fa(t,e){const n=Kn(t),i=Kn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&i===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Fa(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ie.array&&i===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Fa(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&i===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Oi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Va(l)||Va(c))return _e;const u=Fa(l.value,c.value);return u.valid?((Na(l)||Na(c))&&n.dirty(),{status:n.value,value:u.data}):(ne(i,{code:J.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Oi.create=(t,e,n)=>new Oi({left:t,right:e,typeName:ge.ZodIntersection,...Se(n)});class kn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.array)return ne(i,{code:J.invalid_type,expected:ie.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return ne(i,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(ne(i,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new xn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>ft.mergeArray(n,c)):ft.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new kn({...this._def,rest:e})}}kn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kn({items:t,typeName:ge.ZodTuple,rest:null,...Se(e)})};class Gi extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.object)return ne(i,{code:J.invalid_type,expected:ie.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new xn(i,u,i.path,u)),value:c._parse(new xn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?ft.mergeObjectAsync(n,s):ft.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Gi({keyType:e,valueType:n,typeName:ge.ZodRecord,...Se(i)}):new Gi({keyType:nn.create(),valueType:e,typeName:ge.ZodRecord,...Se(n)})}}class ns extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.map)return ne(i,{code:J.invalid_type,expected:ie.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new xn(i,u,i.path,[f,"key"])),value:l._parse(new xn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ns.create=(t,e,n)=>new ns({valueType:e,keyType:t,typeName:ge.ZodMap,...Se(n)});class Br extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.set)return ne(i,{code:J.invalid_type,expected:ie.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ne(i,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ne(i,{code:J.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new xn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Br({...this._def,minSize:{value:e,message:ce.toString(n)}})}max(e,n){return new Br({...this._def,maxSize:{value:e,message:ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Br.create=(t,e)=>new Br({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Se(e)});class Xr extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.function)return ne(n,{code:J.invalid_type,expected:ie.function,received:n.parsedType}),_e;function i(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof Qr){const u=this;return Ct(async function(...p){const f=new Ft([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),v=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(S=>{throw f.addIssue(s(v,S)),f})})}else{const u=this;return Ct(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ft([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Ft([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xr({...this._def,args:kn.create(e).rest(Tr.create())})}returns(e){return new Xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new Xr({args:e||kn.create([]).rest(Tr.create()),returns:n||Tr.create(),typeName:ge.ZodFunction,...Se(i)})}}class zi extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zi.create=(t,e)=>new zi({getter:t,typeName:ge.ZodLazy,...Se(e)});class Zi extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zi.create=(t,e)=>new Zi({value:t,typeName:ge.ZodLiteral,...Se(e)});function hd(t,e){return new Xn({values:t,typeName:ge.ZodEnum,...Se(e)})}class Xn extends Be{constructor(){super(...arguments),Di.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{expected:Me.joinValues(i),received:n.parsedType,code:J.invalid_type}),_e}if(Xo(this,Di)||ld(this,Di,new Set(this._def.values)),!Xo(this,Di).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{received:n.data,code:J.invalid_enum_value,options:i}),_e}return Ct(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Xn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Di=new WeakMap,Xn.create=hd;class $i extends Be{constructor(){super(...arguments),Fi.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Me.objectValues(n);return ne(i,{expected:Me.joinValues(s),received:i.parsedType,code:J.invalid_type}),_e}if(Xo(this,Fi)||ld(this,Fi,new Set(Me.getValidEnumValues(this._def.values))),!Xo(this,Fi).has(e.data)){const s=Me.objectValues(n);return ne(i,{received:i.data,code:J.invalid_enum_value,options:s}),_e}return Ct(e.data)}get enum(){return this._def.values}}Fi=new WeakMap,$i.create=(t,e)=>new $i({values:t,typeName:ge.ZodNativeEnum,...Se(e)});class Qr extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return ne(n,{code:J.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const i=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return Ct(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qr.create=(t,e)=>new Qr({type:t,typeName:ge.ZodPromise,...Se(e)});class on extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ne(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?Kr(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?Kr(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Vi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>Vi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}on.create=(t,e,n)=>new on({schema:t,typeName:ge.ZodEffects,effect:e,...Se(n)}),on.createWithPreprocess=(t,e,n)=>new on({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Se(n)});class Sn extends Be{_parse(e){return this._getType(e)===ie.undefined?Ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodOptional,...Se(e)});class Qn extends Be{_parse(e){return this._getType(e)===ie.null?Ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qn.create=(t,e)=>new Qn({innerType:t,typeName:ge.ZodNullable,...Se(e)});class Ui extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class Wi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ni(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Wi.create=(t,e)=>new Wi({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class rs extends Be{_parse(e){if(this._getType(e)!==ie.nan){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}rs.create=t=>new rs({typeName:ge.ZodNaN,...Se(t)});const Sm=Symbol("zod_brand");class Ra extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),Kr(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new Hi({in:e,out:n,typeName:ge.ZodPipeline})}}class ji extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Vi(s)&&(s.value=Object.freeze(s.value)),s);return Ni(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ge.ZodReadonly,...Se(e)});function fd(t,e={},n){return t?Yr.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):Yr.create()}const Em={object:Ke.lazycreate};var ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));const Tm=(t,e={message:`Input not instance of ${t.name}`})=>fd(n=>n instanceof t,e),md=nn.create,gd=Yn.create,Bm=rs.create,Am=Jn.create,yd=Ri.create,Pm=Er.create,Vm=Qo.create,Nm=Mi.create,Dm=Ii.create,Fm=Yr.create,Rm=Tr.create,Mm=Dn.create,Im=es.create,Lm=rn.create,Om=Ke.create,Gm=Ke.strictCreate,zm=Li.create,Zm=ts.create,$m=Oi.create,Um=kn.create,Wm=Gi.create,Hm=ns.create,jm=Br.create,qm=Xr.create,Km=zi.create,Ym=Zi.create,Jm=Xn.create,Xm=$i.create,Qm=Qr.create,vd=on.create,eg=Sn.create,tg=Qn.create,ng=on.createWithPreprocess,rg=Hi.create;var is=Object.freeze({__proto__:null,defaultErrorMap:qr,setErrorMap:lm,getErrorMap:Yo,makeIssue:Jo,EMPTY_PATH:cm,addIssueToContext:ne,ParseStatus:ft,INVALID:_e,DIRTY:Kr,OK:Ct,isAborted:Va,isDirty:Na,isValid:Vi,isAsync:Ni,get util(){return Me},get objectUtil(){return Pa},ZodParsedType:ie,getParsedType:Kn,ZodType:Be,datetimeRegex:pd,ZodString:nn,ZodNumber:Yn,ZodBigInt:Jn,ZodBoolean:Ri,ZodDate:Er,ZodSymbol:Qo,ZodUndefined:Mi,ZodNull:Ii,ZodAny:Yr,ZodUnknown:Tr,ZodNever:Dn,ZodVoid:es,ZodArray:rn,ZodObject:Ke,ZodUnion:Li,ZodDiscriminatedUnion:ts,ZodIntersection:Oi,ZodTuple:kn,ZodRecord:Gi,ZodMap:ns,ZodSet:Br,ZodFunction:Xr,ZodLazy:zi,ZodLiteral:Zi,ZodEnum:Xn,ZodNativeEnum:$i,ZodPromise:Qr,ZodEffects:on,ZodTransformer:on,ZodOptional:Sn,ZodNullable:Qn,ZodDefault:Ui,ZodCatch:Wi,ZodNaN:rs,BRAND:Sm,ZodBranded:Ra,ZodPipeline:Hi,ZodReadonly:ji,custom:fd,Schema:Be,ZodSchema:Be,late:Em,get ZodFirstPartyTypeKind(){return ge},coerce:{string:t=>nn.create({...t,coerce:!0}),number:t=>Yn.create({...t,coerce:!0}),boolean:t=>Ri.create({...t,coerce:!0}),bigint:t=>Jn.create({...t,coerce:!0}),date:t=>Er.create({...t,coerce:!0})},any:Fm,array:Lm,bigint:Am,boolean:yd,date:Pm,discriminatedUnion:Zm,effect:vd,enum:Jm,function:qm,instanceof:Tm,intersection:$m,lazy:Km,literal:Ym,map:Hm,nan:Bm,nativeEnum:Xm,never:Mm,null:Dm,nullable:tg,number:gd,object:Om,oboolean:()=>yd().optional(),onumber:()=>gd().optional(),optional:eg,ostring:()=>md().optional(),pipeline:rg,preprocess:ng,promise:Qm,record:Wm,set:jm,strictObject:Gm,string:md,symbol:Vm,transformer:vd,tuple:Um,undefined:Nm,union:zm,unknown:Rm,void:Im,NEVER:_e,ZodIssueCode:J,quotelessJson:am,ZodError:Ft});function ig(t){throw new Error("Unexpected object: "+t)}const og=-2147483648,_d=-9007199254740991n,sg=NaN,ag=NaN,lg=null,cg=null;function Cd(t,e){switch(e){case"Int":return t===og;case"Long":return t===Number(_d)||t===_d;case"Float":return t===sg;case"Double":return t===ag;case"String":return t===lg;case"Bytes":return t===cg;default:throw Error(`unsupported data type: ${e}`)}}function dg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function wd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Ma(t){return t.map(wd)}function os(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>os(n,e))};case"outer":return{type:"outer",primary:os(t.primary,e),secondary:t.secondary.map(n=>os(n,e))};default:ig(t)}}is.object({__isRef:is.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:is.string().describe("Upstream block id"),name:is.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function ug(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const pg="1.10.0";function hg(){return ug({sdkVersion:pg})}function fg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function ei(t){return!!t&&typeof t.children<"u"}function er(t){return ei(t)?t.groupId:t.colId}function bd(t,e,n){const i=(c,u)=>{const p=c.children.map(er),f=b._includes(p,er(u)),m=b._last(c.children),v=m&&er(m)!==er(u);return f&&v};if(!ei(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(er);if(!b._includes(c,er(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!bd(s.children[c],e,n);c--);return!1}function mg(t){const e=(s,l)=>ei(s)&&ei(l)&&er(s)===er(l),n=(s,l)=>{if(!ei(l))return s;const c=s,u=l;return u.children&&u.groupId&&bd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var gg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(ei(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const v=n(m,l+1);v&&f.push(v)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=mg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function yg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function _g(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Cg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function wg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function xg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function kg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Sg(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Eg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Tg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function am(t){return{ok:!0,value:t}}function cd(t){if(!t)throw new Ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function dd(t){return{value:t,errors:void 0}}function lm(t){if(t.errors)throw new Va(t.errors);if(!t.value)throw new Ba;return t.value}function cm(t){return t!==void 0}function Aa(t,e){return Xr(t)===Xr(e)}const Na=t=>t,Pa=t=>t instanceof Error?t:Error(String(t)),Da=t=>t.name==="ZodError",Fa=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Ra(t){const e=t.validate??Na,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=M=>{s.value={model:Fn(M)}};r.watch(()=>t.get(),M=>l(M),{immediate:!0});const c=()=>{var M;t.onSave(e(Fn((M=s.value)==null?void 0:M.model)))},u=()=>{l(t.get()),i.value=void 0},p=M=>{const V=Pa(M);Da(V)?i.value=Error(Fa(V)):i.value=V},f=M=>{i.value=void 0;try{e(M),n&&c()}catch(V){p(V)}},m=r.computed({get:()=>{var M;return(M=s.value)==null?void 0:M.model},set(M){l(M),f(M)}});r.watch(s,(M,V)=>{M&&M===V&&f(M.model)},{deep:!0});const y=r.computed(()=>!i.value),S=r.computed(()=>!Aa(t.get(),r.unref(s))),E=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:y,isChanged:S,error:i,errorString:E,save:c,revert:u,setError:p})}function dm(t,e){const n=t.validate??Na,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=V=>{l.value={model:Object.assign(Fn(V),e??{}),stage:Symbol()}};r.watch(()=>t.get(),V=>c(V),{immediate:!0});const u=()=>{var V;t.onSave(n(Fn((V=l.value)==null?void 0:V.model)))},p=()=>{c(t.get()),s.value=void 0},f=V=>{const F=Pa(V);Da(F)?s.value=Error(Fa(F)):s.value=F},m=V=>{s.value=void 0;try{n(V),i&&u()}catch(F){f(F)}},y=r.computed({get:()=>{var V;return(V=l.value)==null?void 0:V.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:y.value.args,ui:y.value.ui}),()=>{var V;return(V=l.value)==null?void 0:V.stage}],([V,F],[C,G])=>{F===G&&m(V)},{deep:!0});const S=r.computed(()=>!s.value),E=r.computed(()=>{var C;const{args:V,ui:F}=((C=r.unref(l))==null?void 0:C.model)??{};return!Aa(t.get(),{args:V,ui:F})}),M=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:y,valid:S,isChanged:E,error:s,errorString:M,save:u,revert:p,setError:f})}const um=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function pm(t,e){const i=Ta(e.setBlockArgs,100),s=Ta(e.setBlockUiState,100),l=Ta(e.setBlockArgsAndUiState,100),c=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async V=>{V.forEach(F=>{F.key==="args"&&(c.args=Object.freeze(F.value)),F.key==="ui"&&(c.ui=Object.freeze(F.value)),F.key==="outputs"&&(c.outputs=Object.freeze(F.value)),F.key==="navigationState"&&(c.navigationState=Object.freeze(F.value))}),await r.nextTick()});const u=()=>Fn(c.args),p=()=>Fn(c.ui),f=()=>Fn(c.navigationState),m={createArgsModel(V={}){return Ra({get(){return V.transform?V.transform(c.args):c.args},validate:V.validate,autoSave:!0,onSave(F){i(F)}})},createUiModel(V={},F){return Ra({get(){return V.transform?V.transform(c.ui):c.ui??F()},validate:V.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...V){const F=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(F,{value:this.unwrapOutputs(...V),errors:void 0})}catch(C){Object.assign(F,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),F},unwrapOutputs(...V){const F=c.outputs,C=V.map(G=>[G,cd(F[G])]);return Object.fromEntries(C)},getOutputField(V){return c.outputs[V]},getOutputFieldOkOptional(V){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const F=this.getOutputField(V);if(F&&F.ok)return F.value},getOutputFieldErrorsOptional(V){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const F=this.getOutputField(V);if(F&&!F.ok)return F.errors},updateArgs(V){const F=u();return V(F),e.setBlockArgs(F)},updateUiState(V){const F=p();return e.setBlockUiState(V(F))},updateNavigationState(V){const F=f();return V(F),e.setNavigationState(F)},navigateTo(V){const F=f();return F.href=V,e.setNavigationState(F)}},y=r.computed(()=>{const V=Object.entries(c.outputs).map(([F,C])=>[F,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(V)}),S=r.computed(()=>{const V=Object.entries(c.outputs).map(([F,C])=>[F,C&&!C.ok?new Va(C.errors):void 0]);return Object.fromEntries(V)}),E={snapshot:c,queryParams:r.computed(()=>um(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(V=>!(V!=null&&V.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),y.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),S.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},M=dm({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(V){l(V.args,V.ui)}},{outputs:y,outputErrors:S});return r.reactive(Object.assign(M,m,E))}var Me;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Ma;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ma||(Ma={}));const ie=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xn=t=>{switch(typeof t){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}},J=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const Qr=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case J.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case J.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let ud=Qr;function fm(t){ud=t}function Xo(){return ud}const Qo=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},mm=[];function ne(t,e){const n=Xo(),i=Qo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Qr?void 0:Qr].filter(s=>!!s)});t.common.issues.push(i)}class gt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return gt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),ei=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),Ia=t=>t.status==="aborted",La=t=>t.status==="dirty",Fi=t=>t.status==="valid",Ri=t=>typeof Promise<"u"&&t instanceof Promise;function es(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function pd(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var Mi,Ii;class kn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hd=(t,e)=>{if(Fi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new It(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Xn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gt,ctx:{common:e.parent.common,data:e.data,parsedType:Xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ri(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return hd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(Ri(s)?s:Promise.resolve(s));return hd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:J.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new sn({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return En.create(this,this._def)}nullable(){return nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return on.create(this,this._def)}promise(){return ii.create(this,this._def)}or(e){return zi.create([this,e],this._def)}and(e){return Zi.create(this,e,this._def)}transform(e){return new sn({...Se(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ji({...Se(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new za({typeName:ye.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new qi({...Se(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ki.create(this,e)}readonly(){return Yi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const gm=/^c[^\s-]{8,}$/i,ym=/^[0-9a-z]+$/,vm=/^[0-9A-HJKMNP-TV-Z]{26}$/,_m=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Cm=/^[a-z0-9_-]{21}$/i,wm=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oa;const km=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sm=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Em=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fd="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Tm=new RegExp(`^${fd}$`);function md(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Bm(t){return new RegExp(`^${md(t)}$`)}function gd(t){let e=`${fd}T${md(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Vm(t,e){return!!((e==="v4"||!e)&&km.test(t)||(e==="v6"||!e)&&Sm.test(t))}class rn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.string,received:l.parsedType}),_e}const i=new gt;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")bm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Oa||(Oa=new RegExp(xm,"u")),Oa.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")_m.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")ym.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")vm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:J.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:J.invalid_string,message:l.message}),i.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?gd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?Tm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?Bm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?Vm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Em.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:J.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...de.errToObj(i)})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...de.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...de.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...de.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...de.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...de.errToObj(n)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new rn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new rn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new rn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}rn.create=t=>{var e;return new rn({checks:[],typeName:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function Am(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class Qn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ie.number){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.number,received:l.parsedType}),_e}let i;const s=new gt;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Am(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new Qn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new Qn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Qn.create=t=>new Qn({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class er extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ie.bigint){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let i;const s=new gt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new er({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}er.create=t=>{var e;return new er({checks:[],typeName:ye.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Li extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.boolean,received:i.parsedType}),_e}return xt(e.data)}}Li.create=t=>new Li({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Nr extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ie.date){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_date}),_e}const i=new gt;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Nr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:de.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Nr.create=t=>new Nr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Se(t)});class ts extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.symbol,received:i.parsedType}),_e}return xt(e.data)}}ts.create=t=>new ts({typeName:ye.ZodSymbol,...Se(t)});class Oi extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.undefined,received:i.parsedType}),_e}return xt(e.data)}}Oi.create=t=>new Oi({typeName:ye.ZodUndefined,...Se(t)});class Gi extends Be{_parse(e){if(this._getType(e)!==ie.null){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.null,received:i.parsedType}),_e}return xt(e.data)}}Gi.create=t=>new Gi({typeName:ye.ZodNull,...Se(t)});class ti extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}ti.create=t=>new ti({typeName:ye.ZodAny,...Se(t)});class Pr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}}Pr.create=t=>new Pr({typeName:ye.ZodUnknown,...Se(t)});class Rn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:J.invalid_type,expected:ie.never,received:n.parsedType}),_e}}Rn.create=t=>new Rn({typeName:ye.ZodNever,...Se(t)});class ns extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.void,received:i.parsedType}),_e}return xt(e.data)}}ns.create=t=>new ns({typeName:ye.ZodVoid,...Se(t)});class on extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:J.invalid_type,expected:ie.array,received:n.parsedType}),_e;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ne(n,{code:c?J.too_big:J.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new kn(n,c,n.path,u)))).then(c=>gt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new kn(n,c,n.path,u)));return gt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new on({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new on({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new on({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}on.create=(t,e)=>new on({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Se(e)});function ni(t){if(t instanceof Je){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=En.create(ni(i))}return new Je({...t._def,shape:()=>e})}else return t instanceof on?new on({...t._def,type:ni(t.element)}):t instanceof En?En.create(ni(t.unwrap())):t instanceof nr?nr.create(ni(t.unwrap())):t instanceof Sn?Sn.create(t.items.map(e=>ni(e))):t}class Je extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Me.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ie.object){const f=this._getOrReturnCtx(e);return ne(f,{code:J.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Rn&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new kn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Rn){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ne(s,{code:J.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new kn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,S=await m.value;f.push({key:y,value:S,alwaysSet:m.alwaysSet})}return f}).then(f=>gt.mergeObjectSync(i,f)):gt.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Je({...this._def,unknownKeys:"strip"})}passthrough(){return new Je({...this._def,unknownKeys:"passthrough"})}extend(e){return new Je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Je({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Je({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Je({...this._def,shape:()=>n})}deepPartial(){return ni(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Je({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof En;)l=l._def.innerType;n[i]=l}}),new Je({...this._def,shape:()=>n})}keyof(){return yd(Me.objectKeys(this.shape))}}Je.create=(t,e)=>new Je({shape:()=>t,unknownKeys:"strip",catchall:Rn.create(),typeName:ye.ZodObject,...Se(e)}),Je.strictCreate=(t,e)=>new Je({shape:()=>t,unknownKeys:"strict",catchall:Rn.create(),typeName:ye.ZodObject,...Se(e)}),Je.lazycreate=(t,e)=>new Je({shape:t,unknownKeys:"strip",catchall:Rn.create(),typeName:ye.ZodObject,...Se(e)});class zi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new It(u.ctx.common.issues));return ne(n,{code:J.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new It(p));return ne(n,{code:J.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}zi.create=(t,e)=>new zi({options:t,typeName:ye.ZodUnion,...Se(e)});const Mn=t=>t instanceof $i?Mn(t.schema):t instanceof sn?Mn(t.innerType()):t instanceof Wi?[t.value]:t instanceof tr?t.options:t instanceof Hi?Me.objectValues(t.enum):t instanceof ji?Mn(t._def.innerType):t instanceof Oi?[void 0]:t instanceof Gi?[null]:t instanceof En?[void 0,...Mn(t.unwrap())]:t instanceof nr?[null,...Mn(t.unwrap())]:t instanceof za||t instanceof Yi?Mn(t.unwrap()):t instanceof qi?Mn(t._def.innerType):[];class rs extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:J.invalid_type,expected:ie.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=Mn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new rs({typeName:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Ga(t,e){const n=Xn(t),i=Xn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&i===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Ga(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ie.array&&i===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Ga(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&i===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Zi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Ia(l)||Ia(c))return _e;const u=Ga(l.value,c.value);return u.valid?((La(l)||La(c))&&n.dirty(),{status:n.value,value:u.data}):(ne(i,{code:J.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Zi.create=(t,e,n)=>new Zi({left:t,right:e,typeName:ye.ZodIntersection,...Se(n)});class Sn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.array)return ne(i,{code:J.invalid_type,expected:ie.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return ne(i,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(ne(i,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new kn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>gt.mergeArray(n,c)):gt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Sn({...this._def,rest:e})}}Sn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sn({items:t,typeName:ye.ZodTuple,rest:null,...Se(e)})};class Ui extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.object)return ne(i,{code:J.invalid_type,expected:ie.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new kn(i,u,i.path,u)),value:c._parse(new kn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?gt.mergeObjectAsync(n,s):gt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Ui({keyType:e,valueType:n,typeName:ye.ZodRecord,...Se(i)}):new Ui({keyType:rn.create(),valueType:e,typeName:ye.ZodRecord,...Se(n)})}}class is extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.map)return ne(i,{code:J.invalid_type,expected:ie.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new kn(i,u,i.path,[f,"key"])),value:l._parse(new kn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}is.create=(t,e,n)=>new is({valueType:e,keyType:t,typeName:ye.ZodMap,...Se(n)});class Dr extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.set)return ne(i,{code:J.invalid_type,expected:ie.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ne(i,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ne(i,{code:J.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new kn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Dr({...this._def,minSize:{value:e,message:de.toString(n)}})}max(e,n){return new Dr({...this._def,maxSize:{value:e,message:de.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Dr.create=(t,e)=>new Dr({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Se(e)});class ri extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.function)return ne(n,{code:J.invalid_type,expected:ie.function,received:n.parsedType}),_e;function i(u,p){return Qo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Xo(),Qr].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return Qo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Xo(),Qr].filter(f=>!!f),issueData:{code:J.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof ii){const u=this;return xt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(E=>{throw f.addIssue(i(p,E)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(E=>{throw f.addIssue(s(y,E)),f})})}else{const u=this;return xt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ri({...this._def,args:Sn.create(e).rest(Pr.create())})}returns(e){return new ri({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new ri({args:e||Sn.create([]).rest(Pr.create()),returns:n||Pr.create(),typeName:ye.ZodFunction,...Se(i)})}}class $i extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}$i.create=(t,e)=>new $i({getter:t,typeName:ye.ZodLazy,...Se(e)});class Wi extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Wi.create=(t,e)=>new Wi({value:t,typeName:ye.ZodLiteral,...Se(e)});function yd(t,e){return new tr({values:t,typeName:ye.ZodEnum,...Se(e)})}class tr extends Be{constructor(){super(...arguments),Mi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{expected:Me.joinValues(i),received:n.parsedType,code:J.invalid_type}),_e}if(es(this,Mi)||pd(this,Mi,new Set(this._def.values)),!es(this,Mi).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{received:n.data,code:J.invalid_enum_value,options:i}),_e}return xt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return tr.create(e,{...this._def,...n})}exclude(e,n=this._def){return tr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Mi=new WeakMap,tr.create=yd;class Hi extends Be{constructor(){super(...arguments),Ii.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Me.objectValues(n);return ne(i,{expected:Me.joinValues(s),received:i.parsedType,code:J.invalid_type}),_e}if(es(this,Ii)||pd(this,Ii,new Set(Me.getValidEnumValues(this._def.values))),!es(this,Ii).has(e.data)){const s=Me.objectValues(n);return ne(i,{received:i.data,code:J.invalid_enum_value,options:s}),_e}return xt(e.data)}get enum(){return this._def.values}}Ii=new WeakMap,Hi.create=(t,e)=>new Hi({values:t,typeName:ye.ZodNativeEnum,...Se(e)});class ii extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return ne(n,{code:J.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const i=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return xt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ii.create=(t,e)=>new ii({type:t,typeName:ye.ZodPromise,...Se(e)});class sn extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ne(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?ei(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?ei(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Fi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>Fi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}sn.create=(t,e,n)=>new sn({schema:t,typeName:ye.ZodEffects,effect:e,...Se(n)}),sn.createWithPreprocess=(t,e,n)=>new sn({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Se(n)});class En extends Be{_parse(e){return this._getType(e)===ie.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}En.create=(t,e)=>new En({innerType:t,typeName:ye.ZodOptional,...Se(e)});class nr extends Be{_parse(e){return this._getType(e)===ie.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nr.create=(t,e)=>new nr({innerType:t,typeName:ye.ZodNullable,...Se(e)});class ji extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class qi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ri(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}qi.create=(t,e)=>new qi({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class os extends Be{_parse(e){if(this._getType(e)!==ie.nan){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}os.create=t=>new os({typeName:ye.ZodNaN,...Se(t)});const Nm=Symbol("zod_brand");class za extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ki extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),ei(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new Ki({in:e,out:n,typeName:ye.ZodPipeline})}}class Yi extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Fi(s)&&(s.value=Object.freeze(s.value)),s);return Ri(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}Yi.create=(t,e)=>new Yi({innerType:t,typeName:ye.ZodReadonly,...Se(e)});function vd(t,e={},n){return t?ti.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ti.create()}const Pm={object:Je.lazycreate};var ye;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ye||(ye={}));const Dm=(t,e={message:`Input not instance of ${t.name}`})=>vd(n=>n instanceof t,e),_d=rn.create,Cd=Qn.create,Fm=os.create,Rm=er.create,wd=Li.create,Mm=Nr.create,Im=ts.create,Lm=Oi.create,Om=Gi.create,Gm=ti.create,zm=Pr.create,Zm=Rn.create,Um=ns.create,$m=on.create,Wm=Je.create,Hm=Je.strictCreate,jm=zi.create,qm=rs.create,Km=Zi.create,Ym=Sn.create,Jm=Ui.create,Xm=is.create,Qm=Dr.create,eg=ri.create,tg=$i.create,ng=Wi.create,rg=tr.create,ig=Hi.create,og=ii.create,bd=sn.create,sg=En.create,ag=nr.create,lg=sn.createWithPreprocess,cg=Ki.create;var ss=Object.freeze({__proto__:null,defaultErrorMap:Qr,setErrorMap:fm,getErrorMap:Xo,makeIssue:Qo,EMPTY_PATH:mm,addIssueToContext:ne,ParseStatus:gt,INVALID:_e,DIRTY:ei,OK:xt,isAborted:Ia,isDirty:La,isValid:Fi,isAsync:Ri,get util(){return Me},get objectUtil(){return Ma},ZodParsedType:ie,getParsedType:Xn,ZodType:Be,datetimeRegex:gd,ZodString:rn,ZodNumber:Qn,ZodBigInt:er,ZodBoolean:Li,ZodDate:Nr,ZodSymbol:ts,ZodUndefined:Oi,ZodNull:Gi,ZodAny:ti,ZodUnknown:Pr,ZodNever:Rn,ZodVoid:ns,ZodArray:on,ZodObject:Je,ZodUnion:zi,ZodDiscriminatedUnion:rs,ZodIntersection:Zi,ZodTuple:Sn,ZodRecord:Ui,ZodMap:is,ZodSet:Dr,ZodFunction:ri,ZodLazy:$i,ZodLiteral:Wi,ZodEnum:tr,ZodNativeEnum:Hi,ZodPromise:ii,ZodEffects:sn,ZodTransformer:sn,ZodOptional:En,ZodNullable:nr,ZodDefault:ji,ZodCatch:qi,ZodNaN:os,BRAND:Nm,ZodBranded:za,ZodPipeline:Ki,ZodReadonly:Yi,custom:vd,Schema:Be,ZodSchema:Be,late:Pm,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>rn.create({...t,coerce:!0}),number:t=>Qn.create({...t,coerce:!0}),boolean:t=>Li.create({...t,coerce:!0}),bigint:t=>er.create({...t,coerce:!0}),date:t=>Nr.create({...t,coerce:!0})},any:Gm,array:$m,bigint:Rm,boolean:wd,date:Mm,discriminatedUnion:qm,effect:bd,enum:rg,function:eg,instanceof:Dm,intersection:Km,lazy:tg,literal:ng,map:Xm,nan:Fm,nativeEnum:ig,never:Zm,null:Om,nullable:ag,number:Cd,object:Wm,oboolean:()=>wd().optional(),onumber:()=>Cd().optional(),optional:sg,ostring:()=>_d().optional(),pipeline:cg,preprocess:lg,promise:og,record:Jm,set:Qm,strictObject:Hm,string:_d,symbol:Im,transformer:bd,tuple:Ym,undefined:Lm,union:jm,unknown:zm,void:Um,NEVER:_e,ZodIssueCode:J,quotelessJson:hm,ZodError:It});function dg(t){throw new Error("Unexpected object: "+t)}const ug=-2147483648,xd=-9007199254740991n,pg=NaN,hg=NaN,fg=null,mg=null;function kd(t,e){switch(e){case"Int":return t===ug;case"Long":return t===Number(xd)||t===xd;case"Float":return t===pg;case"Double":return t===hg;case"String":return t===fg;case"Bytes":return t===mg;default:throw Error(`unsupported data type: ${e}`)}}function gg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function Sd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Za(t){return t.map(Sd)}function as(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>as(n,e))};case"outer":return{type:"outer",primary:as(t.primary,e),secondary:t.secondary.map(n=>as(n,e))};default:dg(t)}}ss.object({__isRef:ss.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ss.string().describe("Upstream block id"),name:ss.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function yg(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const vg="1.10.2";function _g(){return yg({sdkVersion:vg})}function Cg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function oi(t){return!!t&&typeof t.children<"u"}function rr(t){return oi(t)?t.groupId:t.colId}function Ed(t,e,n){const i=(c,u)=>{const p=c.children.map(rr),f=b._includes(p,rr(u)),m=b._last(c.children),y=m&&rr(m)!==rr(u);return f&&y};if(!oi(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(rr);if(!b._includes(c,rr(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Ed(s.children[c],e,n);c--);return!1}function wg(t){const e=(s,l)=>oi(s)&&oi(l)&&rr(s)===rr(l),n=(s,l)=>{if(!oi(l))return s;const c=s,u=l;return u.children&&u.groupId&&Ed(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var bg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(oi(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=wg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function xg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function kg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Sg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Eg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Tg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Vg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Ag(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Ng(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Pg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Dg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
4
4
|
<button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
|
|
5
5
|
<div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
|
|
6
6
|
<span data-ref="eLabel" class="ag-side-button-label"></span>
|
|
7
7
|
</button>
|
|
8
|
-
</div>`}setLabel(){const t=this.localeService.getLocaleTextFunc(),e=this.toolPanelDef,n=t(e.labelKey,e.labelDefault);this.eLabel.innerText=n}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",b._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),b._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},
|
|
8
|
+
</div>`}setLabel(){const t=this.localeService.getLocaleTextFunc(),e=this.toolPanelDef,n=t(e.labelKey,e.labelDefault);this.eLabel.innerText=n}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",b._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),b._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},Fg=class extends b.Component{constructor(){super('<div class="ag-side-buttons" role="tablist"></div>'),this.buttonComps=[]}wireBeans(t){this.focusService=t.focusService,this.visibleColsService=t.visibleColsService}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(t){if(!(t.key!==b.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}b._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new Dg(t));return this.buttonComps.push(e),this.appendChild(e),e.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:t.id})}),e}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),b._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},Rg={selector:"AG-SIDE-BAR-BUTTONS",component:Fg},Td={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Bd={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Ua={columns:Td,filters:Bd};function $a(t){if(!t)return;if(t===!0)return{toolPanels:[Td,Bd],defaultToolPanel:"columns"};if(typeof t=="string")return $a([t]);if(Array.isArray(t)){const n=[];return t.forEach(i=>{const s=Ua[i];if(!s){Vd(i);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:Mg(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Vd(t){b._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Ua).join(",")}`)}function Mg(t){const e=[];return t&&t.forEach(n=>{let i=null;if(typeof n=="string"){const s=Ua[n];if(!s){Vd(n);return}i=s}else i=n;e.push(i)}),e}var Ig=class extends b.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}wireBeans(t){this.horizontalResizeService=t.horizontalResizeService}setElementToResize(t){this.elementToResize=t}postConstruct(){const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(t,e,n){this.eventService.dispatchEvent({type:"toolPanelSizeChanged",width:n,started:t,ended:e})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(t){return this.onResizing(t,!0)}onResizing(t,e=!1){const n=this.inverted?-1:1;let i=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,e,i)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},Lg=class extends b.Component{wireBeans(t){this.userComponentFactory=t.userComponentFactory}constructor(){super('<div class="ag-tool-panel-wrapper" role="tabpanel"/>')}postConstruct(){const t=this.getGui(),e=this.resizeBar=this.createManagedBean(new Ig);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:i,maxWidth:s,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),u=c.newAgStackInstance();if(this.params=c.params,u==null){b._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),i!=null&&this.resizeBar.setMinWidth(i),s!=null&&this.resizeBar.setMaxWidth(s)}setToolPanelComponent(t){this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc(()=>{this.destroyBean(t)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(t){const e=this.gos.get("enableRtl"),n=t==="left",i=e?n:!n;this.resizeBar.setInverted(i)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Og=class extends b.Component{constructor(){super(`<div class="ag-side-bar ag-unselectable">
|
|
9
9
|
<ag-side-bar-buttons data-ref="sideBarButtons"></ag-side-bar-buttons>
|
|
10
|
-
</div>`,[Ag]),this.sideBarButtons=b.RefPlaceholder,this.toolPanelWrappers=[]}wireBeans(t){this.focusService=t.focusService,this.filterManager=t.filterManager,this.sideBarService=t.sideBarService}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=this.gos.get("initialState")??{};this.setSideBarDef({sideBarDef:La(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new b.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),b._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,i=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),c=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.contains(l)){e.focusInto(c,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;c.contains(l)?p=this.focusService.findNextFocusableElement(c,void 0,!0):e.isTargetUnderManagedComponent(c,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,u)),p||(p=s.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=b._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),i=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=i.findIndex(u=>u.contains(e));let l=null;switch(t.key){case b.KeyCode.LEFT:case b.KeyCode.UP:l=Math.max(0,s-1);break;case b.KeyCode.RIGHT:case b.KeyCode.DOWN:l=Math.min(s+1,i.length-1);break}if(l===null)return;const c=i[l].querySelector("button");c&&(c.focus(),t.preventDefault())}onToolPanelButtonClicked(t){const e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(e,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){const i=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(i,e,n),!this.toolPanelWrappers.length)return;const s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(i=>{i.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,i;t[e.getToolPanelId()]=(i=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:i.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var i;for(const s of t)this.createToolPanelAndSideButton(s,(i=e==null?void 0:e.toolPanels)==null?void 0:i[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return b._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(b.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(b.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return b._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const i=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Ng),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(i.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const c=t===l.getToolPanelId();l.setDisplayed(c)});const i=this.openedItem();n!==i&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){b._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const i=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:i}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:i})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=La(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(i=>{var f,m;const{id:s}=i;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(v=>v.id===s);if(!l||i.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(v=>v.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...i.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(v=>v!==c),b._removeFromParent(c.getGui()),e[s]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{b._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Fg={selector:"AG-SIDE-BAR",component:Dg},Rg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Fg}},Oa="32.3.3",Ed=b._defineModule({version:Oa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[gg,Rg],dependantModules:[Re.EnterpriseCoreModule]}),Mg=b._defineModule({version:Oa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:yg,setSideBarVisible:vg,setSideBarPosition:_g,openToolPanel:Cg,closeToolPanel:wg,getOpenedToolPanel:bg,refreshToolPanel:xg,isToolPanelShowing:kg,getToolPanelInstance:Sg,getSideBar:Eg},dependantModules:[Ed]}),Ga=b._defineModule({version:Oa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Ed,Mg]}),Ig={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Lg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggFuncService",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const t=this.aggFuncsMap;t.sum=Og,t.first=Gg,t.last=zg,t.min=Zg,t.max=$g,t.count=Ug,t.avg=Wg,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),i=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return i&&s}getDefaultFuncLabel(t){return Ig[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(b._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return b._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),b._iterateObject(t,(e,n)=>{this.aggFuncsMap[e]=n})}getAggFunc(t){return this.init(),this.aggFuncsMap[t]}getFuncNames(t){const e=t.getColDef().allowedAggFuncs;return e??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function Og(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function Gg(t){return t.values.length>0?t.values[0]:null}function zg(t){return t.values.length>0?b._last(t.values):null}function Zg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function $g(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function Ug(t){var s,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const u=e[c];n+=u!=null&&typeof u.value=="number"?u.value:1}const i=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return i&&i.value===n?i:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function Wg(t){var c,u,p;const{values:e}=t;let n=0,i=0;for(let f=0;f<e.length;f++){const m=e[f];let v=null;typeof m=="number"||typeof m=="bigint"?(v=m,i++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(v=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),i+=m.count),typeof v=="number"?n+=typeof n=="number"?v:BigInt(v):typeof v=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+v)}let s=null;i>0&&(s=n/(typeof n=="number"?i:BigInt(i)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===i&&l.value===s?l:{count:i,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var Hg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=b._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),i=t.changedPath&&t.changedPath.isActive();if(e&&n&&i)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),i=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return b._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,i=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:i?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let i=!0;for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds!=null){i=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}if(!i)for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds==null||!u.pivotTotalColumnIds.length)continue;const p=u.pivotTotalColumnIds.map(f=>e[f]);e[u.colId]=this.aggregateValues(p,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},i=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,i,e.filteredOnly),c=t.aggData;return i.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&c&&s.forEach(u=>{n[u.getId()]=c[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let i=t;for(let s=0;s<e.length;s++){const l=e[s];i=i?i[l]:null}return i?i.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const i=[];e.forEach(()=>i.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let u=0;u<c;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],v=this.valueService.getValue(m,p);i[f].push(v)}}return i}aggregateValues(t,e,n,i,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:i,data:i?i.data:void 0});return c(u)}},jg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let i=b._isGroupMultiAutoColumn(this.gos);return n&&i&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,i)=>this.updateOneAutoCol(n,i,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const i=this.createAutoColDef(n,t,e);i.colId=n;const s=new b.AgColumn(i,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const i=t.getColDef(),s=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,c=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(c,null,n),this.columnFactory.applyColumnState(t,c,n)}createAutoColDef(t,e,n){let i=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(i,s),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||b._missing(i.field)&&b._missing(i.valueGetter)&&b._missing(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),n&&n>0&&(i.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),c=i.valueGetter||i.field!=null;return l&&!c&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(i,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}},qg=class extends Re.PillDragComp{constructor(t,e,n,i,s){super(e,n,s,`
|
|
10
|
+
</div>`,[Rg]),this.sideBarButtons=b.RefPlaceholder,this.toolPanelWrappers=[]}wireBeans(t){this.focusService=t.focusService,this.filterManager=t.filterManager,this.sideBarService=t.sideBarService}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=this.gos.get("initialState")??{};this.setSideBarDef({sideBarDef:$a(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new b.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),b._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,i=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),c=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.contains(l)){e.focusInto(c,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;c.contains(l)?p=this.focusService.findNextFocusableElement(c,void 0,!0):e.isTargetUnderManagedComponent(c,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,u)),p||(p=s.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=b._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),i=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=i.findIndex(u=>u.contains(e));let l=null;switch(t.key){case b.KeyCode.LEFT:case b.KeyCode.UP:l=Math.max(0,s-1);break;case b.KeyCode.RIGHT:case b.KeyCode.DOWN:l=Math.min(s+1,i.length-1);break}if(l===null)return;const c=i[l].querySelector("button");c&&(c.focus(),t.preventDefault())}onToolPanelButtonClicked(t){const e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(e,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){const i=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(i,e,n),!this.toolPanelWrappers.length)return;const s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(i=>{i.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,i;t[e.getToolPanelId()]=(i=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:i.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var i;for(const s of t)this.createToolPanelAndSideButton(s,(i=e==null?void 0:e.toolPanels)==null?void 0:i[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return b._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(b.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(b.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return b._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const i=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Lg),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(i.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const c=t===l.getToolPanelId();l.setDisplayed(c)});const i=this.openedItem();n!==i&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){b._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const i=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:i}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:i})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=$a(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(i=>{var f,m;const{id:s}=i;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(y=>y.id===s);if(!l||i.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...i.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),b._removeFromParent(c.getGui()),e[s]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{b._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Gg={selector:"AG-SIDE-BAR",component:Og},zg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Gg}},Wa="32.3.3",Ad=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[bg,zg],dependantModules:[Re.EnterpriseCoreModule]}),Zg=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:xg,setSideBarVisible:kg,setSideBarPosition:Sg,openToolPanel:Eg,closeToolPanel:Tg,getOpenedToolPanel:Bg,refreshToolPanel:Vg,isToolPanelShowing:Ag,getToolPanelInstance:Ng,getSideBar:Pg},dependantModules:[Ad]}),Ha=b._defineModule({version:Wa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Ad,Zg]}),Ug={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},$g=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggFuncService",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const t=this.aggFuncsMap;t.sum=Wg,t.first=Hg,t.last=jg,t.min=qg,t.max=Kg,t.count=Yg,t.avg=Jg,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),i=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return i&&s}getDefaultFuncLabel(t){return Ug[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(b._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return b._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),b._iterateObject(t,(e,n)=>{this.aggFuncsMap[e]=n})}getAggFunc(t){return this.init(),this.aggFuncsMap[t]}getFuncNames(t){const e=t.getColDef().allowedAggFuncs;return e??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function Wg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function Hg(t){return t.values.length>0?t.values[0]:null}function jg(t){return t.values.length>0?b._last(t.values):null}function qg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function Kg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function Yg(t){var s,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const u=e[c];n+=u!=null&&typeof u.value=="number"?u.value:1}const i=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return i&&i.value===n?i:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function Jg(t){var c,u,p;const{values:e}=t;let n=0,i=0;for(let f=0;f<e.length;f++){const m=e[f];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,i++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),i+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let s=null;i>0&&(s=n/(typeof n=="number"?i:BigInt(i)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===i&&l.value===s?l:{count:i,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var Xg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=b._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),i=t.changedPath&&t.changedPath.isActive();if(e&&n&&i)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),i=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return b._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,i=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:i?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let i=!0;for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds!=null){i=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}if(!i)for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds==null||!u.pivotTotalColumnIds.length)continue;const p=u.pivotTotalColumnIds.map(f=>e[f]);e[u.colId]=this.aggregateValues(p,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},i=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,i,e.filteredOnly),c=t.aggData;return i.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&c&&s.forEach(u=>{n[u.getId()]=c[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let i=t;for(let s=0;s<e.length;s++){const l=e[s];i=i?i[l]:null}return i?i.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const i=[];e.forEach(()=>i.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let u=0;u<c;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],y=this.valueService.getValue(m,p);i[f].push(y)}}return i}aggregateValues(t,e,n,i,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:i,data:i?i.data:void 0});return c(u)}},Qg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let i=b._isGroupMultiAutoColumn(this.gos);return n&&i&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,i)=>this.updateOneAutoCol(n,i,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const i=this.createAutoColDef(n,t,e);i.colId=n;const s=new b.AgColumn(i,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const i=t.getColDef(),s=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,c=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(c,null,n),this.columnFactory.applyColumnState(t,c,n)}createAutoColDef(t,e,n){let i=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(i,s),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||b._missing(i.field)&&b._missing(i.valueGetter)&&b._missing(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),n&&n>0&&(i.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),c=i.valueGetter||i.field!=null;return l&&!c&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(i,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}},ey=class extends Re.PillDragComp{constructor(t,e,n,i,s){super(e,n,s,`
|
|
11
11
|
<span role="option">
|
|
12
12
|
<span data-ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>
|
|
13
13
|
<span data-ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>
|
|
14
14
|
<ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>
|
|
15
15
|
<span data-ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>
|
|
16
16
|
</span>
|
|
17
|
-
`,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=i,this.eSortIndicator=b.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),i=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${i}`,e,this.isGroupingZone()&&!c&&l&&`, ${s[l]}`].filter(u=>!!u).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),i=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(i,i)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=i=>{i.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?i.ctrlKey||i.metaKey:i.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",i=>{i.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(i)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===b.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Re.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),i=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=b._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(i),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),c=m=>{this.destroyBean(t),this.popupShowing=!1,(m==null?void 0:m.key)==="Escape"&&n.focus(),l&&l()},u=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:c,ariaLabel:u("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===b.KeyCode.ENTER||m.key===b.KeyCode.SPACE){const v=t.getLastFocusedRow();if(v==null)return;const k=t.getComponentAt(v);k&&k.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},i=this.localeService.getLocaleTextFunc(),s=e.toString(),l=i(s,s);return new Kg(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return b.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},Kg=class extends b.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},za=class extends Re.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===b.DragSourceType.HeaderCell||t===b.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const i=t.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const i=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(i,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,i){return new qg(t,e,n,this.dropZonePurpose,i)}},Za=class extends za{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:b._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},$a=class extends za{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:b._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},Yg=class extends b.Component{wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const t=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:t,newColumnsLoaded:t}),this.addManagedPropertyListener("rowGroupPanelShow",t),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const t=document.createElement("div");t.classList.add("ag-column-drop-wrapper"),b._setAriaRole(t,"presentation"),this.rowGroupComp=new $a(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Za(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui());const e=this.onDropPanelVisible.bind(this);return this.addManagedListeners(this.rowGroupComp,{displayChanged:e}),this.addManagedListeners(this.pivotComp,{displayChanged:e}),this.onDropPanelVisible(),t}onDropPanelVisible(){const t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed(),e="ag-column-drop-horizontal-half-width";this.rowGroupComp.addOrRemoveCssClass(e,t),this.pivotComp.addOrRemoveCssClass(e,t)}onRowGroupChanged(){if(!this.rowGroupComp)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")this.rowGroupComp.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const e=!this.funcColsService.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const t=this.gos.get("pivotPanelShow");if(t==="always")this.pivotComp.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}},Jg={selector:"AG-GRID-HEADER-DROP-ZONES",component:Yg},Xg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return Jg}},Qg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),i=v=>!v.node.group,s=v=>v.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:i),{changedPath:c}=t,u=(v,k=!1)=>{v.childrenAfterFilter&&(v.childrenAfterAggFilter=v.childrenAfterFilter,k&&v.childrenAfterAggFilter.forEach(S=>u(S,k)),this.setAllChildrenCount(v)),v.sibling&&(v.sibling.childrenAfterAggFilter=v.childrenAfterAggFilter)},p=v=>{var k;v.childrenAfterAggFilter=((k=v.childrenAfterFilter)==null?void 0:k.filter(S=>{var N;return l({node:S})&&this.filterManager.doesRowPassAggregateFilters({rowNode:S})?(u(S,!0),!0):(N=S.childrenAfterAggFilter)==null?void 0:N.length}))||null,this.setAllChildrenCount(v),v.sibling&&(v.sibling.childrenAfterAggFilter=v.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const i=e.length;n=i;for(let s=0;s<i;++s)n+=e[s].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},ey=class extends b.TabGuardComp{constructor(){super(`
|
|
17
|
+
`,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=i,this.eSortIndicator=b.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),i=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${i}`,e,this.isGroupingZone()&&!c&&l&&`, ${s[l]}`].filter(u=>!!u).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),i=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(i,i)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=i=>{i.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?i.ctrlKey||i.metaKey:i.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",i=>{i.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(i)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===b.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Re.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),i=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=b._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(i),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),c=m=>{this.destroyBean(t),this.popupShowing=!1,(m==null?void 0:m.key)==="Escape"&&n.focus(),l&&l()},u=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:c,ariaLabel:u("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===b.KeyCode.ENTER||m.key===b.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const S=t.getComponentAt(y);S&&S.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},i=this.localeService.getLocaleTextFunc(),s=e.toString(),l=i(s,s);return new ty(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return b.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},ty=class extends b.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},ja=class extends Re.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===b.DragSourceType.HeaderCell||t===b.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const i=t.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const i=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(i,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,i){return new ey(t,e,n,this.dropZonePurpose,i)}},qa=class extends ja{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:b._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},Ka=class extends ja{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:b._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},ny=class extends b.Component{wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const t=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:t,newColumnsLoaded:t}),this.addManagedPropertyListener("rowGroupPanelShow",t),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const t=document.createElement("div");t.classList.add("ag-column-drop-wrapper"),b._setAriaRole(t,"presentation"),this.rowGroupComp=new Ka(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new qa(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui());const e=this.onDropPanelVisible.bind(this);return this.addManagedListeners(this.rowGroupComp,{displayChanged:e}),this.addManagedListeners(this.pivotComp,{displayChanged:e}),this.onDropPanelVisible(),t}onDropPanelVisible(){const t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed(),e="ag-column-drop-horizontal-half-width";this.rowGroupComp.addOrRemoveCssClass(e,t),this.pivotComp.addOrRemoveCssClass(e,t)}onRowGroupChanged(){if(!this.rowGroupComp)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")this.rowGroupComp.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const e=!this.funcColsService.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const t=this.gos.get("pivotPanelShow");if(t==="always")this.pivotComp.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}},ry={selector:"AG-GRID-HEADER-DROP-ZONES",component:ny},iy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return ry}},oy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),i=y=>!y.node.group,s=y=>y.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:i),{changedPath:c}=t,u=(y,S=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,S&&y.childrenAfterAggFilter.forEach(E=>u(E,S)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var S;y.childrenAfterAggFilter=((S=y.childrenAfterFilter)==null?void 0:S.filter(E=>{var F;return l({node:E})&&this.filterManager.doesRowPassAggregateFilters({rowNode:E})?(u(E,!0),!0):(F=E.childrenAfterAggFilter)==null?void 0:F.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const i=e.length;n=i;for(let s=0;s<i;++s)n+=e[s].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},sy=class extends b.TabGuardComp{constructor(){super(`
|
|
18
18
|
<div class="ag-group-filter">
|
|
19
19
|
<div data-ref="eGroupField"></div>
|
|
20
20
|
<div data-ref="eUnderlyingFilter"></div>
|
|
21
21
|
</div>
|
|
22
|
-
`),this.eGroupField=b.RefPlaceholder,this.eUnderlyingFilter=b.RefPlaceholder}wireBeans(t){this.filterManager=t.filterManager,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService}postConstruct(){this.initialiseTabGuard({})}init(t){return this.updateParams(t).then(()=>{this.addManagedEventListeners({columnRowGroupChanged:()=>this.onColumnRowGroupChanged(),filterDestroyed:e=>this.onFilterDestroyed(e)})})}refresh(t){return this.updateParams(t),!0}updateParams(t){return this.params=t,this.validateParams(),this.updateGroups()}validateParams(){const{colDef:t}=this.params;t.field&&b._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&b._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&b._warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const t=this.updateGroupField();return this.getUnderlyingFilters(t)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return b._warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];const t=this.funcColsService.getSourceColumnsForGroupColumn(this.groupColumn);return t||(b._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){b._clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const t=this.getSourceColumns(),e=t.filter(n=>n.isFilterAllowed());return e.length?(t.length===1?(this.selectedColumn=e[0],b._setDisplayed(this.eGroupField,!1)):((!this.selectedColumn||!e.some(n=>n.getId()===this.selectedColumn.getId()))&&(this.selectedColumn=e[0]),this.createGroupFieldSelectElement(e),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(b._loadTemplate('<div class="ag-filter-separator"></div>')),b._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,b._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new b.AgSelect);const e=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(e("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(t.map(n=>({value:n.getId(),text:this.columnNameService.getDisplayNameForColumn(n,"groupFilter",!1)??void 0}))),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(n=>this.updateSelectedColumn(n)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),t.length===1&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(t){if(!t)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),b.AgPromise.resolve();const e=[],n=[];return t.forEach(i=>{const s=this.filterManager.getOrCreateFilterWrapper(i);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:i}),i.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),b.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(b._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return b.AgPromise.resolve();const t=this.createManagedBean(new b.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),((e=t.getFilter())==null?void 0:e.then(()=>{var n,i;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((i=this.afterGuiAttachedParams)!=null&&i.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??b.AgPromise.resolve()):b.AgPromise.resolve()}updateSelectedColumn(t){var n;if(!t)return;(n=this.filterWrapperComp)==null||n.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const e=this.getFilterColumnPair(t);this.selectedColumn=e==null?void 0:e.column,this.selectedFilter=e==null?void 0:e.filter,this.dispatchLocalEvent({type:"selectedColumnChanged"}),this.addUnderlyingFilterElement()}isFilterActive(){var t;return!!((t=this.filterColumnPairs)!=null&&t.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return b.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;b._clearElement(this.eUnderlyingFilter),(e=(t=this.selectedFilter)==null?void 0:t.afterGuiDetached)==null||e.call(t)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:t,source:e}){var i;if(e==="gridDestroyed")return;const n=t.getColId();(i=this.filterColumnPairs)!=null&&i.some(({column:s})=>s.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(t){var e;if(t)return(e=this.filterColumnPairs)==null?void 0:e.find(({column:n})=>n.getId()===t)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}},
|
|
22
|
+
`),this.eGroupField=b.RefPlaceholder,this.eUnderlyingFilter=b.RefPlaceholder}wireBeans(t){this.filterManager=t.filterManager,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService}postConstruct(){this.initialiseTabGuard({})}init(t){return this.updateParams(t).then(()=>{this.addManagedEventListeners({columnRowGroupChanged:()=>this.onColumnRowGroupChanged(),filterDestroyed:e=>this.onFilterDestroyed(e)})})}refresh(t){return this.updateParams(t),!0}updateParams(t){return this.params=t,this.validateParams(),this.updateGroups()}validateParams(){const{colDef:t}=this.params;t.field&&b._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&b._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&b._warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const t=this.updateGroupField();return this.getUnderlyingFilters(t)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return b._warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];const t=this.funcColsService.getSourceColumnsForGroupColumn(this.groupColumn);return t||(b._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){b._clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const t=this.getSourceColumns(),e=t.filter(n=>n.isFilterAllowed());return e.length?(t.length===1?(this.selectedColumn=e[0],b._setDisplayed(this.eGroupField,!1)):((!this.selectedColumn||!e.some(n=>n.getId()===this.selectedColumn.getId()))&&(this.selectedColumn=e[0]),this.createGroupFieldSelectElement(e),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(b._loadTemplate('<div class="ag-filter-separator"></div>')),b._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,b._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new b.AgSelect);const e=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(e("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(t.map(n=>({value:n.getId(),text:this.columnNameService.getDisplayNameForColumn(n,"groupFilter",!1)??void 0}))),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(n=>this.updateSelectedColumn(n)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),t.length===1&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(t){if(!t)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),b.AgPromise.resolve();const e=[],n=[];return t.forEach(i=>{const s=this.filterManager.getOrCreateFilterWrapper(i);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:i}),i.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),b.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(b._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return b.AgPromise.resolve();const t=this.createManagedBean(new b.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),((e=t.getFilter())==null?void 0:e.then(()=>{var n,i;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((i=this.afterGuiAttachedParams)!=null&&i.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??b.AgPromise.resolve()):b.AgPromise.resolve()}updateSelectedColumn(t){var n;if(!t)return;(n=this.filterWrapperComp)==null||n.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const e=this.getFilterColumnPair(t);this.selectedColumn=e==null?void 0:e.column,this.selectedFilter=e==null?void 0:e.filter,this.dispatchLocalEvent({type:"selectedColumnChanged"}),this.addUnderlyingFilterElement()}isFilterActive(){var t;return!!((t=this.filterColumnPairs)!=null&&t.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return b.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;b._clearElement(this.eUnderlyingFilter),(e=(t=this.selectedFilter)==null?void 0:t.afterGuiDetached)==null||e.call(t)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:t,source:e}){var i;if(e==="gridDestroyed")return;const n=t.getColId();(i=this.filterColumnPairs)!=null&&i.some(({column:s})=>s.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(t){var e;if(t)return(e=this.filterColumnPairs)==null?void 0:e.find(({column:n})=>n.getId()===t)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}},ay=class extends b.Component{constructor(){super(`
|
|
23
23
|
<div data-ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>
|
|
24
|
-
`),this.eFloatingFilter=b.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new b.AgPromise(n=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new b.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,b._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var i,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((i=this.parentFilterInstance.getSelectedFilter())==null?void 0:i.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,i,s;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(s=(i=this.underlyingFloatingFilter)==null?void 0:i.onParamsUpdated)==null||s.call(i,e.params))}onParentModelChanged(t,e){var n,i;this.showingUnderlyingFloatingFilter?(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},Ua=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var i;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((i=t.allLeafChildren)==null?void 0:i.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function ny(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let i=1;i<e;i++)if(Td(t[i-1],t[i])>0){n=!0;break}return n?(t.sort(Td),!0):!1}function Td(t,e){const n=t.sourceRowIndex,i=e.sourceRowIndex,s=n>=0,l=i>=0,c=s&&l,u=!s&&!l;return c?n-i:u?t.__objectId-e.__objectId:s?1:-1}var ry=class extends b.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],i=[];let s;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!s?s=l:i.push(l):n.push(l)}),s&&i.push(s),e.childrenAfterGroup=[...n,...i]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:i,rowNodesOrderChanged:s}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:i,rowNodesOrderChanged:!!s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Ua;b._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),b._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),b._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const i=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(i,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{ny(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(i){b._exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),i.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let i=t.parent;for(;i&&i!==e.rootNode;)n.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(i=>{e.changedPath.isActive()&&e.changedPath.addParentNode(i.parent);const s=p=>p.key,l=this.getExistingPathForNode(i,e).map(s),c=this.getGroupInfo(i,e).map(s);b._areEqual(l,c)||this.moveNode(i,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const i=t.parent;e.changedPath.addParentNode(i)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(i=>e.changedPath.addParentNode(i.parent))}forEachParentGroup(t,e,n){let i=e;for(;i&&i!==t.rootNode;)n(i),i=i.parent}removeNodesFromParents(t,e,n){const i=n==null,s=n||new Ua;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,c=>{s.removeFromAllLeafChildren(c,l)})}),i&&s.flush()}removeEmptyGroups(t,e){let n=!0;const i=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),c=s.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!s.group&&(((p=s.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const s=new Ua;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{i(c)&&(n=!0,this.removeFromParent(c,s),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var i;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(b._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(i=t.parent)!=null&&i.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:b._areEqual(t.groupedCols,e.groupedCols)&&b._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(i=>{var c;if(!i.group)return;const l={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:(c=i.allLeafChildren)==null?void 0:c[0]};this.setGroupData(i,l,t),e(i.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,i=t.rootNode;i.leafGroup=n.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const i=this.showRowGroupColsService.getShowRowGroupCols(),s=i?i.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const i=this.getGroupInfo(t,e),s=this.findParentForNode(t,i,e,n);s.group||b._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=i.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,i){let s=n.rootNode;return e.forEach((l,c)=>{s=this.getOrCreateNextNode(s,l,c,n),i!=null&&i.isRemoveFromAllLeafChildren(s,t)?i==null||i.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,i){var c;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[s];return l||(l=this.createGroup(e,t,n,i),this.addToParent(l,t)),l}createGroup(t,e,n,i){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,i),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===i.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(i,s),s}createGroupId(t,e,n){const i=(s,l)=>{if(!s.rowGroupColumn)return null;const c=l?i(l,l.parent):null;return`${c==null?"":c+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+i(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const i={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(i)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(i=>{let s=this.valueService.getKeyForNode(i,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:i.getColDef().field,rowGroupColumn:i,leafNode:t};n.push(u)}}),n}},iy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,lt=Object.freeze([]),oy=lt.values(),ss=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},sy=class zf{constructor(e,n,i){this.parent=e,this.key=n,this.level=i,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=lt,this.allLeafChildren=lt,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.oldSourceRowIndex=-1}isEmptyFillerNode(){var e,n;return!((e=this.row)!=null&&e.data)&&!((n=this.children)!=null&&n.size)}hasChildren(){var e;return!!((e=this.children)!=null&&e.size)}enumChildren(){var e;return((e=this.children)==null?void 0:e.values())??oy}upsertKey(e){var i,s;typeof e!="string"&&(e=String(e));let n=(i=this.children)==null?void 0:i.get(e);return n||(n=new zf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var i;const{row:e,parent:n}=this;n!==null&&((i=n==null?void 0:n.children)==null||i.delete(this.key),e!==null&&ss(e,!0),this.parent=null)}setRow(e){const{level:n,row:i,childrenAfterGroup:s}=this;if(n<0)i!==null&&i!==e&&ss(i,!0);else{if(i===e)return!1;i!==null?(e.allLeafChildren=i.allLeafChildren??this.allLeafChildren??lt,ss(i,!1)):e.allLeafChildren=this.allLeafChildren??lt}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:i,duplicateRows:s,childrenAfterGroup:l}=this;if(i===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=i.allLeafChildren??this.allLeafChildren??lt)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return ss(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let i=this.duplicateRows;if(i===null)i=new Set,this.duplicateRows=i;else if(i.has(e))return!1;return i.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=lt),e.childrenAfterGroup=lt,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let i=n;for(const s of e)s.sourceRowIndex<i.sourceRowIndex&&(i=s);return i!==n&&(i.childrenAfterGroup=this.childrenAfterGroup,i.allLeafChildren=n.allLeafChildren??this.allLeafChildren??lt,n.childrenAfterGroup=lt,n.allLeafChildren=lt,e.delete(i),e.add(n),this.row=i),i}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,i;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((i=e.row)!=null&&i.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,i;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((i=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:i.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=lt,this.row.childrenAfterGroup=lt,!0);let n=!1,i=this.childrenAfterGroup;i===lt?(i=new Array(e),this.childrenAfterGroup=i,this.row.childrenAfterGroup=i,n=!0):i.length!==e&&(i.length=e,n=!0);let s=0,l=-1,c=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(c=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;i[s]!==m&&(i[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(i),n||c}reorderChildrenList(e){const n=e.length,i=this.children;e.sort(iy),i.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;i.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:i}=this;this.leafChildrenChanged=!1;let s=!1;const l=i.length;if(l===0)s=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=lt,this.allLeafChildren=lt;else if(l===1&&((u=i[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=i[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===lt||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let v=0;v<l;++v){const k=i[v],S=k.allLeafChildren,F=S.length;if(F)for(let T=0;T<F;++T){const N=S[T];(m>=f||p[m]!==N)&&(p[m]=N,s=!0),++m}else(m>=f||p[m]!==k)&&k&&(p[m]=k,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Bd=t=>(t.treeNodeFlags&1)!==0,Ad=t=>(t.treeNodeFlags&2)!==0,Pd=t=>(t.treeNodeFlags&4)!==0,ay=t=>(t.treeNodeFlags&8)!==0,Vd=t=>(t.treeNodeFlags&16)!==0,Nd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},ly=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},cy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},tr=t=>{t.treeNodeFlags|=16},Dd=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},qi=t=>{t.treeNodeFlags=0},dy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new sy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),qi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:i}=t,s=t.rowNode,l=this.gos,c={changedPath:i,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,c;const i=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((c=i.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(i),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:i,update:s,add:l}of e)this.removeRows(i),this.addOrUpdateRows(t,s,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,i=t.length;n<i;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,i=(t==null?void 0:t.length)??0;n<i;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let i=0,s=(e==null?void 0:e.length)??0;i<s;++i){const l=e[i],c=this.upsertPath(this.getDataPath(t,l));c&&this.addOrUpdateRow(c,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const i=t[e],s=i.treeNode;s!==null&&this.removeRow(s,i)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||lt;return n.length||b._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let i=0;i<=n;++i){const s=e.upsertKey(t[i]);if(i>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var c;const{level:i,row:s}=t;if(i<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Pd(e)&&(ly(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:i}=t;if(i<0)return;let s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var i;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&tr(n),n.updateHasChildren(),Vd(n)&&(i=t.changedPath)!=null&&i.isActive()&&t.changedPath.addParentNode(n),Dd(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const i=e.key;n.key!==i?(n.key=i,cy(n),this.setGroupData(n,i)):n.groupData||this.setGroupData(n,i)}commitNodePostOrder(t,e,n){var f,m,v;const i=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&tr(i),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((f=i.childrenAfterGroup)!=null&&f.length),u=c||!i.data,p=i.group;p!==u?(tr(i),i.setGroup(u),!u&&!i.expanded&&Nd(i,!1)):i.hasChildren()!==c&&(tr(i),i.updateHasChildren()),i.group&&!Ad(i)&&(s!==i&&s!==null&&s.group&&Ad(s)&&!t.isGroupOpenByDefault?i.expanded=s.expanded:i.expanded=this.getExpandedInitialValue(t,i),Nd(i,!0)),Pd(i)&&(tr(e.row),ay(i)&&i.setData(i.data)),s!==i&&(n.oldRow=i,s!==null&&(p||n.hasChildren())&&tr(i),e.childrenChanged=!0,tr(e.row)),Vd(i)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(i):Bd(i)||(i.childrenAfterFilter||(i.childrenAfterFilter=i.childrenAfterGroup.slice()),i.childrenAfterAggFilter||(i.childrenAfterAggFilter=i.childrenAfterFilter.slice()),i.childrenAfterSort||(i.childrenAfterSort=i.childrenAfterAggFilter.slice())),Dd(i),(v=n.duplicateRows)!=null&&v.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[i.id,i.data,...Array.from(n.duplicateRows).map(k=>k.data)]))}createFillerRow(t){const e=new b.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,i=t.parent;for(;i!==null;){const s=i.parent;if(s===null)break;n=`${i.level}-${i.key}-${n}`,i=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const i=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(i)for(const l of i)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:i,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&tr(e.row)),i!==null&&s>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:i}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):qi(e)),i)for(const s of i)n>=0&&!s.data?this.destroyRow(s,!0):qi(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Bd(t)){qi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}qi(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},uy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?dy:ry;let n=this.strategy;(n==null?void 0:n.constructor)!==e&&(this.destroyBean(n),n=this.createManagedBean(new e),this.strategy=n),n.execute(t),this.selectableService.updateSelectableAfterGrouping()}destroy(){this.destroyBean(this.strategy),this.strategy=void 0,super.destroy()}},Fd="PivotRowTotal_",py=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotColDefService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.columnNameService=t.columnNameService}postConstruct(){const t=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=t(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=t()});const e=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=e(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=e()})}createPivotColumnDefs(t){const e=this.createPivotColumnsFromUniqueValues(t);function n(l,c=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,c):c.push(u)}),c}const i=n(e);this.addRowGroupTotals(e,i),this.addExpandablePivotGroups(e,i),this.addPivotTotalsToGroups(e,i);const s=i.map(l=>b._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,i,s){const l=this.funcColsService.getValueColumns();if(t>=i)return this.buildMeasureCols(n);const c=s[t].getColDef(),u=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===i-1){const f=[];return b._iterateObject(e,m=>{const v=[...n,m],k=this.createColDef(l[0],m,v);k.columnGroupShow="open",f.push(k)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const v=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,k=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,k,i,s),headerName:f,pivotKeys:k,columnGroupShow:"open",openByDefault:v,groupId:this.generateColumnGroupId(k)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const i=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,i,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const i=(s,l,c)=>{if("children"in s){const f=new Map;s.children.forEach(v=>{i(v,l,f)});const m=!s.children.some(v=>v.children);this.funcColsService.getValueColumns().forEach(v=>{const k=this.columnNameService.getDisplayNameForColumn(v,"header"),S=this.createColDef(v,k,s.pivotKeys);S.pivotTotalColumnIds=f.get(v.getColId()),S.columnGroupShow=n?"open":"closed",S.aggFunc=v.getAggFunc(),m||(s.children.push(S),l.push(S))}),this.merge(c,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();c.has(u)?c.get(u).push(s.colId):c.set(u,[s.colId])};t.forEach(s=>{i(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",i=this.funcColsService.getValueColumns(),s=i.map(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=i[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,i){const s=t;if(!s.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(s.children.forEach(c=>{const u=this.recursivelyAddPivotTotal(c,e,n,i);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;i?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<s.length;c++){const u=s[c],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let k=0;k<e.length;k++){const S=e[k];S.pivotValueColumn===u&&m.push(S.colId)}f.pivotTotalColumnIds=m,f.colId=Fd+f.colId;const v=l?{children:[f],pivotKeys:[],groupId:`${Fd}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(v):t.unshift(v)}}createColDef(t,e,n,i=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!i?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},s.pivotKeys=n,s.pivotValueColumn=t,s.filter===!0&&(s.filter="agNumberColumnFilter"),s}sameAggFuncs(t){if(t.length==1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}headerNameComparator(t,e,n){return t?t(e.headerName,n.headerName):e.headerName&&!n.headerName?1:!e.headerName&&n.headerName?-1:!e.headerName||!n.headerName?0:e.headerName<n.headerName?-1:e.headerName>n.headerName?1:0}merge(t,e){e.forEach((n,i)=>{const l=[...t.has(i)?t.get(i):[],...n];t.set(i,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(i=>i.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const c=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<c.length;p++){const f=c[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,c,u)=>{const p=[];for(const v in c){const k=c[v],S=n(`${s}${this.fieldSeparator}${v}`,v,k,u+1);p.push(S)}if(p.length===0){const v=this.columnModel.getColDefCol(l);if(v){const S=this.columnNameService.getDisplayNameForColumn(v,"header")??l,F=this.createColDef(v,S,void 0,!1);return F.colId=s,F.aggFunc=v.getAggFunc(),F.valueGetter=T=>{var N;return(N=T.data)==null?void 0:N[s]},F}return{colId:s,headerName:l,valueGetter:S=>{var F;return(F=S.data)==null?void 0:F[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},i=[];for(const s in e){const l=e[s],c=n(s,s,l,0);i.push(c)}return i}},Rd="Exceeded maximum allowed pivot column count.",hy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let i;try{i=this.bucketUpRowNodes(t)}catch(C){if(C.message===Rd){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(i),l=this.funcColsService.getValueColumns(),c=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),v=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const k=this.gos.get("pivotRowTotals"),S=this.gos.get("pivotColumnGroupTotals"),F=this.gos.get("suppressExpandablePivotGroups"),T=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),N=k!==this.pivotRowTotalsLastTime||S!==this.pivotColumnGroupTotalsLastTime||F!==this.suppressExpandablePivotGroupsLastTime||T!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=k,this.pivotColumnGroupTotalsLastTime=S,this.suppressExpandablePivotGroupsLastTime=F,this.removePivotHeaderRowWhenSingleValueColumnLastTime=T,this.lastTimeFailed||s||p||v||f||N){const{pivotColumnGroupDefs:C,pivotColumnDefs:I}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=I,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const n=i=>{var s;i.leafGroup?this.bucketRowNode(i,e):(s=i.childrenAfterFilter)==null||s.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,i){const s={},l=e[n];if(t.forEach(c=>{let u=this.valueService.getKeyForNode(l,c);if(b._missing(u)&&(u=""),!i[u]){this.currentUniqueCount+=1,i[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Rd)}s[u]||(s[u]=[]),s[u].push(c)}),n===e.length-1)return s;{const c={};return b._iterateObject(s,(u,p)=>{c[u]=this.bucketChildren(p,e,n+1,i[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function fy(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function my(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function gy(t){t.aggFuncService&&t.aggFuncService.clear()}function yy(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function vy(t){return t.columnModel.isPivotMode()}function _y(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Cy(t,e){t.funcColsService.setValueColumns(e,"api")}function wy(t){return t.funcColsService.getValueColumns()}function by(t,e){t.funcColsService.removeValueColumns([e],"api")}function xy(t,e){t.funcColsService.removeValueColumns(e,"api")}function ky(t,e){t.funcColsService.addValueColumns([e],"api")}function Sy(t,e){t.funcColsService.addValueColumns(e,"api")}function Ey(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Ty(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function By(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Ay(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Py(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function Vy(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Ny(t){return t.funcColsService.getRowGroupColumns()}function Dy(t,e){t.funcColsService.setPivotColumns(e,"api")}function Fy(t,e){t.funcColsService.removePivotColumns([e],"api")}function Ry(t,e){t.funcColsService.removePivotColumns(e,"api")}function My(t,e){t.funcColsService.addPivotColumns([e],"api")}function Iy(t,e){t.funcColsService.addPivotColumns(e,"api")}function Ly(t){return t.funcColsService.getPivotColumns()}function Oy(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Gy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var zy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,i=typeof n=="string";!i&&!(n===!0)||(this.showRowGroupCols.push(t),i?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},Ki="32.3.3",Wa=b._defineModule({version:Ki,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[Hg,Qg,uy,py,hy,Lg,jg,zy,Xg],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),Zy=b._defineModule({version:Ki,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:fy,addAggFuncs:my,clearAggFuncs:gy,setColumnAggFunc:yy,isPivotMode:vy,getPivotResultColumn:_y,setValueColumns:Cy,getValueColumns:wy,removeValueColumn:by,removeValueColumns:xy,addValueColumn:ky,addValueColumns:Sy,setRowGroupColumns:Ey,removeRowGroupColumn:Ty,removeRowGroupColumns:By,addRowGroupColumn:Ay,addRowGroupColumns:Py,getRowGroupColumns:Ny,moveRowGroupColumn:Vy,setPivotColumns:Dy,removePivotColumn:Fy,removePivotColumns:Ry,addPivotColumn:My,addPivotColumns:Iy,getPivotColumns:Ly,setPivotResultColumns:Oy,getPivotResultColumns:Gy},dependantModules:[Wa]}),Md=b._defineModule({version:Ki,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:ey}],dependantModules:[Wa,b._ColumnFilterModule]}),$y=b._defineModule({version:Ki,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:ty}],dependantModules:[Md,b._FloatingFilterModule]}),Uy=b._defineModule({version:Ki,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Wa,Zy,Md,$y]}),Id=class extends za{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:b._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},Ld=300,Wy=class extends b.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
|
|
24
|
+
`),this.eFloatingFilter=b.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new b.AgPromise(n=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new b.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,b._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var i,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((i=this.parentFilterInstance.getSelectedFilter())==null?void 0:i.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,i,s;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(s=(i=this.underlyingFloatingFilter)==null?void 0:i.onParamsUpdated)==null||s.call(i,e.params))}onParentModelChanged(t,e){var n,i;this.showingUnderlyingFloatingFilter?(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},Ya=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var i;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((i=t.allLeafChildren)==null?void 0:i.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function ly(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let i=1;i<e;i++)if(Nd(t[i-1],t[i])>0){n=!0;break}return n?(t.sort(Nd),!0):!1}function Nd(t,e){const n=t.sourceRowIndex,i=e.sourceRowIndex,s=n>=0,l=i>=0,c=s&&l,u=!s&&!l;return c?n-i:u?t.__objectId-e.__objectId:s?1:-1}var cy=class extends b.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],i=[];let s;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!s?s=l:i.push(l):n.push(l)}),s&&i.push(s),e.childrenAfterGroup=[...n,...i]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:i,rowNodesOrderChanged:s}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:i,rowNodesOrderChanged:!!s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Ya;b._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),b._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),b._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const i=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(i,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{ly(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(i){b._exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),i.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let i=t.parent;for(;i&&i!==e.rootNode;)n.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(i=>{e.changedPath.isActive()&&e.changedPath.addParentNode(i.parent);const s=p=>p.key,l=this.getExistingPathForNode(i,e).map(s),c=this.getGroupInfo(i,e).map(s);b._areEqual(l,c)||this.moveNode(i,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const i=t.parent;e.changedPath.addParentNode(i)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(i=>e.changedPath.addParentNode(i.parent))}forEachParentGroup(t,e,n){let i=e;for(;i&&i!==t.rootNode;)n(i),i=i.parent}removeNodesFromParents(t,e,n){const i=n==null,s=n||new Ya;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,c=>{s.removeFromAllLeafChildren(c,l)})}),i&&s.flush()}removeEmptyGroups(t,e){let n=!0;const i=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),c=s.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!s.group&&(((p=s.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const s=new Ya;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{i(c)&&(n=!0,this.removeFromParent(c,s),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var i;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(b._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(i=t.parent)!=null&&i.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:b._areEqual(t.groupedCols,e.groupedCols)&&b._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(i=>{var c;if(!i.group)return;const l={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:(c=i.allLeafChildren)==null?void 0:c[0]};this.setGroupData(i,l,t),e(i.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,i=t.rootNode;i.leafGroup=n.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const i=this.showRowGroupColsService.getShowRowGroupCols(),s=i?i.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const i=this.getGroupInfo(t,e),s=this.findParentForNode(t,i,e,n);s.group||b._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=i.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,i){let s=n.rootNode;return e.forEach((l,c)=>{s=this.getOrCreateNextNode(s,l,c,n),i!=null&&i.isRemoveFromAllLeafChildren(s,t)?i==null||i.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,i){var c;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[s];return l||(l=this.createGroup(e,t,n,i),this.addToParent(l,t)),l}createGroup(t,e,n,i){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,i),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===i.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(i,s),s}createGroupId(t,e,n){const i=(s,l)=>{if(!s.rowGroupColumn)return null;const c=l?i(l,l.parent):null;return`${c==null?"":c+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+i(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const i={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(i)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(i=>{let s=this.valueService.getKeyForNode(i,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:i.getColDef().field,rowGroupColumn:i,leafNode:t};n.push(u)}}),n}},dy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ct=Object.freeze([]),uy=ct.values(),ls=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},py=class jf{constructor(e,n,i){this.parent=e,this.key=n,this.level=i,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=ct,this.allLeafChildren=ct,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.oldSourceRowIndex=-1}isEmptyFillerNode(){var e,n;return!((e=this.row)!=null&&e.data)&&!((n=this.children)!=null&&n.size)}hasChildren(){var e;return!!((e=this.children)!=null&&e.size)}enumChildren(){var e;return((e=this.children)==null?void 0:e.values())??uy}upsertKey(e){var i,s;typeof e!="string"&&(e=String(e));let n=(i=this.children)==null?void 0:i.get(e);return n||(n=new jf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var i;const{row:e,parent:n}=this;n!==null&&((i=n==null?void 0:n.children)==null||i.delete(this.key),e!==null&&ls(e,!0),this.parent=null)}setRow(e){const{level:n,row:i,childrenAfterGroup:s}=this;if(n<0)i!==null&&i!==e&&ls(i,!0);else{if(i===e)return!1;i!==null?(e.allLeafChildren=i.allLeafChildren??this.allLeafChildren??ct,ls(i,!1)):e.allLeafChildren=this.allLeafChildren??ct}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:i,duplicateRows:s,childrenAfterGroup:l}=this;if(i===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=i.allLeafChildren??this.allLeafChildren??ct)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return ls(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let i=this.duplicateRows;if(i===null)i=new Set,this.duplicateRows=i;else if(i.has(e))return!1;return i.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=ct),e.childrenAfterGroup=ct,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let i=n;for(const s of e)s.sourceRowIndex<i.sourceRowIndex&&(i=s);return i!==n&&(i.childrenAfterGroup=this.childrenAfterGroup,i.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ct,n.childrenAfterGroup=ct,n.allLeafChildren=ct,e.delete(i),e.add(n),this.row=i),i}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,i;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((i=e.row)!=null&&i.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,i;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((i=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:i.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ct,this.row.childrenAfterGroup=ct,!0);let n=!1,i=this.childrenAfterGroup;i===ct?(i=new Array(e),this.childrenAfterGroup=i,this.row.childrenAfterGroup=i,n=!0):i.length!==e&&(i.length=e,n=!0);let s=0,l=-1,c=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(c=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;i[s]!==m&&(i[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(i),n||c}reorderChildrenList(e){const n=e.length,i=this.children;e.sort(dy),i.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;i.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:i}=this;this.leafChildrenChanged=!1;let s=!1;const l=i.length;if(l===0)s=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ct,this.allLeafChildren=ct;else if(l===1&&((u=i[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=i[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===ct||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let y=0;y<l;++y){const S=i[y],E=S.allLeafChildren,M=E.length;if(M)for(let V=0;V<M;++V){const F=E[V];(m>=f||p[m]!==F)&&(p[m]=F,s=!0),++m}else(m>=f||p[m]!==S)&&S&&(p[m]=S,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Pd=t=>(t.treeNodeFlags&1)!==0,Dd=t=>(t.treeNodeFlags&2)!==0,Fd=t=>(t.treeNodeFlags&4)!==0,hy=t=>(t.treeNodeFlags&8)!==0,Rd=t=>(t.treeNodeFlags&16)!==0,Md=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},fy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},my=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},ir=t=>{t.treeNodeFlags|=16},Id=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},Ji=t=>{t.treeNodeFlags=0},gy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new py(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),Ji(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:i}=t,s=t.rowNode,l=this.gos,c={changedPath:i,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,c;const i=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((c=i.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(i),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:i,update:s,add:l}of e)this.removeRows(i),this.addOrUpdateRows(t,s,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,i=t.length;n<i;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,i=(t==null?void 0:t.length)??0;n<i;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let i=0,s=(e==null?void 0:e.length)??0;i<s;++i){const l=e[i],c=this.upsertPath(this.getDataPath(t,l));c&&this.addOrUpdateRow(c,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const i=t[e],s=i.treeNode;s!==null&&this.removeRow(s,i)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ct;return n.length||b._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let i=0;i<=n;++i){const s=e.upsertKey(t[i]);if(i>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var c;const{level:i,row:s}=t;if(i<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Fd(e)&&(fy(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:i}=t;if(i<0)return;let s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var i;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&ir(n),n.updateHasChildren(),Rd(n)&&(i=t.changedPath)!=null&&i.isActive()&&t.changedPath.addParentNode(n),Id(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const i=e.key;n.key!==i?(n.key=i,my(n),this.setGroupData(n,i)):n.groupData||this.setGroupData(n,i)}commitNodePostOrder(t,e,n){var f,m,y;const i=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&ir(i),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((f=i.childrenAfterGroup)!=null&&f.length),u=c||!i.data,p=i.group;p!==u?(ir(i),i.setGroup(u),!u&&!i.expanded&&Md(i,!1)):i.hasChildren()!==c&&(ir(i),i.updateHasChildren()),i.group&&!Dd(i)&&(s!==i&&s!==null&&s.group&&Dd(s)&&!t.isGroupOpenByDefault?i.expanded=s.expanded:i.expanded=this.getExpandedInitialValue(t,i),Md(i,!0)),Fd(i)&&(ir(e.row),hy(i)&&i.setData(i.data)),s!==i&&(n.oldRow=i,s!==null&&(p||n.hasChildren())&&ir(i),e.childrenChanged=!0,ir(e.row)),Rd(i)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(i):Pd(i)||(i.childrenAfterFilter||(i.childrenAfterFilter=i.childrenAfterGroup.slice()),i.childrenAfterAggFilter||(i.childrenAfterAggFilter=i.childrenAfterFilter.slice()),i.childrenAfterSort||(i.childrenAfterSort=i.childrenAfterAggFilter.slice())),Id(i),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[i.id,i.data,...Array.from(n.duplicateRows).map(S=>S.data)]))}createFillerRow(t){const e=new b.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,i=t.parent;for(;i!==null;){const s=i.parent;if(s===null)break;n=`${i.level}-${i.key}-${n}`,i=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const i=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(i)for(const l of i)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:i,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&ir(e.row)),i!==null&&s>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:i}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):Ji(e)),i)for(const s of i)n>=0&&!s.data?this.destroyRow(s,!0):Ji(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Pd(t)){Ji(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}Ji(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},yy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?gy:cy;let n=this.strategy;(n==null?void 0:n.constructor)!==e&&(this.destroyBean(n),n=this.createManagedBean(new e),this.strategy=n),n.execute(t),this.selectableService.updateSelectableAfterGrouping()}destroy(){this.destroyBean(this.strategy),this.strategy=void 0,super.destroy()}},Ld="PivotRowTotal_",vy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotColDefService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.columnNameService=t.columnNameService}postConstruct(){const t=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=t(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=t()});const e=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=e(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=e()})}createPivotColumnDefs(t){const e=this.createPivotColumnsFromUniqueValues(t);function n(l,c=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,c):c.push(u)}),c}const i=n(e);this.addRowGroupTotals(e,i),this.addExpandablePivotGroups(e,i),this.addPivotTotalsToGroups(e,i);const s=i.map(l=>b._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,i,s){const l=this.funcColsService.getValueColumns();if(t>=i)return this.buildMeasureCols(n);const c=s[t].getColDef(),u=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===i-1){const f=[];return b._iterateObject(e,m=>{const y=[...n,m],S=this.createColDef(l[0],m,y);S.columnGroupShow="open",f.push(S)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,S=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,S,i,s),headerName:f,pivotKeys:S,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(S)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const i=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,i,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const i=(s,l,c)=>{if("children"in s){const f=new Map;s.children.forEach(y=>{i(y,l,f)});const m=!s.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const S=this.columnNameService.getDisplayNameForColumn(y,"header"),E=this.createColDef(y,S,s.pivotKeys);E.pivotTotalColumnIds=f.get(y.getColId()),E.columnGroupShow=n?"open":"closed",E.aggFunc=y.getAggFunc(),m||(s.children.push(E),l.push(E))}),this.merge(c,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();c.has(u)?c.get(u).push(s.colId):c.set(u,[s.colId])};t.forEach(s=>{i(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",i=this.funcColsService.getValueColumns(),s=i.map(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=i[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,i){const s=t;if(!s.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(s.children.forEach(c=>{const u=this.recursivelyAddPivotTotal(c,e,n,i);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;i?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<s.length;c++){const u=s[c],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let S=0;S<e.length;S++){const E=e[S];E.pivotValueColumn===u&&m.push(E.colId)}f.pivotTotalColumnIds=m,f.colId=Ld+f.colId;const y=l?{children:[f],pivotKeys:[],groupId:`${Ld}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,i=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!i?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},s.pivotKeys=n,s.pivotValueColumn=t,s.filter===!0&&(s.filter="agNumberColumnFilter"),s}sameAggFuncs(t){if(t.length==1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}headerNameComparator(t,e,n){return t?t(e.headerName,n.headerName):e.headerName&&!n.headerName?1:!e.headerName&&n.headerName?-1:!e.headerName||!n.headerName?0:e.headerName<n.headerName?-1:e.headerName>n.headerName?1:0}merge(t,e){e.forEach((n,i)=>{const l=[...t.has(i)?t.get(i):[],...n];t.set(i,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(i=>i.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const c=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<c.length;p++){const f=c[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,c,u)=>{const p=[];for(const y in c){const S=c[y],E=n(`${s}${this.fieldSeparator}${y}`,y,S,u+1);p.push(E)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const E=this.columnNameService.getDisplayNameForColumn(y,"header")??l,M=this.createColDef(y,E,void 0,!1);return M.colId=s,M.aggFunc=y.getAggFunc(),M.valueGetter=V=>{var F;return(F=V.data)==null?void 0:F[s]},M}return{colId:s,headerName:l,valueGetter:E=>{var M;return(M=E.data)==null?void 0:M[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},i=[];for(const s in e){const l=e[s],c=n(s,s,l,0);i.push(c)}return i}},Od="Exceeded maximum allowed pivot column count.",_y=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let i;try{i=this.bucketUpRowNodes(t)}catch(C){if(C.message===Od){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(i),l=this.funcColsService.getValueColumns(),c=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const S=this.gos.get("pivotRowTotals"),E=this.gos.get("pivotColumnGroupTotals"),M=this.gos.get("suppressExpandablePivotGroups"),V=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),F=S!==this.pivotRowTotalsLastTime||E!==this.pivotColumnGroupTotalsLastTime||M!==this.suppressExpandablePivotGroupsLastTime||V!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=S,this.pivotColumnGroupTotalsLastTime=E,this.suppressExpandablePivotGroupsLastTime=M,this.removePivotHeaderRowWhenSingleValueColumnLastTime=V,this.lastTimeFailed||s||p||y||f||F){const{pivotColumnGroupDefs:C,pivotColumnDefs:G}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=G,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const n=i=>{var s;i.leafGroup?this.bucketRowNode(i,e):(s=i.childrenAfterFilter)==null||s.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,i){const s={},l=e[n];if(t.forEach(c=>{let u=this.valueService.getKeyForNode(l,c);if(b._missing(u)&&(u=""),!i[u]){this.currentUniqueCount+=1,i[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Od)}s[u]||(s[u]=[]),s[u].push(c)}),n===e.length-1)return s;{const c={};return b._iterateObject(s,(u,p)=>{c[u]=this.bucketChildren(p,e,n+1,i[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Cy(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function wy(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function by(t){t.aggFuncService&&t.aggFuncService.clear()}function xy(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function ky(t){return t.columnModel.isPivotMode()}function Sy(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Ey(t,e){t.funcColsService.setValueColumns(e,"api")}function Ty(t){return t.funcColsService.getValueColumns()}function By(t,e){t.funcColsService.removeValueColumns([e],"api")}function Vy(t,e){t.funcColsService.removeValueColumns(e,"api")}function Ay(t,e){t.funcColsService.addValueColumns([e],"api")}function Ny(t,e){t.funcColsService.addValueColumns(e,"api")}function Py(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Dy(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function Fy(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Ry(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function My(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function Iy(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Ly(t){return t.funcColsService.getRowGroupColumns()}function Oy(t,e){t.funcColsService.setPivotColumns(e,"api")}function Gy(t,e){t.funcColsService.removePivotColumns([e],"api")}function zy(t,e){t.funcColsService.removePivotColumns(e,"api")}function Zy(t,e){t.funcColsService.addPivotColumns([e],"api")}function Uy(t,e){t.funcColsService.addPivotColumns(e,"api")}function $y(t){return t.funcColsService.getPivotColumns()}function Wy(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Hy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var jy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,i=typeof n=="string";!i&&!(n===!0)||(this.showRowGroupCols.push(t),i?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},Xi="32.3.3",Ja=b._defineModule({version:Xi,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[Xg,oy,yy,vy,_y,$g,Qg,jy,iy],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),qy=b._defineModule({version:Xi,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Cy,addAggFuncs:wy,clearAggFuncs:by,setColumnAggFunc:xy,isPivotMode:ky,getPivotResultColumn:Sy,setValueColumns:Ey,getValueColumns:Ty,removeValueColumn:By,removeValueColumns:Vy,addValueColumn:Ay,addValueColumns:Ny,setRowGroupColumns:Py,removeRowGroupColumn:Dy,removeRowGroupColumns:Fy,addRowGroupColumn:Ry,addRowGroupColumns:My,getRowGroupColumns:Ly,moveRowGroupColumn:Iy,setPivotColumns:Oy,removePivotColumn:Gy,removePivotColumns:zy,addPivotColumn:Zy,addPivotColumns:Uy,getPivotColumns:$y,setPivotResultColumns:Wy,getPivotResultColumns:Hy},dependantModules:[Ja]}),Gd=b._defineModule({version:Xi,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:sy}],dependantModules:[Ja,b._ColumnFilterModule]}),Ky=b._defineModule({version:Xi,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:ay}],dependantModules:[Gd,b._FloatingFilterModule]}),Yy=b._defineModule({version:Xi,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Ja,qy,Gd,Ky]}),zd=class extends ja{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:b._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},Zd=300,Jy=class extends b.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
|
|
25
25
|
<div data-ref="eExpand" class="ag-column-select-header-icon"></div>
|
|
26
26
|
<ag-checkbox data-ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>
|
|
27
27
|
<ag-input-text-field class="ag-column-select-header-filter-wrapper" data-ref="eFilterTextField"></ag-input-text-field>
|
|
28
|
-
</div>`,[b.AgCheckboxSelector,b.AgInputTextFieldSelector]),this.eExpand=b.RefPlaceholder,this.eSelect=b.RefPlaceholder,this.eFilterTextField=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===b.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const t=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t)}init(t){this.params=t;const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=b._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=b._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=b._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isProvidedColGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),b._setDisplayed(this.eFilterTextField.getGui(),t),b._setDisplayed(this.eSelect.getGui(),e),b._setDisplayed(this.eExpand,n&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},
|
|
28
|
+
</div>`,[b.AgCheckboxSelector,b.AgInputTextFieldSelector]),this.eExpand=b.RefPlaceholder,this.eSelect=b.RefPlaceholder,this.eFilterTextField=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===b.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const t=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t)}init(t){this.params=t;const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=b._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=b._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=b._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isProvidedColGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),b._setDisplayed(this.eFilterTextField.getGui(),t),b._setDisplayed(this.eSelect.getGui(),e),b._setDisplayed(this.eExpand,n&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Zd)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===b.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Zd)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,b._setDisplayed(this.eExpandChecked,this.expandState===0),b._setDisplayed(this.eExpandUnchecked,this.expandState===1),b._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},Xy={selector:"AG-PRIMARY-COLS-HEADER",component:Jy},Ud=class{constructor(t,e,n,i=!1,s){this.localEventService=new b.LocalEventService,this.displayName=t,this.dept=n,this.group=i,i?(this.columnGroup=e,this.expanded=s,this.children=[]):this.column=e}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(t){this.passesFilter=t}addEventListener(t,e){this.localEventService.addEventListener(t,e)}removeEventListener(t,e){this.localEventService.removeEventListener(t,e)}},$d=class extends b.Component{constructor(t,e,n){super('<div class="ag-menu"></div>'),this.column=t,this.mouseEvent=e,this.parentEl=n,this.displayName=null}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.popupService=t.popupService,this.focusService=t.focusService}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),b.isColumn(this.column)?this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const t=this.getMappedMenuItems();if(t.length===0)return;this.displayContextMenu(t)}}initializeProperties(t){b.isProvidedColumnGroup(t)?this.columns=t.getLeafColumns():this.columns=[t],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const t=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColGroupLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${t("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${t("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>t("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>t("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>t("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>t("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(t){return[...t].concat(this.columns.filter(e=>t.indexOf(e)===-1))}removeColumnsFromList(t){return t.filter(e=>this.columns.indexOf(e)===-1)}displayContextMenu(t){const e=this.getGui(),n=this.createBean(new Re.AgMenuList),i=this.localeService.getLocaleTextFunc();let s=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),s()}});const l=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(n.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:c=>{c instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});l&&(s=l.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const t=[];for(const e of this.menuItemMap.values()){const n=this.columns.some(s=>e.allowedFunction(s)&&!e.activeFunction(s)),i=this.columns.some(s=>e.allowedFunction(s)&&e.activeFunction(s));n&&t.push({name:e.activateLabel(this.displayName),icon:b._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),i&&t.push({name:e.deactivateLabel(this.displayName),icon:b._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Wd=class extends b.Component{constructor(t,e,n,i){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=i,this.cbSelect=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.eGroupOpenedIcon=b.RefPlaceholder,this.eGroupClosedIcon=b.RefPlaceholder,this.eColumnGroupIcons=b.RefPlaceholder,this.processingColumnStateChange=!1,this.modelItem=t,this.columnGroup=t.getColumnGroup(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName(),this.allowDragging=e}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column-group">
|
|
29
29
|
<span class="ag-column-group-icons" data-ref="eColumnGroupIcons" >
|
|
30
30
|
<span class="ag-column-group-closed-icon" data-ref="eGroupClosedIcon"></span>
|
|
31
31
|
<span class="ag-column-group-opened-icon" data-ref="eGroupOpenedIcon"></span>
|
|
32
32
|
</span>
|
|
33
33
|
<ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
|
|
34
34
|
<span class="ag-column-select-column-label" data-ref="eLabel"></span>
|
|
35
|
-
</div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case b.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case b.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case b.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new
|
|
35
|
+
</div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case b.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case b.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case b.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new $d(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const t=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListeners(e,{visibleChanged:t,columnValueChanged:t,columnPivotChanged:t,columnRowGroupChanged:t})})}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:this.eventType})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.columnGroup.getLeafColumns(),e={},n={};return t.forEach(i=>{const s=i.getId();e[s]=i.isVisible(),n[s]=this.modelItemUtils.createPivotState(i)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(b._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(b._createIcon("columnSelectOpen",this.gos,null));const t=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(this.eGroupClosedIcon,{click:t}),this.addManagedElementListeners(this.eGroupOpenedIcon,{click:t});const e=new b.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(e,{tap:t}),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}getVisibleLeafColumns(){const t=[],e=n=>{n.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?e(i.getChildren()):t.push(i.getColumn()))})};return e(this.modelItem.getChildren()),t}onChangeCommon(t){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue(),i=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),s=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${s} (${i})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const t=this.workOutSelectedValue(),e=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(e),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",e),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.columnModel.isPivotMode(),e=this.getVisibleLeafColumns();let n=0,i=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:i++)}),!(n>0&&i>0))return n>0}workOutReadOnlyValue(){const t=this.columnModel.isPivotMode();let e=0;return this.columnGroup.getLeafColumns().forEach(n=>{t?n.isAnyFunctionAllowed()&&e++:n.getColDef().lockVisible||e++}),e===0}isColumnChecked(t,e){if(e){const n=t.isPivotActive(),i=t.isRowGroupActive(),s=t.isValueActive();return n||i||s}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();b._setDisplayed(this.eGroupClosedIcon,!t),b._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){b._setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(t){const e=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!e||!t&&e)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(t){this.cbSelect.setValue(t,!0)}},Qy=class extends b.BeanStub{constructor(t,e){super(),this.comp=t,this.virtualList=e}wireBeans(t){this.columnMoveService=t.columnMoveService,this.columnModel=t.columnModel}postConstruct(){this.createManagedBean(new Re.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:b.DragSourceType.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventService,getCurrentDragValue:t=>this.getCurrentDragValue(t),isMoveBlocked:t=>this.isMoveBlocked(t),getNumRows:t=>t.getDisplayedColsList().length,moveItem:(t,e)=>this.moveItem(this.getCurrentColumnsBeingMoved(t),e)}))}getCurrentDragValue(t){return t.column}getCurrentColumnsBeingMoved(t){return b.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(s=>{const l=s.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let i=null,s=e.position==="top";if(n instanceof Wd?(i=n.getColumns()[0],s=!0):n&&(i=n.getColumn()),!i)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:i,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:i}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=i?s:s+1,c=this.getMoveDiff(e,l);return l-c}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const i=t[0],s=t.length;return n.indexOf(i)<e?s:0}},ev=class extends b.Component{constructor(t,e,n,i){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=i,this.eLabel=b.RefPlaceholder,this.cbSelect=b.RefPlaceholder,this.processingColumnStateChange=!1,this.column=t.getColumn(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName()}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column">
|
|
36
36
|
<ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
|
|
37
37
|
<span class="ag-column-select-column-label" data-ref="eLabel"></span>
|
|
38
|
-
</div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=b._escapeString(this.displayName);this.eLabel.innerHTML=n;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.setupDragging();const s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(c=>this.addOrRemoveCssClass(c,!0))}getColumn(){return this.column}setupTooltip(){const t=this.gos.get("tooltipShowMode")==="whenTruncated";let e;t&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const n=()=>{const i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new Gd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(t){t.key===b.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${n})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const i=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!i&&!s,n=e}else{const{enableRowGroup:i,enableValue:s,lockPosition:l,suppressMovable:c,lockVisible:u}=this.column.getColDef(),p=!!i||!!s,f=!!l||!!c;e=!u,n=p||!f}this.cbSelect.setReadOnly(!e),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!e),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(t){b._warnOnce("can not expand a column item that does not represent a column group header")}},Ky=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},Yy="ag-column-select-list",Jy=class extends b.Component{constructor(){super(`<div class="${Yy}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Re.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(b._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new jy(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const i=new zd(t,this.allowDragging,this.eventType,e);return this.createBean(i),i}const n=new qy(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const i=n.getColumnGroup();if(i){const s=t[i.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=c=>{c.addEventListener("expandedChanged",e);const u=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},i=(c,u,p)=>{c.forEach(f=>{b.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(c,u,p)=>{const f=c.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(c.isPadding()){i(c.getChildren(),u,p);return}const v=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),k=new Od(v,c,u,!0,this.expandGroupsByDefault);p.push(k),n(k),i(c.getChildren(),u+1,k.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Od(m,c,u))};this.destroyColumnTree(),i(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new Ky(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),i=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${i} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(i=>{t(i),i.isGroup()&&e(i.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const i=e.filter(s=>!b._includes(n,s));i.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",i)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(i=>{if(i.isGroup()||!i.isPassesFilter())return;const s=i.getColumn(),l=s.getColDef();let c;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;c=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;c=s.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=b._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!b._exists(this.filterText))return!0;const i=n.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},e=(n,i)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||i);p&&(s=p)})}const l=i||s?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},Xy={selector:"AG-PRIMARY-COLS-LIST",component:Jy},Qy=class extends b.Component{constructor(){super(`<div class="ag-column-select">
|
|
38
|
+
</div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=b._escapeString(this.displayName);this.eLabel.innerHTML=n;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.setupDragging();const s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(c=>this.addOrRemoveCssClass(c,!0))}getColumn(){return this.column}setupTooltip(){const t=this.gos.get("tooltipShowMode")==="whenTruncated";let e;t&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const n=()=>{const i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new $d(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(t){t.key===b.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${n})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const i=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!i&&!s,n=e}else{const{enableRowGroup:i,enableValue:s,lockPosition:l,suppressMovable:c,lockVisible:u}=this.column.getColDef(),p=!!i||!!s,f=!!l||!!c;e=!u,n=p||!f}this.cbSelect.setReadOnly(!e),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!e),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(t){b._warnOnce("can not expand a column item that does not represent a column group header")}},tv=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},nv="ag-column-select-list",rv=class extends b.Component{constructor(){super(`<div class="${nv}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Re.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(b._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new Qy(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const i=new Wd(t,this.allowDragging,this.eventType,e);return this.createBean(i),i}const n=new ev(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const i=n.getColumnGroup();if(i){const s=t[i.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=c=>{c.addEventListener("expandedChanged",e);const u=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},i=(c,u,p)=>{c.forEach(f=>{b.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(c,u,p)=>{const f=c.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(c.isPadding()){i(c.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),S=new Ud(y,c,u,!0,this.expandGroupsByDefault);p.push(S),n(S),i(c.getChildren(),u+1,S.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Ud(m,c,u))};this.destroyColumnTree(),i(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new tv(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),i=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${i} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(i=>{t(i),i.isGroup()&&e(i.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const i=e.filter(s=>!b._includes(n,s));i.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",i)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(i=>{if(i.isGroup()||!i.isPassesFilter())return;const s=i.getColumn(),l=s.getColDef();let c;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;c=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;c=s.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=b._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!b._exists(this.filterText))return!0;const i=n.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},e=(n,i)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||i);p&&(s=p)})}const l=i||s?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},iv={selector:"AG-PRIMARY-COLS-LIST",component:rv},ov=class extends b.Component{constructor(){super(`<div class="ag-column-select">
|
|
39
39
|
<ag-primary-cols-header data-ref="primaryColsHeaderPanel"></ag-primary-cols-header>
|
|
40
40
|
<ag-primary-cols-list data-ref="primaryColsListPanel"></ag-primary-cols-list>
|
|
41
|
-
</div>`,[
|
|
41
|
+
</div>`,[Xy,iv]),this.primaryColsHeaderPanel=b.RefPlaceholder,this.primaryColsListPanel=b.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const i=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&s&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListeners(this.primaryColsListPanel,{groupExpanded:this.onGroupExpanded.bind(this),selectionChanged:this.onSelectionChange.bind(this)}),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListeners(this.primaryColsHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),selectAll:this.onSelectAll.bind(this),unselectAll:this.onUnselectAll.bind(this),filterChanged:this.onFilterChanged.bind(this)}),this.positionableFeature=new b.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(t){this.positionableFeature.setResizable(t?{bottom:!0}:!1)}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(t){this.primaryColsListPanel.setGroupsExpanded(!0,t)}collapseGroups(t){this.primaryColsListPanel.setGroupsExpanded(!1,t)}setColumnLayout(t){this.primaryColsListPanel.setColumnLayout(t)}onFilterChanged(t){this.primaryColsListPanel.setFilterText(t.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(t){this.primaryColsHeaderPanel.setExpandState(t.state),this.params.onStateUpdated()}onSelectionChange(t){this.primaryColsHeaderPanel.setSelectionState(t.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},Hd=class extends b.Component{constructor(){super(...arguments),this.cbPivotMode=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel,this.ctrlsService=t.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel">
|
|
42
42
|
<ag-toggle-button data-ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>
|
|
43
|
-
</div>`}postConstruct(){this.setTemplate(this.createTemplate(),[b.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const t=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const e=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnPivotModeChanged:e})}onBtPivotMode(){const t=!!this.cbPivotMode.getValue();t!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:t},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)}},ev=class extends b.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}init(t){const e=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...e,...t},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Zd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Qy),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new $a(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Id(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Za(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[n]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>n())}this.initialised=!0}setPivotModeSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new Zd),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new $a(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Id(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Za(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(s=>s.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=b._last(n);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const i=e[n];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(b.ModuleNames.RowGroupingModule,"Row Grouping")}expandColumnGroups(t){this.primaryColsPanel.expandGroups(t)}collapseColumnGroups(t){this.primaryColsPanel.collapseGroups(t)}setColumnLayout(t){this.primaryColsPanel.setColumnLayout(t)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(t=>t()),this.childDestroyFuncs.length=0,b._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},tv=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const i=this.extractAllLeafColumns(t);this.setAllColumns(i,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=i=>{i.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const i=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&i.push({colId:s.getId(),hide:!e})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const i=[],c=e?u=>{var p;if(!u.isAnyFunctionActive())if(u.isAllowValue()){const f=typeof u.getAggFunc()=="string"?u.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(u);i.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?i.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&i.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&i.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:i,eventType:s}=t,l=e.map(c=>{const u=c.getColId();if(this.columnModel.isPivotMode()){const p=i==null?void 0:i[u];return{colId:u,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:u,hide:!(n!=null&&n[u])}});this.columnApplyStateService.applyColumnState({state:l},s)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},nv="32.3.3",$d=b._defineModule({version:nv,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[tv],userComponents:[{name:"agColumnsToolPanel",classImp:ev},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,Uy,Ga]});function Ud(){b.ModuleRegistry.registerModules([Ko.ClientSideRowModelModule,$f.InfiniteRowModelModule,nd.ServerSideRowModelModule,Uf.CsvExportModule,rd.ClipboardModule,id.RangeSelectionModule,Wf.RichSelectModule,Hf.MenuModule,jf.ExcelExportModule,Ga,$d]);const t=fg("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const Wd=qf.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#110529",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}),Hd=Symbol("sdk-vue");function Ha(){return r.inject(Hd)}function rv(t,e){let n;Ud();const i=()=>{t.loadBlockState().then(l=>{s.loaded=!0;const c=sm(l,t),u=e(c),p=Object.fromEntries(Object.entries(u.routes).map(([f,m])=>{const v=typeof m=="function"?m():m;return[f,r.markRaw(v)]}));n=Object.assign(c,{...u,getRoute(f){return p[f]}})}).catch(l=>{console.error("load initial state error",l),s.error=l})},s=r.reactive({loaded:!1,error:void 0,useApp(){return Yf(n,"App is not loaded")},install(l){l.provide(Hd,this),i()}});return s}var iv=Object.defineProperty,ov=(t,e,n)=>e in t?iv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,sv=(t,e,n)=>ov(t,e+"",n);function jd(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function av(t,e,n){const i=Math.min(e,n),s=Math.max(e,n);return t>=i&&t<=s}function lv(t){return new Promise(e=>setTimeout(e,t))}function cv(t){return t()}function as(t,e,n){return e>t?e:t>n?n:t}function qd(t,e){return e(t)}function Ar(t,e){if(t!=null)return e(t)}function dv(t){if(t&&t.ok)return t.value}async function uv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Kd=t=>t;function pv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function hv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(pv(65,91));return e}function fv(){return hv(42)}function Yi(t){return t!==null&&typeof t=="object"}function mv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ja(t,e){return Yi(t)&&Yi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ja(t[n],e[n])):t===e}function Ji(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Ji(t[n]);return e}else if(Yi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Ji(t[n])}),e}else return t}function gv(t){return Array.isArray(t)?Object.assign([],t):Yi(t)?Object.assign({},t):t}function yv(t,e){const n={};for(const i in e)e[i]!==t[i]&&(n[i]=t[i]);return n}function vv(t,e,n){return Object.assign({},t,{[e]:n})}function _v(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function Cv(t,e,n){return t[e]=n,t}function wv(t,e){return t[e]}function bv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function xv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function kv(t,...e){return e.map(n=>t[n])}function Sv(t,...e){const n=Object.assign({},t);return e.forEach(i=>delete n[i]),n}const qa=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:_v,deepClone:Ji,deepEqual:ja,getProp:wv,iSet:vv,isObject:Yi,map:mv,omit:Sv,pick:xv,pickValues:kv,setProp:Cv,shallowClone:gv,shallowDiff:yv,shiftProp:bv},Symbol.toStringTag,{value:"Module"}));function Ev(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}function Yd(t,e,n){let i;return function(...s){i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}const Tv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Bv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Av=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Pv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Jd=(t,e)=>{let n=String(t);return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e):e===!0&&(n=t.toLocaleString(void 0)),n};function Ka(t,e){if(t=typeof t=="bigint"?Number(t):t,!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);Object.assign(e,{bits:!1,binary:!1});const n=e.bits?e.binary?Pv:Av:e.binary?Bv:Tv;if(e.signed&&t===0)return` 0 ${n[0]}`;const i=t<0,s=i?"-":e.signed?"+":"";if(i&&(t=-t),t<1){const p=Jd(t,e.locale);return s+p+" "+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),n.length-1);t/=(e.binary?1024:1e3)**l,t=Number(t.toPrecision(3));const c=Jd(Number(t),e.locale),u=n[l];return s+c+" "+u}const Vv={class:"context-menu"},Nv=["onClick"],Dv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,i=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Vv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>i(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,Nv))),128))]))}}),nr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Fv=nr(Dv,[["__scopeId","data-v-12530966"]]);function Ya(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},i=r.h(Fv,{options:e,onClose:()=>{n()}});r.render(i,document.body);const s=i.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const Xd=Symbol(),ls=()=>r.inject(Xd),Rv=["value"],Mv={key:1},Iv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({edit:!1}),l=r.computed(()=>i.valueType),c=f=>{var m;let v=(m=f.target)==null?void 0:m.value;const k=r.unref(l),S=cv(()=>k==="integer"?parseInt(v,10):k==="float"?Number(v):v);n("update:modelValue",S),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&i.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,v;(v=(m=u.value)==null?void 0:m.querySelector("input"))==null||v.focus()}))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:u,class:r.normalizeClass(["base-cell",{"base-cell__edit":s.edit}]),onClick:p},[s.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:f.modelValue,onFocusout:m[0]||(m[0]=v=>s.edit=!1),onChange:c},null,40,Rv)):(r.openBlock(),r.createElementBlock("div",Mv,r.toDisplayString(f.modelValue),1))],2))}}),Lv=["^data-row-index"],Ov={key:0,class:"control-cell"},Gv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ls(),i=r.computed(()=>e.cell.column.valueType),s=f=>{Ar(n.settings.value.onUpdatedRow,m=>{const v=e.cell.row,k={...v.dataRow,[e.cell.id]:f};m({...v,dataRow:k})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const v=n.settings??{},k=[],{onSelectedRows:S,onSelectedColumns:F}=v.value,T=n.data.selectedRows.has(m.primaryKey);S&&S.length&&(T?k.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):k.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),F&&F.length&&(k.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),k.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),k.length&&Ya(f,k)},u=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:u,class:r.normalizeClass(["td-cell",{[f.cell.class]:!0}]),"^data-row-index":f.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=v=>c(v,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",Ov,r.toDisplayString(f.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":f.cell.value,"onUpdate:modelValue":s},null,8,["model-value"])):(r.openBlock(),r.createBlock(Iv,{key:2,"model-value":f.cell.value,"value-type":i.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Lv))}}),zv={},Zv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $v(t,e){return r.openBlock(),r.createElementBlock("svg",Zv,e[0]||(e[0]=[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),r.createTextVNode(),r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const Uv=nr(zv,[["render",$v]]),Wv={class:"tr-head"},Hv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Wv,[r.renderSlot(e.$slots,"default")]))}});function jv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function qv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}const Kv=["^data-col-id"],Yv=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function i(l){l.preventDefault();const c=[];c.length&&Ya(l,c)}function s(l){var c;const u=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:jv(u,["DESC","ASC"])})}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cell th-cell",{"justify-center":l.col.justify,frozen:l.col.frozen}]),"^data-col-id":l.col.id,onContextmenu:i},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:c[0]||(c[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,Kv))}}),Jv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Ar(e.value,i=>i.scrollLeft=0)})};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:i.row.selected}]),scroll:"no",style:r.normalizeStyle(i.row.style),onScroll:n},[r.renderSlot(i.$slots,"default")],38))}}),Xv=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ls(),n=t,i=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:i.value,frozen:s.column.frozen}])},null,2))}});function et(t,e,n,i){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,i)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,i)})}function Qv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function e_(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function t_(t,e){let n;function i(l){n={...l}}Qv(()=>{n=void 0,e()});const s=e_(t);return et(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:i}}const ti=1,n_=10,r_=30,Qd=60;function eu(){const t=r.reactive({x:0,y:0});function e(n){t.x=n.pageX,t.y=n.pageY}return r.onMounted(()=>window.addEventListener("mousemove",e)),r.onUnmounted(()=>window.removeEventListener("mousemove",e)),t}function tu(t,e={}){const{delayEnter:n=0,delayLeave:i=0}=e,s=r.ref(!1);let l;const c=u=>{const p=u?n:i;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(et(t,"mouseenter",()=>c(!0)),et(t,"mouseleave",()=>c(!1))),s}function i_(t){var e;const n=Ar((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),i=>[...i])??[];return n.map(i=>{const{width:s,x:l}=i.getBoundingClientRect(),c=i.getAttribute("data-col-id");return Kd({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function o_(t,e){const n=eu(),i=tu(e,{}),{data:s}=t,l=t_(u=>{Ar(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=as(u.width+u.diff,r_,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),c=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!i.value){document.body.style.cursor="";return}if(s.resize)return;const u=i_(e).find(p=>Math.abs(n.x-p.right)<n_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const s_={key:0,class:"command-menu"},a_={key:0},l_=["onClick"],c_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ls(),n=r.computed(()=>e.getSelectedRows()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",s_,[n.value.length?(r.openBlock(),r.createElementBlock("span",a_,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,l_))),128))])):r.createCommentVNode("",!0)}}),d_={key:0,class:"command-menu"},u_={key:0},p_=["onClick"],h_=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ls(),n=r.computed(()=>e.getSelectedColumns()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",d_,[n.value.length?(r.openBlock(),r.createElementBlock("span",u_,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,p_))),128))])):r.createCommentVNode("",!0)}});function rr(t,e){const n={el:void 0,x:0,y:0},i=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});et(document,"mousedown",s=>{s.target===r.unref(t)&&(s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault(),n.el=r.unref(t),n.x=s.x,n.y=s.y)}),et(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...i(s),stop:!0},n))}),et(document,"mousemove",s=>{n.el&&e(i(s),n)})}const f_=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.windowSize-12),c=r.computed(()=>i.windowSize<i.dataSize),u=r.computed(()=>Math.ceil(i.offset*(l.value/i.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/i.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return rr(s,(m,v)=>{const k=(u.value+m.dy)*i.dataSize/l.value;n("change:offset",k),v.x=m.x,v.y=m.y}),(m,v)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"handleRef",ref:s,class:"t-scroll__handle",style:r.normalizeStyle(f.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function m_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:i,scrollLeft:s}=e,l=[...e.columns],c=fv();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const v={...m,offset:u};return u+=m.width+ti,v}),f=p.filter(m=>m.frozen);return Ev(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<i+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function g_(t,e){const n=r.computed(()=>e.value.reduce((i,s)=>(i[s.id]=s.justify?"justify-"+s.justify:"",i),{}));return r.computed(()=>t.rows.map(i=>{const s=n.value,{primaryKey:l,offset:c,dataRow:u,height:p}=i,f=e.value.map(m=>({id:m.id,column:m,row:i,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Kd({style:{top:`${c-t.scrollTop}px`,height:`${i.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const y_=async(t,e)=>{const{scrollTop:n,bodyHeight:i}=t;return await lv(0),uv({rows:e.getRows(n,i),dataWindow:t})};function v_(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=Ji(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(v=>{e.dataHeight=v,f.updateBodyHeight()}).catch(v=>e.error=v)},{immediate:!0});const n=r.computed(()=>t.settings),i=r.computed(()=>e.columns.reduce((m,v)=>m+v.width+ti,0)),s=r.computed(()=>qd(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>qd(i.value-f.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=m_({data:e,settings:n}),p=g_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((k,S)=>k+S.width+ti,0),v=e.bodyWidth+e.scrollLeft;if(m<v){const k=e.columns[e.columns.length-1];k.width=k.width+(v-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=as(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=as(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:v}=e,k=m>v?v:m;e.bodyHeight=k},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,v)=>{const k=m.current;(!k||m.scrollTop<k.scrollTop||m.scrollTop+m.bodyHeight>k.bodyHeight+k.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Qd,bodyHeight:m.bodyHeight+Qd*2},y_(Ji(e.currentWindow),n.value.dataSource).then(({rows:S,dataWindow:F})=>{ja(e.currentWindow,F)&&(e.rows=S)}))},{deep:!0,immediate:!0}),r.provide(Xd,f),f}const __={class:"command-menu__container"},C_={key:0,class:"table-body__no-data"},w_={class:"carets"},Ja=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,i=t,s=v_(i),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,T=>n("update:data",T),{deep:!0}),r.watch(i,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Ar(f.value,T=>{s.updateDimensions(T.getBoundingClientRect())})},v=s.tableColumns,k=s.tableRows,{mouseDown:S}=o_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(i.settings),r.nextTick(m)}),et(window,"resize",()=>r.nextTick(m));const F=T=>{T.preventDefault(),s.updateOffsets(T)};return(T,N)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:N[2]||(N[2]=(...C)=>r.unref(S)&&r.unref(S)(...C))},[r.createElementVNode("div",__,[r.createVNode(c_),N[3]||(N[3]=r.createTextVNode()),r.createVNode(h_)]),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Hv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(v),(C,I)=>(r.openBlock(),r.createBlock(Yv,{key:I,col:C,style:r.normalizeStyle(C.style),"onChange:sort":N[0]||(N[0]=Q=>T.$emit("change:sort",Q))},null,8,["col","style"]))),128))]),_:1})],512),N[8]||(N[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:F},[l.value?(r.openBlock(),r.createElementBlock("div",C_,[r.createElementVNode("div",null,[r.createVNode(Uv),N[4]||(N[4]=r.createTextVNode()),N[5]||(N[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),N[6]||(N[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(k),(C,I)=>(r.openBlock(),r.createBlock(Jv,{key:I,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,Q=>(r.openBlock(),r.createBlock(Gv,{key:Q.column.id+":"+I,cell:Q,style:r.normalizeStyle(Q.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),N[9]||(N[9]=r.createTextVNode()),r.createElementVNode("div",w_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(v),(C,I)=>(r.openBlock(),r.createBlock(Xv,{key:I,column:C,style:r.normalizeStyle(C.style),"onChange:sort":N[1]||(N[1]=Q=>T.$emit("change:sort",Q))},null,8,["column","style"]))),128))]),N[10]||(N[10]=r.createTextVNode()),r.createVNode(f_,{offset:r.unref(s).data.scrollTop,"window-size":r.unref(s).data.bodyHeight,"data-size":r.unref(s).data.dataHeight,"onChange:offset":r.unref(s).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),nu=new WeakMap;class b_{constructor(e,n,i){sv(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=i;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+ti,c),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((c,u)=>({dataRow:c,index:u,primaryKey:this.resolvePrimaryKey(c,u),offset:jd(s.indices.get(u)),height:this.resolveHeight(c,u)}));nu.set(this,l)}get rows(){return nu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return qv(this.rows,i=>{const s=i.offset;return e<s+i.height&&s<n+e})}}class x_{constructor(e,n,i){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=i}get height(){return this.rowHeight+ti}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const i=as(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:i,limit:s})).map((l,c)=>({dataRow:l,index:i+c,primaryKey:this.resolvePrimaryKey(l,i+c),offset:(i+c)*(this.rowHeight+ti),height:this.rowHeight}))}}function k_(t){return Object.freeze(t)}function S_(t){return r.h(Ja,{settings:Object.freeze(t)})}function Xa(t,e){const n=new b_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function E_(t,e){return r.computed(()=>{const n=r.unref(t);return Xa(n,r.unref(e))})}function T_(t,e){const n=r.computed(()=>{const s=r.unref(t);return Xa(s,r.unref(e))}),i=r.reactive({settings:n});return r.computed(()=>r.h(Ja,i))}const B_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:x_,Component:Ja,factory:S_,rawDataSettings:Xa,settings:k_,useRawData:E_,useRawDataComponent:T_},Symbol.toStringTag,{value:"Module"}));function*A_(t,e){for(const n of t)yield e(n)}function P_(t){const e=[];for(const n of t)e.push(n);return e}function ru(t){return t()}function Qa(t,e){if(t==null)throw Error(e);return t}function el(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function iu(t){return new Promise(e=>setTimeout(e,t))}function ou(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function su(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function V_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(su(65,91));return e}function au(t){return function(e){return 1-t(1-e)}}function N_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function lu(t){const{duration:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function D_(t){const{getFraction:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function cu(t,e){let n=-1;return(...i)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...i),e)}}function du(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function F_(t){return t.map(e=>({text:String(e),value:e}))}function Pr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const tl=new Map;function R_(t){return tl.has(t)||tl.set(t,r.ref(localStorage.getItem(t))),Qa(tl.get(t),"...")}function M_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function uu(t){const e=R_(t);return r.watch(e,n=>M_(t,n)),e}const nl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{P_(A_(nl.values(),e=>e(t.matches?"dark":"light")))});const I_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",pu=r.ref(I_),rl=uu("theme");function hu(t){const e=r.computed(()=>rl.value?rl.value:pu.value),n=s=>{pu.value=s,t&&t(s)};function i(){rl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{nl.add(n)}),r.onUnmounted(()=>{nl.delete(n)}),[e,i]}const L_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=hu();return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),O_={class:"pl-layout-component pl-block-page"},G_={key:0,class:"pl-block-page__title"},z_={class:"pl-block-page__title__append"},Z_={key:1},$_={class:"pl-block-page__body"},U_={name:"PlBlockPage"},W_=r.defineComponent({...U_,setup(t){const e=r.useSlots();return(n,i)=>(r.openBlock(),r.createElementBlock("div",O_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",G_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",z_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",Z_)),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",$_,[r.renderSlot(n.$slots,"default")])]))}}),H_={name:"PlContainer"},j_=r.defineComponent({...H_,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),q_={name:"PlRow"},K_=r.defineComponent({...q_,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),Y_={class:"pl-layout-component",style:{"flex-grow":"1"}},J_={name:"PlSpacer"},fu=r.defineComponent({...J_,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Y_))}}),X_={name:"PlGrid"},Q_=r.defineComponent({...X_,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),eC={key:0,class:"pl-alert__icon"},tC={class:"pl-alert__main"},nC={key:0},rC={class:"pl-alert__main__text"},iC={name:"PlAlert"},oC=r.defineComponent({...iC,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,i)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",eC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),i[2]||(i[2]=r.createTextVNode()),r.createElementVNode("div",tC,[n.label?(r.openBlock(),r.createElementBlock("label",nC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",rC,[r.renderSlot(n.$slots,"default")])]),i[3]||(i[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:i[0]||(i[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Xi=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),i=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass(i.value)},null,6))}});function mu(t){function e(n){const i=n.currentTarget,s=document.createElement("span"),l=Math.max(i.clientWidth,i.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-i.offsetLeft-c}px`,s.style.top=`${n.clientY-i.offsetTop-c}px`,s.classList.add("ripple");const u=i.getElementsByClassName("ripple")[0];u&&u.remove(),i.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const sC={key:0},aC={inheritAttrs:!1},cs=r.defineComponent({...aC,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),i=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return mu(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:i.value,large:s.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",sC,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(Xi),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(Xi),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),lC={name:"PlBtnPrimary"},il=r.defineComponent({...lC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),cC={name:"PlBtnAccent"},dC=r.defineComponent({...cC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),uC={name:"PlBtnDanger"},pC=r.defineComponent({...uC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hC={name:"PlBtnSecondary"},ol=r.defineComponent({...hC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),fC={key:0},mC={name:"PlBtnGhost"},sl=r.defineComponent({...mC,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),i=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return mu(s),(c,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["pl-btn-ghost",{loading:c.loading,small:n.value,large:i.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}]},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[r.unref(l).default&&!c.round?(r.openBlock(),r.createElementBlock("span",fC,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(Xi),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(Xi),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),gC=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:i.disabled,loading:i.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(ol,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(i.$slots,"default")],34))}});function Qi(t,e){const n=el(()=>{if(t.value){const{scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p,offsetY:i+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),et(window,"scroll",n,{capture:!0,passive:!0}),et(window,"resize",n,{passive:!0}),et(window,"adjust",n,!0)}function yC(t,e){const n=r.ref();return Qi(t,i=>{n.value=i}),r.computed(()=>{const i=r.unref(n),s=r.unref(e),l=s.position??"top",c=s.gap??8;if(!i)return"";const u=i.offsetY+Math.floor(i.height/2),p=i.offsetX+Math.floor(i.width/2);return l==="top-left"?`left: ${i.offsetX}px; top: ${i.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${i.offsetY-c}px;`:l==="right"?`left: ${i.offsetX+i.width+c}px; top: ${u}px;`:l==="left"?`right: ${i.scrollWidth-i.x+c}px; top: ${u}px;`:""})}function eo(t,e){return e(t)}function it(t,e){if(t!=null)return e(t)}function vC(t){return Array.isArray(t)?t:[t]}function _C(t,e,...n){n.forEach(i=>{t[i]=e[i]})}function ds(t,e){et(document,"click",n=>{document.contains(n.target)&&(vC(t).map(i=>i.value).filter(i=>!!i).some(i=>i==null?void 0:i.contains(n.target))||e())})}const CC={},wC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bC(t,e){return r.openBlock(),r.createElementBlock("svg",wC,e[0]||(e[0]=[r.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const xC=nr(CC,[["render",bC]]),al=new Map,kC={name:"PlTooltip"},Tt=r.defineComponent({...kC,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,i=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});al.set(i,()=>f()),r.watch(()=>l.open,T=>{requestAnimationFrame(()=>{l.tooltipOpen=T})});let c=()=>{};const u=du(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[T,N]of al.entries())T!==i&&N()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await iu(100),l.over&&p())},v=()=>{l.over=!1,c=ou(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,T=>{T&&f()});const k=r.ref(),S=r.ref(),F=yC(k,r.toRef(s));return ds([k,S],()=>f()),r.onUnmounted(()=>{al.delete(i)}),(T,N)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(T.element),r.mergeProps(T.$attrs,{ref_key:"rootRef",ref:k,onClick:m,onMouseover:m,onMouseleave:v}),{default:r.withCtx(()=>[r.renderSlot(T.$slots,"default"),N[1]||(N[1]=r.createTextVNode()),T.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(F))},[r.createElementVNode("div",{ref_key:"tooltip",ref:S,class:r.normalizeClass(["pl-tooltip",T.position]),onMouseover:m,onMouseleave:v},[r.createElementVNode("div",null,[r.renderSlot(T.$slots,"tooltip")]),N[0]||(N[0]=r.createTextVNode()),r.createVNode(xC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),SC={},EC={class:"inner-border"};function TC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",EC,[r.renderSlot(t.$slots,"default")])}const BC=nr(SC,[["render",TC]]),AC={key:0},PC=["tabindex","onKeydown","onClick"],VC={key:1,class:"ui-btn-group__helper"},NC={key:2,class:"ui-btn-group__error"},DC={name:"PlBtnGroup"},FC=r.defineComponent({...DC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=u=>i("update:modelValue",u),l=t,c=r.computed(()=>l.options.map(u=>({label:"label"in u?u.label:u.text,value:u.value})));return(u,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",AC,[r.createElementVNode("span",null,r.toDisplayString(u.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(u.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(BC,{class:"ui-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["ui-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(v=>s(f.value),["enter"]),onClick:v=>s(f.value)},r.toDisplayString(f.label),43,PC))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",VC,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",NC,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),RC={inheritAttrs:!1},MC={class:"double-contour"};function IC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",MC,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const ir=nr(RC,[["render",IC]]);function gu(t){r.onMounted(t),r.onUpdated(t)}const ll=new WeakMap,cl=new ResizeObserver(t=>{for(const e of t)it(ll.get(e.target),n=>n(e))});function yu(t,e){ll.set(t,e),cl.unobserve(t),cl.observe(t)}function vu(t){cl.unobserve(t),ll.delete(t)}const LC=8,_u=4;function Rn(t,e="label"){const n=new Set;gu(()=>{it(t==null?void 0:t.value,i=>{const s=i.querySelector(e);s&&(n.add(s),yu(s,()=>{const l=ru(()=>s.getBoundingClientRect().width+eo(LC,c=>Number.isNaN(c)?_u:c+_u));i.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&i.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(i=>vu(i))})}function OC(t,e){const n=[];return e&&e.length>0&&e.forEach(i=>{const s=i(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Cu(t,e){return r.computed(()=>OC(t.value,e))}const GC=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),i=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),zC="_icon_1ugxm_2",ZC={icon:zC},$C={$style:ZC},us=nr(GC,[["__cssModules",$C]]),UC=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),WC="_icon_1ugxm_2",HC={icon:WC},jC={$style:HC},wu=nr(UC,[["__cssModules",jC]]),qC={class:"pl-text-field__envelope"},KC={key:0,ref:"label"},YC={key:0,class:"required-icon"},JC={key:1,class:"pl-text-field__prefix"},XC=["disabled","placeholder","type"],QC={class:"pl-text-field__append"},e0={key:0,class:"pl-text-field__error"},t0={key:1,class:"pl-text-field__helper"},n0={name:"PlTextField"},bu=r.defineComponent({...n0,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),i=t,s=r.ref(void 0),l=r.ref(),c=r.ref(!1),u=r.reactive({cached:void 0}),p=r.computed({get(){return u.cached?u.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(M){if(u.cached=void 0,i.parse)try{n.value=i.parse(M)}catch(R){u.cached={error:R instanceof Error?R.message:String(R),value:M}}else n.value=M}}),f=r.computed(()=>i.type&&i.type==="password"?c.value?"text":i.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),v=()=>{i.clearable&&(u.cached=void 0,n.value=i.clearable===!0?"":i.clearable())},k=Cu(p,i.rules||[]),S=r.computed(()=>i.clearable?i.clearable===!0?n.value==="":n.value===i.clearable():n.value===""),F=r.computed(()=>!S.value),T=r.computed(()=>{const M=[];return i.error&&M.push(i.error),u.cached&&M.push(u.cached.error),k.value.isValid||M.push(...k.value.errors),M}),N=r.computed(()=>T.value.length>0),C=r.computed(()=>i.clearable&&F.value&&i.type!=="password"),I=()=>c.value=!c.value,Q=()=>{u.cached=void 0};return Rn(s),(M,R)=>(r.openBlock(),r.createElementBlock("div",qC,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:N.value,disabled:M.disabled,dashed:M.dashed,nonEmpty:F.value}])},[M.label?(r.openBlock(),r.createElementBlock("label",KC,[M.required?(r.openBlock(),r.createElementBlock("i",YC)):r.createCommentVNode("",!0),R[1]||(R[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(M.label),1),R[2]||(R[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(M.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),R[5]||(R[5]=r.createTextVNode()),M.prefix?(r.openBlock(),r.createElementBlock("div",JC,r.toDisplayString(M.prefix),1)):r.createCommentVNode("",!0),R[6]||(R[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":R[0]||(R[0]=U=>p.value=U),disabled:M.disabled,placeholder:M.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:Q},null,40,XC),[[r.vModelDynamic,p.value]]),R[7]||(R[7]=r.createTextVNode()),r.createElementVNode("div",QC,[C.value?(r.openBlock(),r.createBlock(r.unref(us),{key:0,name:"delete-clear",onClick:v})):r.createCommentVNode("",!0),R[3]||(R[3]=r.createTextVNode()),M.type==="password"?(r.openBlock(),r.createBlock(r.unref(wu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:I},null,8,["name"])):r.createCommentVNode("",!0),R[4]||(R[4]=r.createTextVNode()),r.renderSlot(M.$slots,"append")]),R[8]||(R[8]=r.createTextVNode()),r.createVNode(ir,{class:"pl-text-field__contour"})],2),R[9]||(R[9]=r.createTextVNode()),N.value?(r.openBlock(),r.createElementBlock("div",e0,r.toDisplayString(T.value.join(" ")),1)):M.helper?(r.openBlock(),r.createElementBlock("div",t0,r.toDisplayString(M.helper),1)):r.createCommentVNode("",!0)]))}}),r0={class:"ui-text-area__envelope"},i0={key:0,ref:"label"},o0={key:0,class:"required-icon"},s0=["readonly","rows","disabled","placeholder"],a0={class:"ui-text-area__append"},l0={key:0,class:"ui-text-area__error"},c0={key:1,class:"ui-text-area__helper"},d0={name:"PlTextArea"},u0=r.defineComponent({...d0,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(S){i("update:modelValue",S)}}),p=r.computed(()=>!!s.modelValue),f=Cu(u,s.rules||[]);Rn(l);const m=r.computed(()=>{const S=[];return s.error&&S.push(s.error),S.push(...f.value.errors),S}),v=r.computed(()=>m.value.length>0),k=()=>{if(!s.autogrow)return;const S=c.value;S&&(S.style.height="auto",S.style.height=`${S.scrollHeight}px`)};return r.onMounted(()=>{k()}),(S,F)=>(r.openBlock(),r.createElementBlock("div",r0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:v.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:p.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",i0,[S.required?(r.openBlock(),r.createElementBlock("i",o0)):r.createCommentVNode("",!0),F[1]||(F[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),F[2]||(F[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),F[3]||(F[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":F[0]||(F[0]=T=>u.value=T),readonly:S.readonly,rows:S.rows,disabled:S.disabled,placeholder:S.placeholder??"...",spellcheck:"false",onInput:k},null,40,s0),[[r.vModelText,u.value]]),F[4]||(F[4]=r.createTextVNode()),r.createElementVNode("div",a0,[r.renderSlot(S.$slots,"append")]),F[5]||(F[5]=r.createTextVNode()),r.createVNode(ir,{class:"ui-text-area__contour"})],2),F[6]||(F[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",l0,r.toDisplayString(m.value.join(" ")),1)):S.helper?(r.openBlock(),r.createElementBlock("div",c0,r.toDisplayString(S.helper),1)):r.createCommentVNode("",!0)]))}});function xu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n&&s>n}function ku(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n?"ceil":s>n?"floor":"visible"}function to(t,e,n={}){const i=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,u=ku(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=i+f*(m-i)};xu(t,e)||lu({duration:n.duration||100,timing:au(f=>f),draw:p})}function dl(t,e,n,i){return t.addEventListener(e,n,i),function(){t.removeEventListener(e,n)}}function p0(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}function Su(t){return t!==null&&typeof t=="object"}function Bt(t,e){return Su(t)&&Su(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Bt(t[n],e[n])):t===e}function ul(t,e){return t.some(n=>Bt(n,e))}const h0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
+
</div>`}postConstruct(){this.setTemplate(this.createTemplate(),[b.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const t=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const e=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnPivotModeChanged:e})}onBtPivotMode(){const t=!!this.cbPivotMode.getValue();t!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:t},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)}},sv=class extends b.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}init(t){const e=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...e,...t},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Hd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new ov),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new Ka(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new zd(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new qa(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[n]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>n())}this.initialised=!0}setPivotModeSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new Hd),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new Ka(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new zd(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new qa(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(s=>s.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=b._last(n);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const i=e[n];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(b.ModuleNames.RowGroupingModule,"Row Grouping")}expandColumnGroups(t){this.primaryColsPanel.expandGroups(t)}collapseColumnGroups(t){this.primaryColsPanel.collapseGroups(t)}setColumnLayout(t){this.primaryColsPanel.setColumnLayout(t)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(t=>t()),this.childDestroyFuncs.length=0,b._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},av=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const i=this.extractAllLeafColumns(t);this.setAllColumns(i,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=i=>{i.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const i=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&i.push({colId:s.getId(),hide:!e})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const i=[],c=e?u=>{var p;if(!u.isAnyFunctionActive())if(u.isAllowValue()){const f=typeof u.getAggFunc()=="string"?u.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(u);i.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?i.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&i.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&i.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:i,eventType:s}=t,l=e.map(c=>{const u=c.getColId();if(this.columnModel.isPivotMode()){const p=i==null?void 0:i[u];return{colId:u,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:u,hide:!(n!=null&&n[u])}});this.columnApplyStateService.applyColumnState({state:l},s)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},lv="32.3.3",jd=b._defineModule({version:lv,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[av],userComponents:[{name:"agColumnsToolPanel",classImp:sv},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,Yy,Ha]});function qd(){b.ModuleRegistry.registerModules([Jo.ClientSideRowModelModule,Kf.InfiniteRowModelModule,sd.ServerSideRowModelModule,Yf.CsvExportModule,ad.ClipboardModule,ld.RangeSelectionModule,Jf.RichSelectModule,Xf.MenuModule,Qf.ExcelExportModule,Ha,jd]);const t=Cg("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const Kd=em.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#110529",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}),Yd=Symbol("sdk-vue");function Xa(){return r.inject(Yd)}function cv(t,e){let n;qd();const i=()=>{t.loadBlockState().then(l=>{s.loaded=!0;const c=pm(l,t),u=e(c),p=Object.fromEntries(Object.entries(u.routes).map(([f,m])=>{const y=typeof m=="function"?m():m;return[f,r.markRaw(y)]}));n=Object.assign(c,{...u,getRoute(f){return p[f]}})}).catch(l=>{console.error("load initial state error",l),s.error=l})},s=r.reactive({loaded:!1,error:void 0,useApp(){return nm(n,"App is not loaded")},install(l){l.provide(Yd,this),i()}});return s}var dv=Object.defineProperty,uv=(t,e,n)=>e in t?dv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pv=(t,e,n)=>uv(t,e+"",n);function Jd(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function hv(t,e,n){const i=Math.min(e,n),s=Math.max(e,n);return t>=i&&t<=s}function fv(t){return new Promise(e=>setTimeout(e,t))}function mv(t){return t()}function cs(t,e,n){return e>t?e:t>n?n:t}function Xd(t,e){return e(t)}function Fr(t,e){if(t!=null)return e(t)}function gv(t){if(t&&t.ok)return t.value}async function yv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Qd=t=>t;function vv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function _v(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(vv(65,91));return e}function Cv(){return _v(42)}function Qi(t){return t!==null&&typeof t=="object"}function wv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function Qa(t,e){return Qi(t)&&Qi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Qa(t[n],e[n])):t===e}function eo(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=eo(t[n]);return e}else if(Qi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=eo(t[n])}),e}else return t}function bv(t){return Array.isArray(t)?Object.assign([],t):Qi(t)?Object.assign({},t):t}function xv(t,e){const n={};for(const i in e)e[i]!==t[i]&&(n[i]=t[i]);return n}function kv(t,e,n){return Object.assign({},t,{[e]:n})}function Sv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function Ev(t,e,n){return t[e]=n,t}function Tv(t,e){return t[e]}function Bv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function Vv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function Av(t,...e){return e.map(n=>t[n])}function Nv(t,...e){const n=Object.assign({},t);return e.forEach(i=>delete n[i]),n}const el=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:Sv,deepClone:eo,deepEqual:Qa,getProp:Tv,iSet:kv,isObject:Qi,map:wv,omit:Nv,pick:Vv,pickValues:Av,setProp:Ev,shallowClone:bv,shallowDiff:xv,shiftProp:Bv},Symbol.toStringTag,{value:"Module"}));function Pv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}function eu(t,e,n){let i;return function(...s){i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}const Dv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Fv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Rv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Mv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],tu=(t,e)=>{let n=String(t);return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e):e===!0&&(n=t.toLocaleString(void 0)),n};function tl(t,e){if(t=typeof t=="bigint"?Number(t):t,!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);Object.assign(e,{bits:!1,binary:!1});const n=e.bits?e.binary?Mv:Rv:e.binary?Fv:Dv;if(e.signed&&t===0)return` 0 ${n[0]}`;const i=t<0,s=i?"-":e.signed?"+":"";if(i&&(t=-t),t<1){const p=tu(t,e.locale);return s+p+" "+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),n.length-1);t/=(e.binary?1024:1e3)**l,t=Number(t.toPrecision(3));const c=tu(Number(t),e.locale),u=n[l];return s+c+" "+u}const Iv={class:"context-menu"},Lv=["onClick"],Ov=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,i=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Iv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>i(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,Lv))),128))]))}}),or=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Gv=or(Ov,[["__scopeId","data-v-12530966"]]);function nl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},i=r.h(Gv,{options:e,onClose:()=>{n()}});r.render(i,document.body);const s=i.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const nu=Symbol(),ds=()=>r.inject(nu),zv=["value"],Zv={key:1},Uv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({edit:!1}),l=r.computed(()=>i.valueType),c=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const S=r.unref(l),E=mv(()=>S==="integer"?parseInt(y,10):S==="float"?Number(y):y);n("update:modelValue",E),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&i.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=u.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:u,class:r.normalizeClass(["base-cell",{"base-cell__edit":s.edit}]),onClick:p},[s.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:f.modelValue,onFocusout:m[0]||(m[0]=y=>s.edit=!1),onChange:c},null,40,zv)):(r.openBlock(),r.createElementBlock("div",Zv,r.toDisplayString(f.modelValue),1))],2))}}),$v=["^data-row-index"],Wv={key:0,class:"control-cell"},Hv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ds(),i=r.computed(()=>e.cell.column.valueType),s=f=>{Fr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,S={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:S})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const y=n.settings??{},S=[],{onSelectedRows:E,onSelectedColumns:M}=y.value,V=n.data.selectedRows.has(m.primaryKey);E&&E.length&&(V?S.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):S.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),M&&M.length&&(S.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),S.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),S.length&&nl(f,S)},u=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:u,class:r.normalizeClass(["td-cell",{[f.cell.class]:!0}]),"^data-row-index":f.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",Wv,r.toDisplayString(f.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":f.cell.value,"onUpdate:modelValue":s},null,8,["model-value"])):(r.openBlock(),r.createBlock(Uv,{key:2,"model-value":f.cell.value,"value-type":i.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,$v))}}),jv={},qv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Kv(t,e){return r.openBlock(),r.createElementBlock("svg",qv,e[0]||(e[0]=[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),r.createTextVNode(),r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const Yv=or(jv,[["render",Kv]]),Jv={class:"tr-head"},Xv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Jv,[r.renderSlot(e.$slots,"default")]))}});function Qv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function e_(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}const t_=["^data-col-id"],n_=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function i(l){l.preventDefault();const c=[];c.length&&nl(l,c)}function s(l){var c;const u=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:Qv(u,["DESC","ASC"])})}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cell th-cell",{"justify-center":l.col.justify,frozen:l.col.frozen}]),"^data-col-id":l.col.id,onContextmenu:i},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:c[0]||(c[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,t_))}}),r_=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Fr(e.value,i=>i.scrollLeft=0)})};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:i.row.selected}]),scroll:"no",style:r.normalizeStyle(i.row.style),onScroll:n},[r.renderSlot(i.$slots,"default")],38))}}),i_=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ds(),n=t,i=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:i.value,frozen:s.column.frozen}])},null,2))}});function tt(t,e,n,i){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,i)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,i)})}function o_(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function s_(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function a_(t,e){let n;function i(l){n={...l}}o_(()=>{n=void 0,e()});const s=s_(t);return tt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:i}}const si=1,l_=10,c_=30,ru=60;function iu(){const t=r.reactive({x:0,y:0});function e(n){t.x=n.pageX,t.y=n.pageY}return r.onMounted(()=>window.addEventListener("mousemove",e)),r.onUnmounted(()=>window.removeEventListener("mousemove",e)),t}function ou(t,e={}){const{delayEnter:n=0,delayLeave:i=0}=e,s=r.ref(!1);let l;const c=u=>{const p=u?n:i;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(tt(t,"mouseenter",()=>c(!0)),tt(t,"mouseleave",()=>c(!1))),s}function d_(t){var e;const n=Fr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),i=>[...i])??[];return n.map(i=>{const{width:s,x:l}=i.getBoundingClientRect(),c=i.getAttribute("data-col-id");return Qd({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function u_(t,e){const n=iu(),i=ou(e,{}),{data:s}=t,l=a_(u=>{Fr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=cs(u.width+u.diff,c_,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),c=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!i.value){document.body.style.cursor="";return}if(s.resize)return;const u=d_(e).find(p=>Math.abs(n.x-p.right)<l_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const p_={key:0,class:"command-menu"},h_={key:0},f_=["onClick"],m_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ds(),n=r.computed(()=>e.getSelectedRows()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",p_,[n.value.length?(r.openBlock(),r.createElementBlock("span",h_,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,f_))),128))])):r.createCommentVNode("",!0)}}),g_={key:0,class:"command-menu"},y_={key:0},v_=["onClick"],__=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ds(),n=r.computed(()=>e.getSelectedColumns()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",g_,[n.value.length?(r.openBlock(),r.createElementBlock("span",y_,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,v_))),128))])):r.createCommentVNode("",!0)}});function sr(t,e){const n={el:void 0,x:0,y:0},i=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});tt(document,"mousedown",s=>{s.target===r.unref(t)&&(s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault(),n.el=r.unref(t),n.x=s.x,n.y=s.y)}),tt(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...i(s),stop:!0},n))}),tt(document,"mousemove",s=>{n.el&&e(i(s),n)})}const C_=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.windowSize-12),c=r.computed(()=>i.windowSize<i.dataSize),u=r.computed(()=>Math.ceil(i.offset*(l.value/i.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/i.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return sr(s,(m,y)=>{const S=(u.value+m.dy)*i.dataSize/l.value;n("change:offset",S),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"handleRef",ref:s,class:"t-scroll__handle",style:r.normalizeStyle(f.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function w_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:i,scrollLeft:s}=e,l=[...e.columns],c=Cv();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const y={...m,offset:u};return u+=m.width+si,y}),f=p.filter(m=>m.frozen);return Pv(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<i+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function b_(t,e){const n=r.computed(()=>e.value.reduce((i,s)=>(i[s.id]=s.justify?"justify-"+s.justify:"",i),{}));return r.computed(()=>t.rows.map(i=>{const s=n.value,{primaryKey:l,offset:c,dataRow:u,height:p}=i,f=e.value.map(m=>({id:m.id,column:m,row:i,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Qd({style:{top:`${c-t.scrollTop}px`,height:`${i.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const x_=async(t,e)=>{const{scrollTop:n,bodyHeight:i}=t;return await fv(0),yv({rows:e.getRows(n,i),dataWindow:t})};function k_(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=eo(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,f.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),i=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+si,0)),s=r.computed(()=>Xd(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>Xd(i.value-f.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=w_({data:e,settings:n}),p=b_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((S,E)=>S+E.width+si,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const S=e.columns[e.columns.length-1];S.width=S.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=cs(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=cs(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,S=m>y?y:m;e.bodyHeight=S},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const S=m.current;(!S||m.scrollTop<S.scrollTop||m.scrollTop+m.bodyHeight>S.bodyHeight+S.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-ru,bodyHeight:m.bodyHeight+ru*2},x_(eo(e.currentWindow),n.value.dataSource).then(({rows:E,dataWindow:M})=>{Qa(e.currentWindow,M)&&(e.rows=E)}))},{deep:!0,immediate:!0}),r.provide(nu,f),f}const S_={class:"command-menu__container"},E_={key:0,class:"table-body__no-data"},T_={class:"carets"},rl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,i=t,s=k_(i),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,V=>n("update:data",V),{deep:!0}),r.watch(i,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Fr(f.value,V=>{s.updateDimensions(V.getBoundingClientRect())})},y=s.tableColumns,S=s.tableRows,{mouseDown:E}=u_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(i.settings),r.nextTick(m)}),tt(window,"resize",()=>r.nextTick(m));const M=V=>{V.preventDefault(),s.updateOffsets(V)};return(V,F)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:F[2]||(F[2]=(...C)=>r.unref(E)&&r.unref(E)(...C))},[r.createElementVNode("div",S_,[r.createVNode(m_),F[3]||(F[3]=r.createTextVNode()),r.createVNode(__)]),F[7]||(F[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Xv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,G)=>(r.openBlock(),r.createBlock(n_,{key:G,col:C,style:r.normalizeStyle(C.style),"onChange:sort":F[0]||(F[0]=Q=>V.$emit("change:sort",Q))},null,8,["col","style"]))),128))]),_:1})],512),F[8]||(F[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:M},[l.value?(r.openBlock(),r.createElementBlock("div",E_,[r.createElementVNode("div",null,[r.createVNode(Yv),F[4]||(F[4]=r.createTextVNode()),F[5]||(F[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),F[6]||(F[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(S),(C,G)=>(r.openBlock(),r.createBlock(r_,{key:G,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,Q=>(r.openBlock(),r.createBlock(Hv,{key:Q.column.id+":"+G,cell:Q,style:r.normalizeStyle(Q.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),F[9]||(F[9]=r.createTextVNode()),r.createElementVNode("div",T_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,G)=>(r.openBlock(),r.createBlock(i_,{key:G,column:C,style:r.normalizeStyle(C.style),"onChange:sort":F[1]||(F[1]=Q=>V.$emit("change:sort",Q))},null,8,["column","style"]))),128))]),F[10]||(F[10]=r.createTextVNode()),r.createVNode(C_,{offset:r.unref(s).data.scrollTop,"window-size":r.unref(s).data.bodyHeight,"data-size":r.unref(s).data.dataHeight,"onChange:offset":r.unref(s).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),su=new WeakMap;class B_{constructor(e,n,i){pv(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=i;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+si,c),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((c,u)=>({dataRow:c,index:u,primaryKey:this.resolvePrimaryKey(c,u),offset:Jd(s.indices.get(u)),height:this.resolveHeight(c,u)}));su.set(this,l)}get rows(){return su.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return e_(this.rows,i=>{const s=i.offset;return e<s+i.height&&s<n+e})}}class V_{constructor(e,n,i){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=i}get height(){return this.rowHeight+si}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const i=cs(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:i,limit:s})).map((l,c)=>({dataRow:l,index:i+c,primaryKey:this.resolvePrimaryKey(l,i+c),offset:(i+c)*(this.rowHeight+si),height:this.rowHeight}))}}function A_(t){return Object.freeze(t)}function N_(t){return r.h(rl,{settings:Object.freeze(t)})}function il(t,e){const n=new B_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function P_(t,e){return r.computed(()=>{const n=r.unref(t);return il(n,r.unref(e))})}function D_(t,e){const n=r.computed(()=>{const s=r.unref(t);return il(s,r.unref(e))}),i=r.reactive({settings:n});return r.computed(()=>r.h(rl,i))}const F_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:V_,Component:rl,factory:N_,rawDataSettings:il,settings:A_,useRawData:P_,useRawDataComponent:D_},Symbol.toStringTag,{value:"Module"}));function*R_(t,e){for(const n of t)yield e(n)}function M_(t){const e=[];for(const n of t)e.push(n);return e}function au(t){return t()}function ol(t,e){if(t==null)throw Error(e);return t}function sl(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function lu(t){return new Promise(e=>setTimeout(e,t))}function cu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function du(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function I_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(du(65,91));return e}function uu(t){return function(e){return 1-t(1-e)}}function L_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function pu(t){const{duration:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function O_(t){const{getFraction:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function hu(t,e){let n=-1;return(...i)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...i),e)}}function fu(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function G_(t){return t.map(e=>({text:String(e),value:e}))}function Rr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const al=new Map;function z_(t){return al.has(t)||al.set(t,r.ref(localStorage.getItem(t))),ol(al.get(t),"...")}function Z_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function mu(t){const e=z_(t);return r.watch(e,n=>Z_(t,n)),e}const ll=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{M_(R_(ll.values(),e=>e(t.matches?"dark":"light")))});const U_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",gu=r.ref(U_),cl=mu("theme");function yu(t){const e=r.computed(()=>cl.value?cl.value:gu.value),n=s=>{gu.value=s,t&&t(s)};function i(){cl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{ll.add(n)}),r.onUnmounted(()=>{ll.delete(n)}),[e,i]}const $_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=yu();return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),W_={class:"pl-layout-component pl-block-page"},H_={key:0,class:"pl-block-page__title"},j_={class:"pl-block-page__title__append"},q_={key:1},K_={class:"pl-block-page__body"},Y_={name:"PlBlockPage"},J_=r.defineComponent({...Y_,setup(t){const e=r.useSlots();return(n,i)=>(r.openBlock(),r.createElementBlock("div",W_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",H_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",j_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",q_)),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",K_,[r.renderSlot(n.$slots,"default")])]))}}),X_={name:"PlContainer"},Q_=r.defineComponent({...X_,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),eC={name:"PlRow"},tC=r.defineComponent({...eC,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),nC={class:"pl-layout-component",style:{"flex-grow":"1"}},rC={name:"PlSpacer"},vu=r.defineComponent({...rC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",nC))}}),iC={name:"PlGrid"},oC=r.defineComponent({...iC,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),sC={key:0,class:"pl-alert__icon"},aC={class:"pl-alert__main"},lC={key:0},cC={class:"pl-alert__main__text"},dC={name:"PlAlert"},uC=r.defineComponent({...dC,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,i)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",sC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),i[2]||(i[2]=r.createTextVNode()),r.createElementVNode("div",aC,[n.label?(r.openBlock(),r.createElementBlock("label",lC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",cC,[r.renderSlot(n.$slots,"default")])]),i[3]||(i[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:i[0]||(i[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),to=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),i=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass(i.value)},null,6))}});function _u(t){function e(n){const i=n.currentTarget,s=document.createElement("span"),l=Math.max(i.clientWidth,i.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-i.offsetLeft-c}px`,s.style.top=`${n.clientY-i.offsetTop-c}px`,s.classList.add("ripple");const u=i.getElementsByClassName("ripple")[0];u&&u.remove(),i.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const pC={key:0},hC={inheritAttrs:!1},us=r.defineComponent({...hC,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),i=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return _u(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:i.value,large:s.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",pC,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(to),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(to),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),fC={name:"PlBtnPrimary"},dl=r.defineComponent({...fC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(us,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),mC={name:"PlBtnAccent"},gC=r.defineComponent({...mC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(us,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),yC={name:"PlBtnDanger"},vC=r.defineComponent({...yC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(us,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),_C={name:"PlBtnSecondary"},ul=r.defineComponent({..._C,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(us,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),CC={key:0},wC={name:"PlBtnGhost"},pl=r.defineComponent({...wC,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),i=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return _u(s),(c,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["pl-btn-ghost",{loading:c.loading,small:n.value,large:i.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}]},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[r.unref(l).default&&!c.round?(r.openBlock(),r.createElementBlock("span",CC,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(to),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(to),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),bC=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:i.disabled,loading:i.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(ul,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(i.$slots,"default")],34))}});function no(t,e){const n=sl(()=>{if(t.value){const{scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p,offsetY:i+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),tt(window,"scroll",n,{capture:!0,passive:!0}),tt(window,"resize",n,{passive:!0}),tt(window,"adjust",n,!0)}function xC(t,e){const n=r.ref();return no(t,i=>{n.value=i}),r.computed(()=>{const i=r.unref(n),s=r.unref(e),l=s.position??"top",c=s.gap??8;if(!i)return"";const u=i.offsetY+Math.floor(i.height/2),p=i.offsetX+Math.floor(i.width/2);return l==="top-left"?`left: ${i.offsetX}px; top: ${i.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${i.offsetY-c}px;`:l==="right"?`left: ${i.offsetX+i.width+c}px; top: ${u}px;`:l==="left"?`right: ${i.scrollWidth-i.x+c}px; top: ${u}px;`:""})}function ro(t,e){return e(t)}function ot(t,e){if(t!=null)return e(t)}function kC(t){return Array.isArray(t)?t:[t]}function SC(t,e,...n){n.forEach(i=>{t[i]=e[i]})}function ps(t,e){tt(document,"click",n=>{document.contains(n.target)&&(kC(t).map(i=>i.value).filter(i=>!!i).some(i=>i==null?void 0:i.contains(n.target))||e())})}const EC={},TC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function BC(t,e){return r.openBlock(),r.createElementBlock("svg",TC,e[0]||(e[0]=[r.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const VC=or(EC,[["render",BC]]),hl=new Map,AC={name:"PlTooltip"},Nt=r.defineComponent({...AC,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,i=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});hl.set(i,()=>f()),r.watch(()=>l.open,V=>{requestAnimationFrame(()=>{l.tooltipOpen=V})});let c=()=>{};const u=fu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[V,F]of hl.entries())V!==i&&F()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await lu(100),l.over&&p())},y=()=>{l.over=!1,c=cu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,V=>{V&&f()});const S=r.ref(),E=r.ref(),M=xC(S,r.toRef(s));return ps([S,E],()=>f()),r.onUnmounted(()=>{hl.delete(i)}),(V,F)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(V.element),r.mergeProps(V.$attrs,{ref_key:"rootRef",ref:S,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(V.$slots,"default"),F[1]||(F[1]=r.createTextVNode()),V.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(M))},[r.createElementVNode("div",{ref_key:"tooltip",ref:E,class:r.normalizeClass(["pl-tooltip",V.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(V.$slots,"tooltip")]),F[0]||(F[0]=r.createTextVNode()),r.createVNode(VC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),NC={},PC={class:"inner-border"};function DC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",PC,[r.renderSlot(t.$slots,"default")])}const FC=or(NC,[["render",DC]]),RC={key:0},MC=["tabindex","onKeydown","onClick"],IC={key:1,class:"ui-btn-group__helper"},LC={key:2,class:"ui-btn-group__error"},OC={name:"PlBtnGroup"},GC=r.defineComponent({...OC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=u=>i("update:modelValue",u),l=t,c=r.computed(()=>l.options.map(u=>({label:"label"in u?u.label:u.text,value:u.value})));return(u,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",RC,[r.createElementVNode("span",null,r.toDisplayString(u.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(u.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(FC,{class:"ui-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["ui-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(y=>s(f.value),["enter"]),onClick:y=>s(f.value)},r.toDisplayString(f.label),43,MC))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",IC,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",LC,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),zC={inheritAttrs:!1},ZC={class:"double-contour"};function UC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",ZC,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const ar=or(zC,[["render",UC]]);function Cu(t){r.onMounted(t),r.onUpdated(t)}const fl=new WeakMap,ml=new ResizeObserver(t=>{for(const e of t)ot(fl.get(e.target),n=>n(e))});function wu(t,e){fl.set(t,e),ml.unobserve(t),ml.observe(t)}function bu(t){ml.unobserve(t),fl.delete(t)}const $C=8,xu=4;function In(t,e="label"){const n=new Set;Cu(()=>{ot(t==null?void 0:t.value,i=>{const s=i.querySelector(e);s&&(n.add(s),wu(s,()=>{const l=au(()=>s.getBoundingClientRect().width+ro($C,c=>Number.isNaN(c)?xu:c+xu));i.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&i.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(i=>bu(i))})}function WC(t,e){const n=[];return e&&e.length>0&&e.forEach(i=>{const s=i(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function ku(t,e){return r.computed(()=>WC(t.value,e))}const HC=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),i=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),jC="_icon_1ugxm_2",qC={icon:jC},KC={$style:qC},hs=or(HC,[["__cssModules",KC]]),YC=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),JC="_icon_1ugxm_2",XC={icon:JC},QC={$style:XC},Su=or(YC,[["__cssModules",QC]]),ew={class:"pl-text-field__envelope"},tw={key:0,ref:"label"},nw={key:0,class:"required-icon"},rw={key:1,class:"pl-text-field__prefix"},iw=["disabled","placeholder","type"],ow={class:"pl-text-field__append"},sw={key:0,class:"pl-text-field__error"},aw={key:1,class:"pl-text-field__helper"},lw={name:"PlTextField"},fs=r.defineComponent({...lw,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),i=t,s=r.ref(void 0),l=r.ref(),c=r.ref(!1),u=r.reactive({cached:void 0}),p=r.computed({get(){return u.cached?u.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(I){if(u.cached=void 0,i.parse)try{n.value=i.parse(I)}catch(L){u.cached={error:L instanceof Error?L.message:String(L),value:I}}else n.value=I}}),f=r.computed(()=>i.type&&i.type==="password"?c.value?"text":i.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),y=()=>{i.clearable&&(u.cached=void 0,n.value=i.clearable===!0?"":i.clearable())},S=ku(p,i.rules||[]),E=r.computed(()=>i.clearable?i.clearable===!0?n.value==="":n.value===i.clearable():n.value===""),M=r.computed(()=>!E.value),V=r.computed(()=>{const I=[];return i.error&&I.push(i.error),u.cached&&I.push(u.cached.error),S.value.isValid||I.push(...S.value.errors),I}),F=r.computed(()=>V.value.length>0),C=r.computed(()=>i.clearable&&M.value&&i.type!=="password"),G=()=>c.value=!c.value,Q=()=>{u.cached=void 0};return In(s),(I,L)=>(r.openBlock(),r.createElementBlock("div",ew,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:F.value,disabled:I.disabled,dashed:I.dashed,nonEmpty:M.value}])},[I.label?(r.openBlock(),r.createElementBlock("label",tw,[I.required?(r.openBlock(),r.createElementBlock("i",nw)):r.createCommentVNode("",!0),L[1]||(L[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(I.label),1),L[2]||(L[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(I.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),L[5]||(L[5]=r.createTextVNode()),I.prefix?(r.openBlock(),r.createElementBlock("div",rw,r.toDisplayString(I.prefix),1)):r.createCommentVNode("",!0),L[6]||(L[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":L[0]||(L[0]=U=>p.value=U),disabled:I.disabled,placeholder:I.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:Q},null,40,iw),[[r.vModelDynamic,p.value]]),L[7]||(L[7]=r.createTextVNode()),r.createElementVNode("div",ow,[C.value?(r.openBlock(),r.createBlock(r.unref(hs),{key:0,name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),L[3]||(L[3]=r.createTextVNode()),I.type==="password"?(r.openBlock(),r.createBlock(r.unref(Su),{key:1,name:m.value,style:{cursor:"pointer"},onClick:G},null,8,["name"])):r.createCommentVNode("",!0),L[4]||(L[4]=r.createTextVNode()),r.renderSlot(I.$slots,"append")]),L[8]||(L[8]=r.createTextVNode()),r.createVNode(ar,{class:"pl-text-field__contour"})],2),L[9]||(L[9]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",sw,r.toDisplayString(V.value.join(" ")),1)):I.helper?(r.openBlock(),r.createElementBlock("div",aw,r.toDisplayString(I.helper),1)):r.createCommentVNode("",!0)]))}}),cw={class:"ui-text-area__envelope"},dw={key:0,ref:"label"},uw={key:0,class:"required-icon"},pw=["readonly","rows","disabled","placeholder"],hw={class:"ui-text-area__append"},fw={key:0,class:"ui-text-area__error"},mw={key:1,class:"ui-text-area__helper"},gw={name:"PlTextArea"},yw=r.defineComponent({...gw,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(E){i("update:modelValue",E)}}),p=r.computed(()=>!!s.modelValue),f=ku(u,s.rules||[]);In(l);const m=r.computed(()=>{const E=[];return s.error&&E.push(s.error),E.push(...f.value.errors),E}),y=r.computed(()=>m.value.length>0),S=()=>{if(!s.autogrow)return;const E=c.value;E&&(E.style.height="auto",E.style.height=`${E.scrollHeight}px`)};return r.onMounted(()=>{S()}),(E,M)=>(r.openBlock(),r.createElementBlock("div",cw,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:E.disabled,dashed:E.dashed,nonEmpty:p.value}])},[E.label?(r.openBlock(),r.createElementBlock("label",dw,[E.required?(r.openBlock(),r.createElementBlock("i",uw)):r.createCommentVNode("",!0),M[1]||(M[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(E.label),1),M[2]||(M[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(E.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),M[3]||(M[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":M[0]||(M[0]=V=>u.value=V),readonly:E.readonly,rows:E.rows,disabled:E.disabled,placeholder:E.placeholder??"...",spellcheck:"false",onInput:S},null,40,pw),[[r.vModelText,u.value]]),M[4]||(M[4]=r.createTextVNode()),r.createElementVNode("div",hw,[r.renderSlot(E.$slots,"append")]),M[5]||(M[5]=r.createTextVNode()),r.createVNode(ar,{class:"ui-text-area__contour"})],2),M[6]||(M[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",fw,r.toDisplayString(m.value.join(" ")),1)):E.helper?(r.openBlock(),r.createElementBlock("div",mw,r.toDisplayString(E.helper),1)):r.createCommentVNode("",!0)]))}});function Eu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n&&s>n}function Tu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n?"ceil":s>n?"floor":"visible"}function io(t,e,n={}){const i=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,u=Tu(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=i+f*(m-i)};Eu(t,e)||pu({duration:n.duration||100,timing:uu(f=>f),draw:p})}function gl(t,e,n,i){return t.addEventListener(e,n,i),function(){t.removeEventListener(e,n)}}function vw(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}function Bu(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Bu(t)&&Bu(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function yl(t,e){return t.some(n=>Pt(n,e))}const _w=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
44
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 4.5H4.5L4.5 19.5H19.5V4.5ZM4.5 3C3.67157 3 3 3.67157 3 4.5V19.5C3 20.3284 3.67157 21 4.5 21H19.5C20.3284 21 21 20.3284 21 19.5V4.5C21 3.67157 20.3284 3 19.5 3H4.5Z" fill="#110529"/>
|
|
45
45
|
</svg>
|
|
46
|
-
`,
|
|
46
|
+
`,Cw=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
47
47
|
<rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
|
|
48
48
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
|
|
49
49
|
</svg>
|
|
50
|
-
`,m0=["innerHTML"],g0={class:"dropdown-list-item__title-container"},y0={class:"dropdown-list-item__title text-s"},v0={key:0,class:"dropdown-list-item__description text-description"},_0={key:1,class:"dropdown-list-item__icon flex-self-start"},no=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),i=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?f0:h0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([n.value,"dropdown-list-item"])},[e.useCheckbox?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(i.value),innerHTML:s.value},null,10,m0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",g0,[r.createElementVNode("div",y0,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",v0,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",_0)):r.createCommentVNode("",!0)],2))}}),pl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),i=r.ref(!1),s=r.computed(()=>i.value&&e.value?"ui-lt-animate":""),l=cu(m=>i.value=m,500),c=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function u(){const m=Qa(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,v)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:f},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(s.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}}),Mn=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass(n.value)},null,2))}}),C0={class:"pl-dropdown__envelope"},w0=["tabindex"],b0={class:"pl-dropdown__container"},x0={class:"pl-dropdown__field"},k0=["disabled","placeholder"],S0={class:"pl-dropdown__controls"},E0={key:0},T0={key:0,class:"required-icon"},B0={key:0,class:"nothing-found"},A0={key:0,class:"pl-dropdown__error"},P0={key:1,class:"pl-dropdown__helper"},V0={key:2,class:"pl-dropdown__helper"},N0={name:"PlDropdown"},hl=r.defineComponent({...N0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>eo(Q.value.findIndex(A=>Bt(A.value,i.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=f(),v=r.computed(()=>i.options===void 0),k=r.computed(()=>v.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(A=>Bt(A.value,i.modelValue))),F=r.computed(()=>{if(!v.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>Pr(i.options??[]).map((A,G)=>({...A,index:G,isSelected:G===S.value,isActive:G===p.activeIndex}))),N=r.computed(()=>{const A=r.unref(T).find(G=>Bt(G.value,i.modelValue));return(A==null?void 0:A.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(N.value):i.placeholder),I=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),Q=r.computed(()=>{const A=T.value;return p.search?A.filter(G=>{const Y=p.search.toLowerCase();return G.label.toLowerCase().includes(Y)||G.description&&G.description.toLowerCase().includes(Y)?!0:typeof G.value=="string"?G.value.toLowerCase().includes(Y):G.value===p.search}):A}),M=r.computed(()=>k.value?void 0:"0"),R=A=>{var G;n("update:modelValue",A),p.search="",p.open=!1,(G=l==null?void 0:l.value)==null||G.focus()},U=()=>n("update:modelValue",void 0),z=()=>{var A;return(A=u.value)==null?void 0:A.focus()},P=()=>p.open=!p.open,Z=()=>p.open=!0,O=A=>{var G,Y;const ve=A.relatedTarget;!((G=l.value)!=null&&G.contains(ve))&&!((Y=c.value)!=null&&Y.contains(ve))&&(p.search="",p.open=!1)},K=()=>{const A=c.value;A&&it(A.querySelector(".hovered-item"),G=>{to(A,G)})},ue=A=>{var G,Y;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;const{open:ve,activeIndex:xe}=p;if(!ve){A.code==="Enter"&&(p.open=!0);return}A.code==="Escape"&&(p.open=!1,(G=l.value)==null||G.focus());const Gt=r.unref(Q),{length:jt}=Gt;if(!jt)return;A.code==="Enter"&&R((Y=Gt.find(So=>So.index===xe))==null?void 0:Y.value);const At=Gt.findIndex(So=>So.index===xe)??-1,ko=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Lr=Math.abs(At+ko+jt)%jt;p.activeIndex=Q.value[Lr].index??-1};Rn(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,A=>{var G;return A?(G=u.value)==null?void 0:G.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&K()});const W=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,A=>{if(A){const G=A.getBoundingClientRect();p.optionsHeight=G.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(l,A=>{const G=A.top+A.height+3;G+p.optionsHeight>A.clientHeight?W.top=A.top-p.optionsHeight-3+"px":W.top=G+"px",W.left=A.left+"px",W.width=A.width+"px"}),(A,G)=>(r.openBlock(),r.createElementBlock("div",C0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:M.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:A.error,disabled:k.value}]),onKeydown:ue,onFocusout:O},[r.createElementVNode("div",b0,[r.createElementVNode("div",x0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":G[0]||(G[0]=Y=>p.search=Y),type:"text",tabindex:"-1",disabled:k.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,k0),[[r.vModelText,p.search]]),G[4]||(G[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(pl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(N.value),1)]),_:1})])),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",S0,[v.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:0,name:"loading"})):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),A.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(us),{key:1,name:"delete-clear",onClick:r.withModifiers(U,["stop"])})):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.renderSlot(A.$slots,"append"),G[3]||(G[3]=r.createTextVNode()),A.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${A.arrowIconLarge}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):A.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${A.arrowIcon}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(P,["stop"])}))])]),G[9]||(G[9]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",E0,[A.required?(r.openBlock(),r.createElementBlock("i",T0)):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),G[7]||(G[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),G[10]||(G[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:c,class:"pl-dropdown__options",style:r.normalizeStyle(W),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Q.value,(Y,ve)=>(r.openBlock(),r.createBlock(no,{key:ve,option:Y,"is-selected":Y.isSelected,"is-hovered":Y.isActive,size:A.optionSize,onClick:r.withModifiers(xe=>R(Y.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),G[8]||(G[8]=r.createTextVNode()),Q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",B0,"Nothing found"))],4)])):r.createCommentVNode("",!0),G[11]||(G[11]=r.createTextVNode()),r.createVNode(ir,{class:"pl-dropdown__contour"})])],42,w0),G[12]||(G[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",A0,r.toDisplayString(F.value),1)):v.value&&A.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",P0,r.toDisplayString(A.loadingOptionsHelper),1)):A.helper?(r.openBlock(),r.createElementBlock("div",V0,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),D0={name:"PlDropdownRef"},F0=r.defineComponent({...D0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),i=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(hl),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function R0(t,e){return r.computed(()=>{const n=Pr(t.value);return e.value?n.filter(i=>i.label.toLowerCase().includes(e.value.toLowerCase())):n})}const M0={class:"resizable-input"},I0=["placeholder","value","disabled"],L0=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function c(u){const p=u.target.value;i("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",M0,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(s.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(u.$attrs,{placeholder:u.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,I0)]))}}),O0={class:"dropdown-tab-item__title text-caps13"},G0=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),i=r.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.value,"dropdown-tab-item"])},[r.createElementVNode("div",O0,r.toDisplayString(n.value),1)],2))}}),z0={class:"pl-line-dropdown__prefix"},Z0={class:"pl-line-dropdown__icon-wrapper"},$0={class:"pl-line-dropdown__icon"},U0={key:0,class:"pl-line-dropdown__no-item"},W0={key:0,class:"pl-line-dropdown__no-item"},Eu=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),u=r.computed(()=>{const O=[];return s.isOpen&&O.push("open"),i.disabled&&O.push("disabled"),O.join(" ")}),p=r.ref(""),f=R0(r.toRef(i,"options"),p),m=r.computed(()=>!!(i.clearable&&s.isOpen&&i.modelValue&&v.value)),v=r.computed(()=>{if(i.modelValue){const O=F();if(O!==-1){const K=Pr(i.options)[O];return typeof K.label=="object"?K.label.title:K.label}}return""}),k=r.ref(v.value),S=r.computed(()=>s.isOpen&&p.value&&p.value.length>=v.value.length-1?p.value:v.value??"...");ds(l,()=>{i.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>k.value,O=>{v.value!==O?p.value=O:p.value=""}),r.watch(()=>s.isOpen,O=>{var K;O&&l.value&&((K=l.value.querySelector("input"))==null||K.focus(),r.nextTick(()=>z()))}),r.watch(()=>i.modelValue,()=>T(),{immediate:!0});function F(){return i.options.findIndex(O=>Bt(O.value,i.modelValue))}function T(){s.activeOption=eo(f.value.findIndex(O=>Bt(O.value,i.modelValue)),O=>O<0?0:O),k.value=v.value}function N(){p.value=""}function C(){i.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function I(){i.mode==="list"&&(s.isOpen=!1)}function Q(O){O&&(n("update:modelValue",O.value),I(),N())}function M(O){return Bt(O.value,i.modelValue)}const R=O=>{var K,ue;const W=O.relatedTarget;!((K=l.value)!=null&&K.contains(W))&&!((ue=c.value)!=null&&ue.contains(W))&&(p.value="",s.isOpen=!1)};function U(O){const{activeOption:K}=s;if(!s.isOpen&&O.code==="Enter"){s.isOpen=!0;return}const{length:ue}=f.value;if(!ue)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&Q(f.value[K]);const W=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(K+W+ue)%ue,requestAnimationFrame(z)}function z(){const O=c.value;O&&it(O.querySelector(".hovered-item"),K=>{i.mode==="list"?to(O,K):K.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function P(){n("update:modelValue",void 0)}const Z=r.reactive({top:"0px",left:"0px"});return r.watch(c,O=>{if(O){const K=O.getBoundingClientRect();s.optionsHeight=K.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(l,O=>{const K=O.top+O.height+2;K+s.optionsHeight>O.clientHeight?Z.top=O.top-s.optionsHeight-2+"px":Z.top=K+"px",Z.left=O.left+"px"}),(O,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:U,onFocusout:R,onClick:C},[r.createElementVNode("div",z0,r.toDisplayString(i==null?void 0:i.prefix),1),K[6]||(K[6]=r.createTextVNode()),r.createVNode(L0,{modelValue:k.value,"onUpdate:modelValue":K[0]||(K[0]=ue=>k.value=ue),placeholder:S.value,disabled:i.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),K[7]||(K[7]=r.createTextVNode()),r.createElementVNode("div",Z0,[r.withDirectives(r.createElementVNode("div",$0,null,512),[[r.vShow,!m.value]]),K[1]||(K[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:P},null,512),[[r.vShow,m.value]])]),K[8]||(K[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[i.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:c,style:r.normalizeStyle(Z),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(ue,W)=>r.renderSlot(O.$slots,"item",{key:W,item:ue,textItem:"text",isSelected:M(ue),isHovered:s.activeOption==W,onClick:r.withModifiers(A=>Q(ue),["stop"])},()=>[r.createVNode(no,{option:ue,"text-item":"text","is-selected":M(ue),"is-hovered":s.activeOption==W,size:"medium",onClick:r.withModifiers(A=>Q(ue),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),K[3]||(K[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",U0,K[2]||(K[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):i.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,style:r.normalizeStyle(Z),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(ue,W)=>r.renderSlot(O.$slots,"item",{key:W,item:ue,isSelected:M(ue),isHovered:s.activeOption==W,onClick:r.withModifiers(A=>Q(ue),["stop"])},()=>[r.createVNode(G0,{option:ue,"is-selected":M(ue),"is-hovered":s.activeOption==W,onClick:r.withModifiers(A=>Q(ue),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),K[5]||(K[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",W0,K[4]||(K[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),H0={class:"ui-dropdown__envelope"},j0=["tabindex"],q0={class:"ui-dropdown__container"},K0={class:"ui-dropdown__field"},Y0=["disabled","placeholder"],J0={class:"ui-dropdown__controls"},X0={key:0},Q0={key:0,class:"required-icon"},ew={key:0,class:"nothing-found"},tw={key:0,class:"ui-dropdown__error"},nw={key:1,class:"ui-dropdown__helper"},rw={key:2,class:"ui-dropdown__helper"},iw={name:"PlDropdown"},ow=r.defineComponent({...iw,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>eo(Q.value.findIndex(W=>Bt(W.value,i.modelValue)),W=>W<0?0:W),m=()=>p.activeIndex=f(),v=r.computed(()=>i.options===void 0),k=r.computed(()=>v.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(W=>Bt(W.value,i.modelValue))),F=r.computed(()=>{if(!v.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>Pr(i.options??[]).map((W,A)=>({...W,index:A,isSelected:A===S.value,isActive:A===p.activeIndex}))),N=r.computed(()=>{const W=r.unref(T).find(A=>Bt(A.value,i.modelValue));return(W==null?void 0:W.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(N.value):i.placeholder),I=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),Q=r.computed(()=>{const W=T.value;return p.search?W.filter(A=>{const G=p.search.toLowerCase();return A.label.toLowerCase().includes(G)||A.description&&A.description.toLowerCase().includes(G)?!0:typeof A.value=="string"?A.value.toLowerCase().includes(G):A.value===p.search}):W}),M=r.computed(()=>k.value?void 0:"0"),R=W=>{var A;n("update:modelValue",W),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},U=()=>n("update:modelValue",void 0),z=()=>{var W;return(W=u.value)==null?void 0:W.focus()},P=()=>p.open=!p.open,Z=()=>p.open=!0,O=W=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains(W.relatedTarget)||(p.search="",p.open=!1)},K=()=>{const W=c.value;W&&it(W.querySelector(".hovered-item"),A=>{to(W,A)})},ue=W=>{var A,G;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(W.code))W.preventDefault();else return;const{open:Y,activeIndex:ve}=p;if(!Y){W.code==="Enter"&&(p.open=!0);return}W.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const xe=r.unref(Q),{length:Gt}=xe;if(!Gt)return;W.code==="Enter"&&R((G=xe.find(Lr=>Lr.index===ve))==null?void 0:G.value);const jt=xe.findIndex(Lr=>Lr.index===ve)??-1,At=W.code==="ArrowDown"?1:W.code==="ArrowUp"?-1:0,ko=Math.abs(jt+At+Gt)%Gt;p.activeIndex=Q.value[ko].index??-1};return Rn(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,W=>{var A;return W?(A=u.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&K()}),(W,A)=>(r.openBlock(),r.createElementBlock("div",H0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:M.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:W.error,disabled:k.value}]),onKeydown:ue,onFocusout:O},[r.createElementVNode("div",q0,[r.createElementVNode("div",K0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":A[0]||(A[0]=G=>p.search=G),type:"text",tabindex:"-1",disabled:k.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,Y0),[[r.vModelText,p.search]]),A[4]||(A[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(pl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(N.value),1)]),_:1})])),A[5]||(A[5]=r.createTextVNode()),r.createElementVNode("div",J0,[v.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:0,name:"loading"})):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),W.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(us),{key:1,name:"delete-clear",onClick:r.withModifiers(U,["stop"])})):r.createCommentVNode("",!0),A[2]||(A[2]=r.createTextVNode()),r.renderSlot(W.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),W.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${W.arrowIconLarge}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):W.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${W.arrowIcon}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(P,["stop"])}))])]),A[9]||(A[9]=r.createTextVNode()),W.label?(r.openBlock(),r.createElementBlock("label",X0,[W.required?(r.openBlock(),r.createElementBlock("i",Q0)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(W.label),1),A[7]||(A[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(W.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[10]||(A[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Q.value,(G,Y)=>(r.openBlock(),r.createBlock(no,{key:Y,option:G,"is-selected":G.isSelected,"is-hovered":G.isActive,size:W.optionSize,onClick:r.withModifiers(ve=>R(G.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),A[8]||(A[8]=r.createTextVNode()),Q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ew,"Nothing found"))],512)):r.createCommentVNode("",!0),A[11]||(A[11]=r.createTextVNode()),r.createVNode(ir,{class:"ui-dropdown__contour"})])],42,j0),A[12]||(A[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(F.value),1)):v.value&&W.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",nw,r.toDisplayString(W.loadingOptionsHelper),1)):W.helper?(r.openBlock(),r.createElementBlock("div",rw,r.toDisplayString(W.helper),1)):r.createCommentVNode("",!0)]))}}),sw={key:0,class:"ui-progress-bar"},aw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},lw={class:"ui-progress-bar__message flex-grow-1"},cw={class:"ui-progress-bar__percent"},dw=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(i,s)=>i.loading?(r.openBlock(),r.createElementBlock("div",sw,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:i.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",aw,[r.createElementVNode("div",lw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",cw,r.toDisplayString(i.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),uw={class:"mi-number-field__main-wrapper d-flex"},pw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},hw={key:0,class:"text-description"},fw=["disabled","placeholder"],mw={class:"mi-number-field__icons d-flex-column"},gw={key:0,class:"mi-number-field__hint text-description"},yw=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.ref(),l=r.useSlots(),c=r.ref();Rn(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var I;C=C.replace(/,/g,""),k(C)?(i("update:modelValue",+C),C.toString()!==((I=n.modelValue)==null?void 0:I.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&i("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),k(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),v=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function k(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function S(){if(!m.value){let C=0;n.modelValue===void 0?C=n.minValue?n.minValue:0:C=+(n.modelValue||0)+n.step,p.value=C.toString()}}function F(){if(!v.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function T(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?S():C.code==="ArrowDown"&&F()}const N=C=>{C.detail>1&&C.preventDefault()};return(C,I)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:C.disabled},"mi-number-field d-flex-column"]),onMousedown:N,onKeydown:I[1]||(I[1]=Q=>T(Q))},[r.createElementVNode("div",uw,[r.createVNode(ir,{class:"mi-number-field__contour"}),I[6]||(I[6]=r.createTextVNode()),r.createElementVNode("div",pw,[C.label?(r.openBlock(),r.createElementBlock("label",hw,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),I[2]||(I[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":I[0]||(I[0]=Q=>p.value=Q),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,fw),[[r.vModelText,p.value]])]),I[7]||(I[7]=r.createTextVNode()),r.createElementVNode("div",mw,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},I[3]||(I[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),I[5]||(I[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:v.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:F},I[4]||(I[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),I[8]||(I[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",gw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),vw={class:"pl-chip__text"},fl=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var i;e.value&&(n.value=((i=e.value)==null?void 0:i.clientWidth)>=256)}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Tt),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:i.small}])},[r.createElementVNode("div",vw,[r.renderSlot(i.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),i.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>i.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>i.$emit("close"),["stop"]))},s[2]||(s[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),key:"0"}:void 0]),1024))}}),_w={class:"pl-multi-dropdown__envelope"},Cw=["tabindex"],ww={class:"pl-multi-dropdown__container"},bw={class:"pl-multi-dropdown__field"},xw=["disabled","placeholder"],kw={class:"pl-multi-dropdown__append"},Sw={key:0},Ew={key:0,class:"required-icon"},Tw={class:"pl-multi-dropdown__open-chips-container"},Bw={key:0,class:"nothing-found"},Aw={key:0,class:"pl-multi-dropdown__error"},Pw={key:1,class:"pl-multi-dropdown__helper"},Vw={name:"PlDropdownMulti"},Nw=r.defineComponent({...Vw,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=P=>n("update:modelValue",P),s=r.useSlots(),l=t,c=r.ref(),u=r.ref(),p=r.ref(),f=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),v=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),k=r.computed(()=>Pr(l.options).filter(P=>ul(m.value,P.value))),S=r.computed(()=>{const P=r.unref(m),Z=Pr(l.options);return(f.search?Z.filter(O=>{const K=f.search.toLowerCase();return O.label.toLowerCase().includes(K)?!0:typeof O.value=="string"?O.value.toLowerCase().includes(K):O.value===f.search}):[...Z]).map(O=>({...O,selected:ul(P,O.value)}))}),F=r.computed(()=>l.disabled?void 0:"0"),T=()=>{f.activeOption=eo(S.value.findIndex(P=>Bt(P.value,l.modelValue)),P=>P<0?0:P)},N=P=>{var Z;const O=r.unref(m);i(ul(O,P)?O.filter(K=>!Bt(K,P)):[...O,P]),f.search="",(Z=c==null?void 0:c.value)==null||Z.focus()},C=P=>i(r.unref(m).filter(Z=>!Bt(Z,P))),I=()=>{var P;return(P=p.value)==null?void 0:P.focus()},Q=()=>f.open=!f.open,M=P=>{var Z,O;const K=P.relatedTarget;!((Z=c.value)!=null&&Z.contains(K))&&!((O=u.value)!=null&&O.contains(K))&&(f.search="",f.open=!1)},R=()=>{const P=u.value;P&&it(P.querySelector(".hovered-item"),Z=>{to(P,Z)})},U=P=>{var Z;const{open:O,activeOption:K}=f;if(!O){P.code==="Enter"&&(f.open=!0);return}P.code==="Escape"&&(f.open=!1,(Z=c.value)==null||Z.focus());const ue=r.unref(S),{length:W}=ue;if(!W)return;["ArrowDown","ArrowUp","Enter"].includes(P.code)&&P.preventDefault(),P.code==="Enter"&&N(ue[K].value);const A=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(K+A+W)%W,requestAnimationFrame(R)};Rn(c),r.watch(()=>l.modelValue,()=>T(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&R()});const z=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,P=>{if(P){const Z=P.getBoundingClientRect();f.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(c,P=>{const Z=P.top+P.height+5;Z+f.optionsHeight>P.clientHeight?z.top=P.top-f.optionsHeight-5+"px":z.top=Z+"px",z.left=P.left+"px",z.width=P.width+"px"}),(P,Z)=>(r.openBlock(),r.createElementBlock("div",_w,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:F.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:P.error,disabled:P.disabled}]),onKeydown:U,onFocusout:M},[r.createElementVNode("div",ww,[r.createElementVNode("div",bw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":Z[0]||(Z[0]=O=>f.search=O),type:"text",tabindex:"-1",disabled:P.disabled,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z[1]||(Z[1]=O=>f.open=!0)},null,40,xw),[[r.vModelText,f.search]]),Z[3]||(Z[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:I},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(O,K)=>(r.openBlock(),r.createBlock(r.unref(fl),{key:K,closeable:"",small:"",onClick:Z[2]||(Z[2]=r.withModifiers(ue=>f.open=!0,["stop"])),onClose:ue=>C(O.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.label||O.value),1)]),_:2},1032,["onClose"]))),128))])),Z[4]||(Z[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(Q,["stop"])}),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",kw,[r.renderSlot(P.$slots,"append")])]),Z[10]||(Z[10]=r.createTextVNode()),P.label?(r.openBlock(),r.createElementBlock("label",Sw,[P.required?(r.openBlock(),r.createElementBlock("i",Ew)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(P.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),f.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-multi-dropdown__options",style:r.normalizeStyle(z),tabindex:"-1",onFocusout:M},[r.createElementVNode("div",Tw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(O,K)=>(r.openBlock(),r.createBlock(r.unref(fl),{key:K,closeable:"",small:"",onClose:ue=>C(O.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.label||O.value),1)]),_:2},1032,["onClose"]))),128))]),Z[8]||(Z[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(O,K)=>(r.openBlock(),r.createBlock(no,{key:K,option:O,"text-item":"text","is-selected":O.selected,"is-hovered":f.activeOption==K,size:"medium","use-checkbox":"",onClick:r.withModifiers(ue=>N(O.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),Z[9]||(Z[9]=r.createTextVNode()),S.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Bw,"Nothing found"))],36)])):r.createCommentVNode("",!0),Z[12]||(Z[12]=r.createTextVNode()),r.createVNode(ir,{class:"pl-multi-dropdown__contour"})])],42,Cw),Z[13]||(Z[13]=r.createTextVNode()),P.error?(r.openBlock(),r.createElementBlock("div",Aw,r.toDisplayString(P.error),1)):P.helper?(r.openBlock(),r.createElementBlock("div",Pw,r.toDisplayString(P.helper),1)):r.createCommentVNode("",!0)]))}}),ml=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:i.disabled}]),onClick:s[0]||(s[0]=l=>i.$emit("update:modelValue",!i.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>i.$emit("update:modelValue",!i.modelValue),["enter"]))},null,34))}}),Dw={name:"PlCheckbox"},Fw=r.defineComponent({...Dw,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(i,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:i.disabled}])},[r.createVNode(ml,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>i.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>i.$emit("update:modelValue",!i.$props.modelValue))},[r.renderSlot(i.$slots,"default")])],2)):(r.openBlock(),r.createBlock(ml,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>i.$emit("update:modelValue",l))}),null,16))}}),Rw={key:0},Mw=["onClick"],Iw={name:"PlCheckboxGroup"},Lw=r.defineComponent({...Iw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=c=>i.modelValue.includes(c),l=c=>{const u=i.modelValue??[];n("update:modelValue",s(c)?u.filter(p=>p!==c):[...u,c])};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",Rw,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,f)=>(r.openBlock(),r.createElementBlock("div",{key:f},[r.createVNode(ml,{disabled:c.disabled,label:p.label,"model-value":s(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Mw)]))),128))],2))}}),Ow="_component_tupwt_1",Gw={component:Ow},zw={};function Zw(t,e){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(t.$style.component)},e[0]||(e[0]=[r.createElementVNode("div",null,null,-1)]),2)}const $w={$style:Gw},Uw=nr(zw,[["render",Zw],["__cssModules",$w]]),Ww={key:1,class:"pl-dialog-modal__title"},Hw={inheritAttrs:!1},gl=r.defineComponent({...Hw,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();function u(p){l.value&&document.contains(p.target)&&!l.value.contains(p.target)&&i("update:modelValue",!1)}return et(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&i("update:modelValue",!1)}),(p,f)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[r.createElementVNode("div",r.mergeProps(r.unref(c),{ref_key:"modal",ref:l,class:["pl-dialog-modal",{"has-title":r.unref(n).title,"has-content":r.unref(n).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(r.openBlock(),r.createBlock(Uw,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>i("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Ww,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),f[2]||(f[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[r.renderSlot(p.$slots,"default")],2),f[3]||(f[3]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[r.renderSlot(p.$slots,"actions")],2)):r.createCommentVNode("",!0)],16)])):r.createCommentVNode("",!0)]),_:3})]))}}),jw=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),_:3}))}}),qw={key:0,class:"pl-slide-modal__title"},Kw={class:"pl-slide-modal__content"},Yw={key:1,class:"pl-slide-modal__actions"},Jw={name:"PlSlideModal",inheritAttrs:!1},Xw=r.defineComponent({...Jw,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();return ds(l,()=>{s.modelValue&&s.closeOnOutsideClick&&i("update:modelValue",!1)}),et(document,"keydown",u=>{u.key==="Escape"&&i("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(jw,null,{default:r.withCtx(()=>[u.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:u.width}},r.unref(c),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>i("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",qw,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",Kw,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",Yw,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),Qw={key:0,class:"label"},eb={name:"PlToggleSwitch"},tb=r.defineComponent({...eb,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=i=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(i=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",Qw,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Tu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function nb(t){return r.unref(t)}const rb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function ib(t,e,n={}){const{immediate:i=!0}=n,s=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,c()}function p(...f){c(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},nb(e))}return i&&(s.value=!0,rb&&p()),Tu(u),{isPending:r.readonly(s),start:p,stop:u}}function ob(t,e,n){return r.watch(t,(i,s,l)=>{i&&e(i,s,l)},{...n,once:!1})}function sb(t,e,n){const{start:i}=ib(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),i())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),Tu(u),{isActive:s,pause:u,resume:c}}const ab="[==PROGRESS==]";function lb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function i(){var l;let c=e.value;if(c===void 0)return;const u=t.mockPlatforma??window.platforma;if(!u){console.warn("Platforma API is not available");return}for(;;){const p=await u.logDriver.readText(c.logHandle,100,c.lastOffset);if(c.error=void 0,n.errorCount=0,p.shouldUpdateHandle||c.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const f=t.progressPrefix??ab,m=new TextDecoder().decode(p.data).replace(new RegExp(`${lb(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=sb(()=>i().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return ob(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,s.pause()):l!==((c=e.value)==null?void 0:c.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,s.resume())},{immediate:!0}),e}const db={key:0},ub={key:1,class:"pl-log-view__error"},pb={name:"PlLogView"},hb=r.defineComponent({...pb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=k=>{if(k&&k.ok===!1)return k.errors.join(`
|
|
51
|
-
`)},n=t,i=cb(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var k;return((k=i.value)==null?void 0:k.error)??n.error??e(n.output)}),p=r.computed(()=>{var k;return((k=i.value)==null?void 0:k.lines)??n.value??dv(n.output)});Rn(c);const f=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},m=()=>{Ar(l.value,k=>{s.value&&k.scrollTo(k.scrollLeft,k.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{m()})},{immediate:!0});const v=k=>{const S=k.target;s.value=S.scrollTop+20>=S.scrollHeight-S.offsetHeight};return(k,S)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[k.label?(r.openBlock(),r.createElementBlock("label",db,r.toDisplayString(k.label),1)):r.createCommentVNode("",!0),S[0]||(S[0]=r.createTextVNode()),r.createVNode(ir,{class:"pl-log-view__contour"}),S[1]||(S[1]=r.createTextVNode()),r.createVNode(r.unref(Mn),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:f}),S[2]||(S[2]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",ub,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:v},r.toDisplayString(p.value),545))],2))}}),fb="_component_1ukal_1",mb="_tab_1ukal_14",gb="_disabled_1ukal_27",yb="_active_1ukal_56",vb="_topLine_1ukal_69",ni={component:fb,tab:mb,disabled:gb,active:yb,topLine:vb},_b=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const i=r.unref(e);if(!i)return;const s=i.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Tt),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Cb={name:"PlTabs"},wb=r.defineComponent({...Cb,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(ni).component,{[r.unref(ni).disabled]:s.disabled,[r.unref(ni).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createBlock(_b,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(ni).active]:s.modelValue===c.value,[r.unref(ni).disabled]:c.disabled},r.unref(ni).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>i(c.value),["enter"]),onClick:p=>i(c.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}});function bb(t){const e=t.split("/"),n=[];for(let i=0;i<e.length;i++)n.push({index:i,name:i===0?"Root":e[i],path:e.slice(0,i+1).join("/")});return n}const xb={class:"file-dialog"},kb={class:"file-dialog__search"},Sb={class:"ls-container"},Eb={class:"ls-head"},Tb={class:"ls-head__breadcrumbs"},Bb=["title","onClick"],Ab={key:0,class:"icon-16 icon-chevron-right"},Pb={class:"d-flex ml-auto align-center gap-12"},Vb={class:"ls-head__selected"},Nb={key:0,class:"ls-loader"},Db={key:1,class:"ls-empty"},Fb={key:2,class:"ls-error"},Rb={class:"ls-error__message"},Mb={key:3,class:"ls-body"},Ib=["onClick"],Lb=["title"],Ob=["onClick"],Gb=["title"],Bu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,i=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),c=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(z=>!z.name.startsWith("."))),u=r.computed(()=>{var z;return{modelValue:i.modelValue,dirPath:l.dirPath,storageHandle:(z=l.storageEntry)==null?void 0:z.handle}}),p=(z,P)=>{window.platforma&&l.currentLoadingPath!==P&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=P,window.platforma.lsDriver.listFiles(z,P).then(Z=>{P===l.dirPath&&(l.items=jd(Z).entries.map(O=>({path:O.fullPath,name:O.name,isDir:O.type==="dir",canBeSelected:O.type==="file"&&(!i.extensions||i.extensions.some(K=>O.fullPath.endsWith(K))),handle:O.type==="file"?O.handle:void 0,selected:!1})).sort((O,K)=>O.isDir&&!K.isDir?-1:!O.isDir&&K.isDir?1:O.name.localeCompare(K.name)).map((O,K)=>({id:K,...O})),l.lastSelected=void 0)}).catch(Z=>l.error=String(Z)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:z,dirPath:P,modelValue:Z}=u.value;z&&Z&&p(z,P)},m=Yd(z=>{l.dirPath=z??""},1e3),v=r.computed(()=>bb(l.dirPath)),k=r.computed(()=>l.items.filter(z=>z.canBeSelected&&z.selected&&!z.isDir)),S=r.computed(()=>k.value.length>0),F=()=>{n("update:modelValue",!1)},T=()=>{var z;S.value&&(z=l.storageEntry)!=null&&z.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:k.value.map(P=>P.handle)}),F())},N=z=>{l.dirPath=z,l.storageEntry&&f()},C=(z,P)=>{const{shiftKey:Z,metaKey:O}=z,{lastSelected:K}=l;if(z.preventDefault(),P.canBeSelected){if(i.multi||l.items.forEach(ue=>ue.selected=!1),P.selected=!0,!i.multi)return;!O&&!Z&&l.items.forEach(ue=>{ue.id!==P.id&&(ue.selected=!1)}),Z&&K!==void 0&&l.items.forEach(ue=>{av(ue.id,K,P.id)&&(ue.selected=!0)}),P.selected&&(l.lastSelected=P.id)}},I=z=>{z&&!i.multi||l.items.filter(P=>P.canBeSelected).forEach(P=>{P.selected=z})},Q=()=>I(!0),M=()=>I(!1),R=()=>{if(l.error="",l.lastSelected=void 0,M(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(z=>{l.storageOptions=z.map(P=>({text:P.name,value:P})),i.autoSelectStorage&&Ar(z.find(P=>P.name==="local"||P.name.startsWith("local_disk_")&&P.initialFullPath.length>4),P=>{l.storageEntry=P,l.dirPath=P.initialFullPath})}).catch(z=>l.error=String(z))};r.watch(r.toRef(l,"storageEntry"),z=>{l.dirPath=(z==null?void 0:z.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>i.modelValue,z=>{z?R():Object.assign(l,s())},{immediate:!0}),et(document,"keydown",z=>{i.modelValue&&z.target===document.body&&(z.metaKey&&z.code==="KeyA"&&(z.preventDefault(),Q()),z.metaKey&&z.shiftKey&&z.code==="Period"&&(z.preventDefault(),l.showHiddenItems=!l.showHiddenItems),z.code==="Enter"&&T())}),r.onUpdated(R);const U={mounted:z=>{if(z.clientWidth<z.scrollWidth){const P=z.innerText;z.innerText=P.substring(0,57)+"..."+P.substring(P.length-10)}}};return(z,P)=>(r.openBlock(),r.createBlock(r.unref(gl),{"no-content-gutters":!0,class:"split","model-value":z.modelValue,width:"688px",height:"720px","onUpdate:modelValue":F,onClick:r.withModifiers(M,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(il),{style:{"min-width":"160px"},disabled:!S.value,onClick:r.withModifiers(T,["stop"])},{default:r.withCtx(()=>P[14]||(P[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),P[16]||(P[16]=r.createTextVNode()),r.createVNode(r.unref(sl),{"justify-center":!1,onClick:r.withModifiers(F,["stop"])},{default:r.withCtx(()=>P[15]||(P[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[P[17]||(P[17]=r.createTextVNode()),r.createElementVNode("div",xb,[r.createElementVNode("div",kb,[r.createVNode(r.unref(hl),{modelValue:l.storageEntry,"onUpdate:modelValue":P[0]||(P[0]=Z=>l.storageEntry=Z),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),P[1]||(P[1]=r.createTextVNode()),r.createVNode(r.unref(bu),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),P[13]||(P[13]=r.createTextVNode()),r.createElementVNode("div",Sb,[r.createElementVNode("div",Eb,[r.createElementVNode("div",Tb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.value,(Z,O)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:O},[r.createElementVNode("div",{title:Z.path,onClick:K=>N(Z.path)},r.toDisplayString(Z.name),9,Bb),P[2]||(P[2]=r.createTextVNode()),Z.index!==v.value.length-1?(r.openBlock(),r.createElementBlock("i",Ab)):r.createCommentVNode("",!0)],64))),128))]),P[3]||(P[3]=r.createTextVNode()),r.createElementVNode("div",Pb,[r.createElementVNode("span",Vb,"Selected: "+r.toDisplayString(k.value.length),1)])]),P[12]||(P[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Nb,P[4]||(P[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",Fb,[P[6]||(P[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",Rb,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Mb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,Z=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Z.id},[Z.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:O=>N(Z.path)},[P[8]||(P[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),P[9]||(P[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,Lb)),[[U]])],8,Ib)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:Z.canBeSelected,selected:Z.selected}),onClick:r.withModifiers(O=>C(O,Z),["stop"])},[P[10]||(P[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),P[11]||(P[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,Gb)),[[U]])],10,Ob))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Db,P[5]||(P[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),P[18]||(P[18]=r.createTextVNode())]),_:1},8,["model-value"]))}});var Ie;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var yl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(yl||(yl={}));const oe=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},X=Ie.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zb=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Rt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Rt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Rt.create=t=>new Rt(t);const ri=(t,e)=>{let n;switch(t.code){case X.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case X.invalid_union:n="Invalid input";break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case X.invalid_arguments:n="Invalid function arguments";break;case X.invalid_return_type:n="Invalid function return type";break;case X.invalid_date:n="Invalid date";break;case X.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case X.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case X.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case X.custom:n="Invalid input";break;case X.invalid_intersection_types:n="Intersection results could not be merged";break;case X.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case X.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let Au=ri;function Zb(t){Au=t}function ps(){return Au}const hs=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},$b=[];function re(t,e){const n=ps(),i=hs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ri?void 0:ri].filter(s=>!!s)});t.common.issues.push(i)}class mt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return mt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),fs=t=>({status:"dirty",value:t}),wt=t=>({status:"valid",value:t}),vl=t=>t.status==="aborted",_l=t=>t.status==="dirty",ro=t=>t.status==="valid",io=t=>typeof Promise<"u"&&t instanceof Promise;function ms(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Pu(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var oo,so;class En{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Vu=(t,e)=>{if(ro(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Rt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,c)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:(u=f??i)!==null&&u!==void 0?u:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:c.defaultError}},description:s}}class Ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return or(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new mt,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(io(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Vu(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(io(s)?s:Promise.resolve(s));return Vu(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:X.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new ln({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bn.create(this,this._def)}nullable(){return dr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return an.create(this,this._def)}promise(){return ai.create(this,this._def)}or(e){return uo.create([this,e],this._def)}and(e){return po.create(this,e,this._def)}transform(e){return new ln({...Ee(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new yo({...Ee(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new bl({typeName:ye.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new vo({...Ee(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return _o.create(this,e)}readonly(){return Co.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ub=/^c[^\s-]{8,}$/i,Wb=/^[0-9a-z]+$/,Hb=/^[0-9A-HJKMNP-TV-Z]{26}$/,jb=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qb=/^[a-z0-9_-]{21}$/i,Kb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Yb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cl;const Xb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qb=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",tx=new RegExp(`^${Nu}$`);function Du(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function nx(t){return new RegExp(`^${Du(t)}$`)}function Fu(t){let e=`${Nu}T${Du(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function rx(t,e){return!!((e==="v4"||!e)&&Xb.test(t)||(e==="v6"||!e)&&Qb.test(t))}class sn extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.string,received:s.parsedType}),Ce}const n=new mt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(e,i),l?re(i,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&re(i,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Yb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"email",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Cl||(Cl=new RegExp(Jb,"u")),Cl.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"emoji",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")jb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"uuid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")qb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"nanoid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Ub.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Wb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid2",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Hb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ulid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),re(i,{validation:"url",code:X.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"regex",code:X.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Fu(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?tx.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?nx(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Kb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"duration",code:X.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?rx(e.data,s.version)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ip",code:X.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?ex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"base64",code:X.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:X.invalid_string,...de.errToObj(i)})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...de.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...de.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...de.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...de.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...de.errToObj(n)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new sn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new sn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new sn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}sn.create=t=>{var e;return new sn({checks:[],typeName:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function ix(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class sr extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.number,received:s.parsedType}),Ce}let n;const i=new mt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?ix(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_finite,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ie.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}sr.create=t=>new sr({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class ar extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==oe.bigint){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.bigint,received:s.parsedType}),Ce}let n;const i=new mt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new ar({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ar.create=t=>{var e;return new ar({checks:[],typeName:ye.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class ao extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.boolean,received:n.parsedType}),Ce}return wt(e.data)}}ao.create=t=>new ao({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Vr extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_date}),Ce}const n=new mt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:de.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Vr.create=t=>new Vr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Ee(t)});class gs extends Ae{_parse(e){if(this._getType(e)!==oe.symbol){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.symbol,received:n.parsedType}),Ce}return wt(e.data)}}gs.create=t=>new gs({typeName:ye.ZodSymbol,...Ee(t)});class lo extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.undefined,received:n.parsedType}),Ce}return wt(e.data)}}lo.create=t=>new lo({typeName:ye.ZodUndefined,...Ee(t)});class co extends Ae{_parse(e){if(this._getType(e)!==oe.null){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.null,received:n.parsedType}),Ce}return wt(e.data)}}co.create=t=>new co({typeName:ye.ZodNull,...Ee(t)});class ii extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return wt(e.data)}}ii.create=t=>new ii({typeName:ye.ZodAny,...Ee(t)});class Nr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wt(e.data)}}Nr.create=t=>new Nr({typeName:ye.ZodUnknown,...Ee(t)});class In extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.never,received:n.parsedType}),Ce}}In.create=t=>new In({typeName:ye.ZodNever,...Ee(t)});class ys extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.void,received:n.parsedType}),Ce}return wt(e.data)}}ys.create=t=>new ys({typeName:ye.ZodVoid,...Ee(t)});class an extends Ae{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==oe.array)return re(n,{code:X.invalid_type,expected:oe.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(re(n,{code:c?X.too_big:X.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:X.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:X.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new En(n,c,n.path,u)))).then(c=>mt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new En(n,c,n.path,u)));return mt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new an({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new an({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new an({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}an.create=(t,e)=>new an({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Ee(e)});function oi(t){if(t instanceof Ye){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Bn.create(oi(i))}return new Ye({...t._def,shape:()=>e})}else return t instanceof an?new an({...t._def,type:oi(t.element)}):t instanceof Bn?Bn.create(oi(t.unwrap())):t instanceof dr?dr.create(oi(t.unwrap())):t instanceof Tn?Tn.create(t.items.map(e=>oi(e))):t}class Ye extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ie.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==oe.object){const p=this._getOrReturnCtx(e);return re(p,{code:X.invalid_type,expected:oe.object,received:p.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof In&&this._def.unknownKeys==="strip"))for(const p in i.data)l.includes(p)||c.push(p);const u=[];for(const p of l){const f=s[p],m=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new En(i,m,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof In){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(p==="strict")c.length>0&&(re(i,{code:X.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const f of c){const m=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new En(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,v=await f.value;p.push({key:m,value:v,alwaysSet:f.alwaysSet})}return p}).then(p=>mt.mergeObjectSync(n,p)):mt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ye({...this._def,unknownKeys:"strip"})}passthrough(){return new Ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ye({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ye({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ye({...this._def,shape:()=>n})}deepPartial(){return oi(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ye({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Bn;)s=s._def.innerType;n[i]=s}}),new Ye({...this._def,shape:()=>n})}keyof(){return Ru(Ie.objectKeys(this.shape))}}Ye.create=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strip",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)}),Ye.strictCreate=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strict",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)}),Ye.lazycreate=(t,e)=>new Ye({shape:t,unknownKeys:"strip",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)});class uo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Rt(u.ctx.common.issues));return re(n,{code:X.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Rt(p));return re(n,{code:X.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}uo.create=(t,e)=>new uo({options:t,typeName:ye.ZodUnion,...Ee(e)});const lr=t=>t instanceof fo?lr(t.schema):t instanceof ln?lr(t.innerType()):t instanceof mo?[t.value]:t instanceof cr?t.options:t instanceof go?Ie.objectValues(t.enum):t instanceof yo?lr(t._def.innerType):t instanceof lo?[void 0]:t instanceof co?[null]:t instanceof Bn?[void 0,...lr(t.unwrap())]:t instanceof dr?[null,...lr(t.unwrap())]:t instanceof bl||t instanceof Co?lr(t.unwrap()):t instanceof vo?lr(t._def.innerType):[];class vs extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return re(n,{code:X.invalid_type,expected:oe.object,received:n.parsedType}),Ce;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=lr(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new vs({typeName:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(i)})}}function wl(t,e){const n=or(t),i=or(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&i===oe.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=wl(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=wl(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class po extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(vl(l)||vl(c))return Ce;const u=wl(l.value,c.value);return u.valid?((_l(l)||_l(c))&&n.dirty(),{status:n.value,value:u.data}):(re(i,{code:X.invalid_intersection_types}),Ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}po.create=(t,e,n)=>new po({left:t,right:e,typeName:ye.ZodIntersection,...Ee(n)});class Tn extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return re(i,{code:X.invalid_type,expected:oe.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return re(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(re(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new En(i,l,i.path,c)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>mt.mergeArray(n,l)):mt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Tn({...this._def,rest:e})}}Tn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tn({items:t,typeName:ye.ZodTuple,rest:null,...Ee(e)})};class ho extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return re(i,{code:X.invalid_type,expected:oe.object,received:i.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new En(i,u,i.path,u)),value:c._parse(new En(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?mt.mergeObjectAsync(n,s):mt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ae?new ho({keyType:e,valueType:n,typeName:ye.ZodRecord,...Ee(i)}):new ho({keyType:sn.create(),valueType:e,typeName:ye.ZodRecord,...Ee(n)})}}class _s extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return re(i,{code:X.invalid_type,expected:oe.map,received:i.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new En(i,u,i.path,[f,"key"])),value:l._parse(new En(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}_s.create=(t,e,n)=>new _s({valueType:e,keyType:t,typeName:ye.ZodMap,...Ee(n)});class Dr extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return re(i,{code:X.invalid_type,expected:oe.set,received:i.parsedType}),Ce;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(re(i,{code:X.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(re(i,{code:X.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new En(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Dr({...this._def,minSize:{value:e,message:de.toString(n)}})}max(e,n){return new Dr({...this._def,maxSize:{value:e,message:de.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Dr.create=(t,e)=>new Dr({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Ee(e)});class si extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.function)return re(n,{code:X.invalid_type,expected:oe.function,received:n.parsedType}),Ce;function i(u,p){return hs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),ri].filter(f=>!!f),issueData:{code:X.invalid_arguments,argumentsError:p}})}function s(u,p){return hs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),ri].filter(f=>!!f),issueData:{code:X.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof ai){const u=this;return wt(async function(...p){const f=new Rt([]),m=await u._def.args.parseAsync(p,l).catch(k=>{throw f.addIssue(i(p,k)),f}),v=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(k=>{throw f.addIssue(s(v,k)),f})})}else{const u=this;return wt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Rt([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Rt([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new si({...this._def,args:Tn.create(e).rest(Nr.create())})}returns(e){return new si({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new si({args:e||Tn.create([]).rest(Nr.create()),returns:n||Nr.create(),typeName:ye.ZodFunction,...Ee(i)})}}class fo extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}fo.create=(t,e)=>new fo({getter:t,typeName:ye.ZodLazy,...Ee(e)});class mo extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}mo.create=(t,e)=>new mo({value:t,typeName:ye.ZodLiteral,...Ee(e)});function Ru(t,e){return new cr({values:t,typeName:ye.ZodEnum,...Ee(e)})}class cr extends Ae{constructor(){super(...arguments),oo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{expected:Ie.joinValues(i),received:n.parsedType,code:X.invalid_type}),Ce}if(ms(this,oo)||Pu(this,oo,new Set(this._def.values)),!ms(this,oo).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{received:n.data,code:X.invalid_enum_value,options:i}),Ce}return wt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return cr.create(e,{...this._def,...n})}exclude(e,n=this._def){return cr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}oo=new WeakMap,cr.create=Ru;class go extends Ae{constructor(){super(...arguments),so.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){const s=Ie.objectValues(n);return re(i,{expected:Ie.joinValues(s),received:i.parsedType,code:X.invalid_type}),Ce}if(ms(this,so)||Pu(this,so,new Set(Ie.getValidEnumValues(this._def.values))),!ms(this,so).has(e.data)){const s=Ie.objectValues(n);return re(i,{received:i.data,code:X.invalid_enum_value,options:s}),Ce}return wt(e.data)}get enum(){return this._def.values}}so=new WeakMap,go.create=(t,e)=>new go({values:t,typeName:ye.ZodNativeEnum,...Ee(e)});class ai extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return re(n,{code:X.invalid_type,expected:oe.promise,received:n.parsedType}),Ce;const i=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return wt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ai.create=(t,e)=>new ai({type:t,typeName:ye.ZodPromise,...Ee(e)});class ln extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{re(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?fs(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?fs(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ro(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>ro(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Ie.assertNever(s)}}ln.create=(t,e,n)=>new ln({schema:t,typeName:ye.ZodEffects,effect:e,...Ee(n)}),ln.createWithPreprocess=(t,e,n)=>new ln({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Ee(n)});class Bn extends Ae{_parse(e){return this._getType(e)===oe.undefined?wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bn.create=(t,e)=>new Bn({innerType:t,typeName:ye.ZodOptional,...Ee(e)});class dr extends Ae{_parse(e){return this._getType(e)===oe.null?wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dr.create=(t,e)=>new dr({innerType:t,typeName:ye.ZodNullable,...Ee(e)});class yo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yo.create=(t,e)=>new yo({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class vo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return io(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Rt(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Rt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}vo.create=(t,e)=>new vo({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Cs extends Ae{_parse(e){if(this._getType(e)!==oe.nan){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Cs.create=t=>new Cs({typeName:ye.ZodNaN,...Ee(t)});const ox=Symbol("zod_brand");class bl extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class _o extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),fs(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new _o({in:e,out:n,typeName:ye.ZodPipeline})}}class Co extends Ae{_parse(e){const n=this._def.innerType._parse(e),i=s=>(ro(s)&&(s.value=Object.freeze(s.value)),s);return io(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}Co.create=(t,e)=>new Co({innerType:t,typeName:ye.ZodReadonly,...Ee(e)});function Mu(t,e={},n){return t?ii.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ii.create()}const sx={object:Ye.lazycreate};var ye;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ye||(ye={}));const ax=(t,e={message:`Input not instance of ${t.name}`})=>Mu(n=>n instanceof t,e),Iu=sn.create,Lu=sr.create,lx=Cs.create,cx=ar.create,Ou=ao.create,dx=Vr.create,ux=gs.create,px=lo.create,hx=co.create,fx=ii.create,mx=Nr.create,gx=In.create,yx=ys.create,vx=an.create,_x=Ye.create,Cx=Ye.strictCreate,wx=uo.create,bx=vs.create,xx=po.create,kx=Tn.create,Sx=ho.create,Ex=_s.create,Tx=Dr.create,Bx=si.create,Ax=fo.create,Px=mo.create,Vx=cr.create,Nx=go.create,Dx=ai.create,Gu=ln.create,Fx=Bn.create,Rx=dr.create,Mx=ln.createWithPreprocess,Ix=_o.create;var ws=Object.freeze({__proto__:null,defaultErrorMap:ri,setErrorMap:Zb,getErrorMap:ps,makeIssue:hs,EMPTY_PATH:$b,addIssueToContext:re,ParseStatus:mt,INVALID:Ce,DIRTY:fs,OK:wt,isAborted:vl,isDirty:_l,isValid:ro,isAsync:io,get util(){return Ie},get objectUtil(){return yl},ZodParsedType:oe,getParsedType:or,ZodType:Ae,datetimeRegex:Fu,ZodString:sn,ZodNumber:sr,ZodBigInt:ar,ZodBoolean:ao,ZodDate:Vr,ZodSymbol:gs,ZodUndefined:lo,ZodNull:co,ZodAny:ii,ZodUnknown:Nr,ZodNever:In,ZodVoid:ys,ZodArray:an,ZodObject:Ye,ZodUnion:uo,ZodDiscriminatedUnion:vs,ZodIntersection:po,ZodTuple:Tn,ZodRecord:ho,ZodMap:_s,ZodSet:Dr,ZodFunction:si,ZodLazy:fo,ZodLiteral:mo,ZodEnum:cr,ZodNativeEnum:go,ZodPromise:ai,ZodEffects:ln,ZodTransformer:ln,ZodOptional:Bn,ZodNullable:dr,ZodDefault:yo,ZodCatch:vo,ZodNaN:Cs,BRAND:ox,ZodBranded:bl,ZodPipeline:_o,ZodReadonly:Co,custom:Mu,Schema:Ae,ZodSchema:Ae,late:sx,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>sn.create({...t,coerce:!0}),number:t=>sr.create({...t,coerce:!0}),boolean:t=>ao.create({...t,coerce:!0}),bigint:t=>ar.create({...t,coerce:!0}),date:t=>Vr.create({...t,coerce:!0})},any:fx,array:vx,bigint:cx,boolean:Ou,date:dx,discriminatedUnion:bx,effect:Gu,enum:Vx,function:Bx,instanceof:ax,intersection:xx,lazy:Ax,literal:Px,map:Ex,nan:lx,nativeEnum:Nx,never:gx,null:hx,nullable:Rx,number:Lu,object:_x,oboolean:()=>Ou().optional(),onumber:()=>Lu().optional(),optional:Fx,ostring:()=>Iu().optional(),pipeline:Ix,preprocess:Mx,promise:Dx,record:Sx,set:Tx,strictObject:Cx,string:Iu,symbol:ux,transformer:Gu,tuple:kx,undefined:px,union:wx,unknown:mx,void:yx,NEVER:Ce,ZodIssueCode:X,quotelessJson:zb,ZodError:Rt});function Lx(t){throw new Error("Unexpected object: "+t)}const zu="upload://upload/",Zu="index://index/";function Ox(t){return t.startsWith(zu)}function Gx(t){return t.startsWith(Zu)}function zx(t){if(Gx(t)){const e=t.slice(Zu.length);return JSON.parse(decodeURIComponent(e)).path}else if(Ox(t)){const e=t.slice(zu.length);return JSON.parse(decodeURIComponent(e)).localPath}Lx(t)}ws.object({__isRef:ws.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ws.string().describe("Upstream block id"),name:ws.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Zx(t){return t.replace(/^.*[\\/]/,"")}const $x={key:0,ref:"label"},Ux={key:0,class:"required-icon"},Wx=["data-placeholder"],Hx={key:5,class:"pl-file-input__stats"},jx={key:0,class:"pl-file-input__error"},qx={key:1,class:"upl-file-input__helper"},$u=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1}),i=r.useSlots(),s=e,l=t,c=r.computed(()=>{if(l.modelValue)try{const C=zx(l.modelValue).trim();return l.showFilenameOnly?Zx(C):C}catch(C){return console.error(C),l.modelValue}return""}),u=r.computed(()=>l.progress&&!l.progress.done),p=r.computed(()=>l.progress&&l.progress.done),f=r.computed(()=>l.error),m=r.computed(()=>l.error),v=r.computed(()=>{const{status:C,done:I}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!I?Ka(C.bytesProcessed,{})+" / "+Ka(C.bytesTotal,{}):Ka(C.bytesTotal,{})}),k=r.computed(()=>{var C;const{progress:I}=l;return I?{width:I.done?"100%":Math.round((((C=I.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),S=()=>{n.fileDialogOpen=!0},F=C=>{C.files.length&&s("update:modelValue",C.files[0])},T=()=>s("update:modelValue",void 0),N=r.ref();return l.cellStyle||Rn(N),(C,I)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!C.cellStyle,"has-file":!!c.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:N,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(S,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(k.value)},null,4),I[3]||(I[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",$x,[C.required?(r.openBlock(),r.createElementBlock("i",Ux)):r.createCommentVNode("",!0),I[1]||(I[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),I[2]||(I[2]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),I[4]||(I[4]=r.createTextVNode()),f.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:1,name:"restart"})):u.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:2,name:"cloud-upload"})):p.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Mn),{key:4,name:"paper-clip"})),I[5]||(I[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(S,["stop"])},r.toDisplayString(c.value),9,Wx),I[6]||(I[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",Hx,r.toDisplayString(v.value),1)):r.createCommentVNode("",!0),I[7]||(I[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(Mn),{key:6,name:"close",onClick:r.withModifiers(T,["stop"])})):r.createCommentVNode("",!0),I[8]||(I[8]=r.createTextVNode()),r.createVNode(ir,{class:"pl-file-input__contour"})],34),I[9]||(I[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",jx,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",qx,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),I[10]||(I[10]=r.createTextVNode()),r.createVNode(r.unref(Bu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":I[0]||(I[0]=Q=>n.fileDialogOpen=Q),extensions:C.extensions,title:C.fileDialogTitle,"onImport:files":F},null,8,["modelValue","extensions","title"])],64))}}),Kx={class:"pl-notification-alert__wrapper d-flex"},Yx={class:"pl-notification-alert__content flex-grow-1"},Jx={key:0,class:"pl-notification-alert__close"},Xx={key:0,class:"pl-notification-alert__actions d-flex"},Uu=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function i(){e.closable&&(n.value=!1)}return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",Kx,[r.createElementVNode("div",Yx,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",Jx,[r.createVNode(r.unref(sl),{icon:"close",onClick:i})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",Xx,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Wu=r.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const n=e,i=r.ref(!1),s=r.computed(()=>i.value?"mask-clipboard-copied":"mask-clipboard");function l(){i.value=!0,setTimeout(()=>i.value=!1,700),n("copy")}return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.value,"mask-24"]),onClick:l},null,2))}}),Qx=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,i)=>r.renderSlot(n.$slots,"default")}});function gt(t,e,n){return e>t?e:t>n?n:t}const xl=t=>r.computed(()=>{const e=[100],{min:n,max:i,step:s}=t.value;let l=n;for(;l<i;){l+=s;const c=(1-(gt(l,n,i)-n)/(i-n))*100;e.push(c)}return e}),ek={class:"ui-slider__wrapper"},tk={class:"ui-slider__label-section"},nk={key:0,class:"text-s"},rk={key:1,class:"ui-slider__value-static text-s"},ik={class:"ui-slider__base"},ok={class:"ui-slider__container"},sk={class:"ui-slider__container ui-slider__container-thumb"},ak={class:"ui-slider__input-wrapper d-flex"},lk=["value"],ck={key:0,class:"ui-slider__error"},dk=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>gt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const R=s.modelValue;return Number.isFinite(R)?R<s.min?`Min value: ${s.min}`:R>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),v=xl(m),k=r.computed(()=>(u.value-s.min)/c.value),S=r.computed(()=>({right:Math.ceil((1-k.value)*100)+"%"})),F=r.computed(()=>({right:`calc(${Math.ceil((1-k.value)*100)}%) `})),T=r.ref(),N=r.ref();r.watch(()=>s.modelValue,R=>{p.value=R});function C(R){const U=gt(R,s.min,s.max);return Math.round((U+Number.EPSILON)*(1/s.step))/(1/s.step)}rr(N,R=>{var U;it((U=r.unref(T))==null?void 0:U.getBoundingClientRect(),z=>{const{dx:P}=R;l.deltaValue=P/z.width*c.value,p.value=C(gt((s.modelValue??0)+l.deltaValue,s.min,s.max)),R.stop&&(i("update:modelValue",C(u.value)),l.deltaValue=0)})});function I(R){i("update:modelValue",C(R))}function Q(R){I(+R.target.value)}function M(R){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(R.code)&&R.preventDefault();const U=R.code==="ArrowUp"||R.code==="ArrowRight"?s.step*1:R.code==="ArrowDown"||R.code==="ArrowLeft"?s.step*-1:0;I(s.modelValue+U)}return(R,U)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",ek,[r.createElementVNode("div",tk,[R.label?(r.openBlock(),r.createElementBlock("label",nk,[r.createElementVNode("span",null,r.toDisplayString(R.label),1),U[1]||(U[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(R.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),U[2]||(U[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",rk,r.toDisplayString(p.value)+r.toDisplayString(R.measure),1)):r.createCommentVNode("",!0)]),U[6]||(U[6]=r.createTextVNode()),r.createElementVNode("div",ik,[r.createElementVNode("div",ok,[r.createElementVNode("div",{ref_key:"barRef",ref:T,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(S.value)},null,4)],512)]),U[5]||(U[5]=r.createTextVNode()),r.createElementVNode("div",sk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(v),(z,P)=>(r.openBlock(),r.createElementBlock("div",{key:P,style:r.normalizeStyle({right:`${z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),U[4]||(U[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:N,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(F.value),onKeydown:M},U[3]||(U[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),U[7]||(U[7]=r.createTextVNode()),r.createElementVNode("div",ak,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:U[0]||(U[0]=z=>Q(z))},null,40,lk)):r.createCommentVNode("",!0)])],2),U[8]||(U[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",ck,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function uk(t,e=null,n=null){function i(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const v=f-p-m,k=p>e?e:0,S=v>e?m-e-k:m;return`linear-gradient(
|
|
50
|
+
`,ww=["innerHTML"],bw={class:"dropdown-list-item__title-container"},xw={class:"dropdown-list-item__title text-s"},kw={key:0,class:"dropdown-list-item__description text-description"},Sw={key:1,class:"dropdown-list-item__icon flex-self-start"},oo=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),i=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?Cw:_w);return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([n.value,"dropdown-list-item"])},[e.useCheckbox?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(i.value),innerHTML:s.value},null,10,ww)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",bw,[r.createElementVNode("div",xw,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",kw,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",Sw)):r.createCommentVNode("",!0)],2))}}),vl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),i=r.ref(!1),s=r.computed(()=>i.value&&e.value?"ui-lt-animate":""),l=hu(m=>i.value=m,500),c=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function u(){const m=ol(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:f},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(s.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}}),Ln=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass(n.value)},null,2))}}),Ew={class:"pl-dropdown__envelope"},Tw=["tabindex"],Bw={class:"pl-dropdown__container"},Vw={class:"pl-dropdown__field"},Aw=["disabled","placeholder"],Nw={class:"pl-dropdown__controls"},Pw={key:0},Dw={key:0,class:"required-icon"},Fw={key:0,class:"nothing-found"},Rw={key:0,class:"pl-dropdown__error"},Mw={key:1,class:"pl-dropdown__helper"},Iw={key:2,class:"pl-dropdown__helper"},Lw={name:"PlDropdown"},so=r.defineComponent({...Lw,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>ro(Q.value.findIndex(N=>Pt(N.value,i.modelValue)),N=>N<0?0:N),m=()=>p.activeIndex=f(),y=r.computed(()=>i.options===void 0),S=r.computed(()=>y.value?!0:i.disabled),E=r.computed(()=>(i.options??[]).findIndex(N=>Pt(N.value,i.modelValue))),M=r.computed(()=>{if(!y.value){if(i.error)return i.error;if(i.modelValue!==void 0&&E.value===-1)return"The selected value is not one of the options"}}),V=r.computed(()=>Rr(i.options??[]).map((N,Z)=>({...N,index:Z,isSelected:Z===E.value,isActive:Z===p.activeIndex}))),F=r.computed(()=>{const N=r.unref(V).find(Z=>Pt(Z.value,i.modelValue));return(N==null?void 0:N.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(F.value):i.placeholder),G=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),Q=r.computed(()=>{const N=V.value;return p.search?N.filter(Z=>{const Y=p.search.toLowerCase();return Z.label.toLowerCase().includes(Y)||Z.description&&Z.description.toLowerCase().includes(Y)?!0:typeof Z.value=="string"?Z.value.toLowerCase().includes(Y):Z.value===p.search}):N}),I=r.computed(()=>S.value?void 0:"0"),L=N=>{var Z;n("update:modelValue",N),p.search="",p.open=!1,(Z=l==null?void 0:l.value)==null||Z.focus()},U=()=>n("update:modelValue",void 0),T=()=>{var N;return(N=u.value)==null?void 0:N.focus()},k=()=>p.open=!p.open,O=()=>p.open=!0,A=N=>{var Z,Y;const pe=N.relatedTarget;!((Z=l.value)!=null&&Z.contains(pe))&&!((Y=c.value)!=null&&Y.contains(pe))&&(p.search="",p.open=!1)},q=()=>{const N=c.value;N&&ot(N.querySelector(".hovered-item"),Z=>{io(N,Z)})},se=N=>{var Z,Y;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(N.code))N.preventDefault();else return;const{open:pe,activeIndex:we}=p;if(!pe){N.code==="Enter"&&(p.open=!0);return}N.code==="Escape"&&(p.open=!1,(Z=l.value)==null||Z.focus());const Ct=r.unref(Q),{length:Tt}=Ct;if(!Tt)return;N.code==="Enter"&&L((Y=Ct.find(vr=>vr.index===we))==null?void 0:Y.value);const ht=Ct.findIndex(vr=>vr.index===we)??-1,yr=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0,An=Math.abs(ht+yr+Tt)%Tt;p.activeIndex=Q.value[An].index??-1};In(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,N=>{var Z;return N?(Z=u.value)==null?void 0:Z.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&q()});const $=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,N=>{if(N){const Z=N.getBoundingClientRect();p.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),no(l,N=>{const Z=N.top+N.height+3;Z+p.optionsHeight>N.clientHeight?$.top=N.top-p.optionsHeight-3+"px":$.top=Z+"px",$.left=N.left+"px",$.width=N.width+"px"}),(N,Z)=>(r.openBlock(),r.createElementBlock("div",Ew,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:I.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:N.error,disabled:S.value}]),onKeydown:se,onFocusout:A},[r.createElementVNode("div",Bw,[r.createElementVNode("div",Vw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":Z[0]||(Z[0]=Y=>p.search=Y),type:"text",tabindex:"-1",disabled:S.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O},null,40,Aw),[[r.vModelText,p.search]]),Z[4]||(Z[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:T},[r.createVNode(vl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(F.value),1)]),_:1})])),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",Nw,[y.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:0,name:"loading"})):r.createCommentVNode("",!0),Z[1]||(Z[1]=r.createTextVNode()),N.clearable&&G.value?(r.openBlock(),r.createBlock(r.unref(hs),{key:1,name:"delete-clear",onClick:r.withModifiers(U,["stop"])})):r.createCommentVNode("",!0),Z[2]||(Z[2]=r.createTextVNode()),r.renderSlot(N.$slots,"append"),Z[3]||(Z[3]=r.createTextVNode()),N.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${N.arrowIconLarge}`]]),onClick:r.withModifiers(k,["stop"])},null,2)):N.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${N.arrowIcon}`]]),onClick:r.withModifiers(k,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(k,["stop"])}))])]),Z[9]||(Z[9]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",Pw,[N.required?(r.openBlock(),r.createElementBlock("i",Dw)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[10]||(Z[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:c,class:"pl-dropdown__options",style:r.normalizeStyle($),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Q.value,(Y,pe)=>(r.openBlock(),r.createBlock(oo,{key:pe,option:Y,"is-selected":Y.isSelected,"is-hovered":Y.isActive,size:N.optionSize,onClick:r.withModifiers(we=>L(Y.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),Z[8]||(Z[8]=r.createTextVNode()),Q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Fw,"Nothing found"))],4)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),r.createVNode(ar,{class:"pl-dropdown__contour"})])],42,Tw),Z[12]||(Z[12]=r.createTextVNode()),M.value?(r.openBlock(),r.createElementBlock("div",Rw,r.toDisplayString(M.value),1)):y.value&&N.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Mw,r.toDisplayString(N.loadingOptionsHelper),1)):N.helper?(r.openBlock(),r.createElementBlock("div",Iw,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),Ow={name:"PlDropdownRef"},Gw=r.defineComponent({...Ow,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),i=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(so),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function zw(t,e){return r.computed(()=>{const n=Rr(t.value);return e.value?n.filter(i=>i.label.toLowerCase().includes(e.value.toLowerCase())):n})}const Zw={class:"resizable-input"},Uw=["placeholder","value","disabled"],$w=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function c(u){const p=u.target.value;i("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",Zw,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(s.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(u.$attrs,{placeholder:u.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,Uw)]))}}),Ww={class:"dropdown-tab-item__title text-caps13"},Hw=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),i=r.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.value,"dropdown-tab-item"])},[r.createElementVNode("div",Ww,r.toDisplayString(n.value),1)],2))}}),jw={class:"pl-line-dropdown__prefix"},qw={class:"pl-line-dropdown__icon-wrapper"},Kw={class:"pl-line-dropdown__icon"},Yw={key:0,class:"pl-line-dropdown__no-item"},Jw={key:0,class:"pl-line-dropdown__no-item"},Vu=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),u=r.computed(()=>{const A=[];return s.isOpen&&A.push("open"),i.disabled&&A.push("disabled"),A.join(" ")}),p=r.ref(""),f=zw(r.toRef(i,"options"),p),m=r.computed(()=>!!(i.clearable&&s.isOpen&&i.modelValue&&y.value)),y=r.computed(()=>{if(i.modelValue){const A=M();if(A!==-1){const q=Rr(i.options)[A];return typeof q.label=="object"?q.label.title:q.label}}return""}),S=r.ref(y.value),E=r.computed(()=>s.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");ps(l,()=>{i.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>S.value,A=>{y.value!==A?p.value=A:p.value=""}),r.watch(()=>s.isOpen,A=>{var q;A&&l.value&&((q=l.value.querySelector("input"))==null||q.focus(),r.nextTick(()=>T()))}),r.watch(()=>i.modelValue,()=>V(),{immediate:!0});function M(){return i.options.findIndex(A=>Pt(A.value,i.modelValue))}function V(){s.activeOption=ro(f.value.findIndex(A=>Pt(A.value,i.modelValue)),A=>A<0?0:A),S.value=y.value}function F(){p.value=""}function C(){i.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function G(){i.mode==="list"&&(s.isOpen=!1)}function Q(A){A&&(n("update:modelValue",A.value),G(),F())}function I(A){return Pt(A.value,i.modelValue)}const L=A=>{var q,se;const $=A.relatedTarget;!((q=l.value)!=null&&q.contains($))&&!((se=c.value)!=null&&se.contains($))&&(p.value="",s.isOpen=!1)};function U(A){const{activeOption:q}=s;if(!s.isOpen&&A.code==="Enter"){s.isOpen=!0;return}const{length:se}=f.value;if(!se)return;["ArrowDown","ArrowUp","Enter"].includes(A.code)&&A.preventDefault(),A.code==="Enter"&&Q(f.value[q]);const $=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(q+$+se)%se,requestAnimationFrame(T)}function T(){const A=c.value;A&&ot(A.querySelector(".hovered-item"),q=>{i.mode==="list"?io(A,q):q.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function k(){n("update:modelValue",void 0)}const O=r.reactive({top:"0px",left:"0px"});return r.watch(c,A=>{if(A){const q=A.getBoundingClientRect();s.optionsHeight=q.height,window.dispatchEvent(new CustomEvent("adjust"))}}),no(l,A=>{const q=A.top+A.height+2;q+s.optionsHeight>A.clientHeight?O.top=A.top-s.optionsHeight-2+"px":O.top=q+"px",O.left=A.left+"px"}),(A,q)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:U,onFocusout:L,onClick:C},[r.createElementVNode("div",jw,r.toDisplayString(i==null?void 0:i.prefix),1),q[6]||(q[6]=r.createTextVNode()),r.createVNode($w,{modelValue:S.value,"onUpdate:modelValue":q[0]||(q[0]=se=>S.value=se),placeholder:E.value,disabled:i.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),q[7]||(q[7]=r.createTextVNode()),r.createElementVNode("div",qw,[r.withDirectives(r.createElementVNode("div",Kw,null,512),[[r.vShow,!m.value]]),q[1]||(q[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:k},null,512),[[r.vShow,m.value]])]),q[8]||(q[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[i.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:c,style:r.normalizeStyle(O),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:L},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(se,$)=>r.renderSlot(A.$slots,"item",{key:$,item:se,textItem:"text",isSelected:I(se),isHovered:s.activeOption==$,onClick:r.withModifiers(N=>Q(se),["stop"])},()=>[r.createVNode(oo,{option:se,"text-item":"text","is-selected":I(se),"is-hovered":s.activeOption==$,size:"medium",onClick:r.withModifiers(N=>Q(se),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),q[3]||(q[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",Yw,q[2]||(q[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):i.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,style:r.normalizeStyle(O),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:L},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(se,$)=>r.renderSlot(A.$slots,"item",{key:$,item:se,isSelected:I(se),isHovered:s.activeOption==$,onClick:r.withModifiers(N=>Q(se),["stop"])},()=>[r.createVNode(Hw,{option:se,"is-selected":I(se),"is-hovered":s.activeOption==$,onClick:r.withModifiers(N=>Q(se),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),q[5]||(q[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",Jw,q[4]||(q[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),Xw={class:"ui-dropdown__envelope"},Qw=["tabindex"],e0={class:"ui-dropdown__container"},t0={class:"ui-dropdown__field"},n0=["disabled","placeholder"],r0={class:"ui-dropdown__controls"},i0={key:0},o0={key:0,class:"required-icon"},s0={key:0,class:"nothing-found"},a0={key:0,class:"ui-dropdown__error"},l0={key:1,class:"ui-dropdown__helper"},c0={key:2,class:"ui-dropdown__helper"},d0={name:"PlDropdown"},u0=r.defineComponent({...d0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>ro(Q.value.findIndex($=>Pt($.value,i.modelValue)),$=>$<0?0:$),m=()=>p.activeIndex=f(),y=r.computed(()=>i.options===void 0),S=r.computed(()=>y.value?!0:i.disabled),E=r.computed(()=>(i.options??[]).findIndex($=>Pt($.value,i.modelValue))),M=r.computed(()=>{if(!y.value){if(i.error)return i.error;if(i.modelValue!==void 0&&E.value===-1)return"The selected value is not one of the options"}}),V=r.computed(()=>Rr(i.options??[]).map(($,N)=>({...$,index:N,isSelected:N===E.value,isActive:N===p.activeIndex}))),F=r.computed(()=>{const $=r.unref(V).find(N=>Pt(N.value,i.modelValue));return($==null?void 0:$.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(F.value):i.placeholder),G=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),Q=r.computed(()=>{const $=V.value;return p.search?$.filter(N=>{const Z=p.search.toLowerCase();return N.label.toLowerCase().includes(Z)||N.description&&N.description.toLowerCase().includes(Z)?!0:typeof N.value=="string"?N.value.toLowerCase().includes(Z):N.value===p.search}):$}),I=r.computed(()=>S.value?void 0:"0"),L=$=>{var N;n("update:modelValue",$),p.search="",p.open=!1,(N=l==null?void 0:l.value)==null||N.focus()},U=()=>n("update:modelValue",void 0),T=()=>{var $;return($=u.value)==null?void 0:$.focus()},k=()=>p.open=!p.open,O=()=>p.open=!0,A=$=>{var N;(N=l==null?void 0:l.value)!=null&&N.contains($.relatedTarget)||(p.search="",p.open=!1)},q=()=>{const $=c.value;$&&ot($.querySelector(".hovered-item"),N=>{io($,N)})},se=$=>{var N,Z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes($.code))$.preventDefault();else return;const{open:Y,activeIndex:pe}=p;if(!Y){$.code==="Enter"&&(p.open=!0);return}$.code==="Escape"&&(p.open=!1,(N=l.value)==null||N.focus());const we=r.unref(Q),{length:Ct}=we;if(!Ct)return;$.code==="Enter"&&L((Z=we.find(An=>An.index===pe))==null?void 0:Z.value);const Tt=we.findIndex(An=>An.index===pe)??-1,ht=$.code==="ArrowDown"?1:$.code==="ArrowUp"?-1:0,yr=Math.abs(Tt+ht+Ct)%Ct;p.activeIndex=Q.value[yr].index??-1};return In(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,$=>{var N;return $?(N=u.value)==null?void 0:N.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&q()}),($,N)=>(r.openBlock(),r.createElementBlock("div",Xw,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:I.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:$.error,disabled:S.value}]),onKeydown:se,onFocusout:A},[r.createElementVNode("div",e0,[r.createElementVNode("div",t0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":N[0]||(N[0]=Z=>p.search=Z),type:"text",tabindex:"-1",disabled:S.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O},null,40,n0),[[r.vModelText,p.search]]),N[4]||(N[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:T},[r.createVNode(vl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(F.value),1)]),_:1})])),N[5]||(N[5]=r.createTextVNode()),r.createElementVNode("div",r0,[y.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:0,name:"loading"})):r.createCommentVNode("",!0),N[1]||(N[1]=r.createTextVNode()),$.clearable&&G.value?(r.openBlock(),r.createBlock(r.unref(hs),{key:1,name:"delete-clear",onClick:r.withModifiers(U,["stop"])})):r.createCommentVNode("",!0),N[2]||(N[2]=r.createTextVNode()),r.renderSlot($.$slots,"append"),N[3]||(N[3]=r.createTextVNode()),$.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${$.arrowIconLarge}`]]),onClick:r.withModifiers(k,["stop"])},null,2)):$.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${$.arrowIcon}`]]),onClick:r.withModifiers(k,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(k,["stop"])}))])]),N[9]||(N[9]=r.createTextVNode()),$.label?(r.openBlock(),r.createElementBlock("label",i0,[$.required?(r.openBlock(),r.createElementBlock("i",o0)):r.createCommentVNode("",!0),N[6]||(N[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString($.label),1),N[7]||(N[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot($.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),N[10]||(N[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Q.value,(Z,Y)=>(r.openBlock(),r.createBlock(oo,{key:Y,option:Z,"is-selected":Z.isSelected,"is-hovered":Z.isActive,size:$.optionSize,onClick:r.withModifiers(pe=>L(Z.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),N[8]||(N[8]=r.createTextVNode()),Q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",s0,"Nothing found"))],512)):r.createCommentVNode("",!0),N[11]||(N[11]=r.createTextVNode()),r.createVNode(ar,{class:"ui-dropdown__contour"})])],42,Qw),N[12]||(N[12]=r.createTextVNode()),M.value?(r.openBlock(),r.createElementBlock("div",a0,r.toDisplayString(M.value),1)):y.value&&$.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",l0,r.toDisplayString($.loadingOptionsHelper),1)):$.helper?(r.openBlock(),r.createElementBlock("div",c0,r.toDisplayString($.helper),1)):r.createCommentVNode("",!0)]))}}),p0={key:0,class:"ui-progress-bar"},h0={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},f0={class:"ui-progress-bar__message flex-grow-1"},m0={class:"ui-progress-bar__percent"},g0=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(i,s)=>i.loading?(r.openBlock(),r.createElementBlock("div",p0,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:i.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",h0,[r.createElementVNode("div",f0,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",m0,r.toDisplayString(i.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),y0={class:"mi-number-field__main-wrapper d-flex"},v0={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},_0={key:0,class:"text-description"},C0=["disabled","placeholder"],w0={class:"mi-number-field__icons d-flex-column"},b0={key:0,class:"mi-number-field__hint text-description"},ms=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.ref(),l=r.useSlots(),c=r.ref();In(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var G;C=C.replace(/,/g,""),S(C)?(i("update:modelValue",+C),C.toString()!==((G=n.modelValue)==null?void 0:G.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&i("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),S(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function S(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function E(){if(!m.value){let C=0;n.modelValue===void 0?C=n.minValue?n.minValue:0:C=+(n.modelValue||0)+n.step,p.value=C.toString()}}function M(){if(!y.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function V(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?E():C.code==="ArrowDown"&&M()}const F=C=>{C.detail>1&&C.preventDefault()};return(C,G)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:C.disabled},"mi-number-field d-flex-column"]),onMousedown:F,onKeydown:G[1]||(G[1]=Q=>V(Q))},[r.createElementVNode("div",y0,[r.createVNode(ar,{class:"mi-number-field__contour"}),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("div",v0,[C.label?(r.openBlock(),r.createElementBlock("label",_0,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":G[0]||(G[0]=Q=>p.value=Q),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,C0),[[r.vModelText,p.value]])]),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",w0,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:E},G[3]||(G[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:M},G[4]||(G[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),G[8]||(G[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",b0,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),x0={class:"pl-chip__text"},_l=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var i;e.value&&(n.value=((i=e.value)==null?void 0:i.clientWidth)>=256)}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Nt),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:i.small}])},[r.createElementVNode("div",x0,[r.renderSlot(i.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),i.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>i.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>i.$emit("close"),["stop"]))},s[2]||(s[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),key:"0"}:void 0]),1024))}}),k0={class:"pl-multi-dropdown__envelope"},S0=["tabindex"],E0={class:"pl-multi-dropdown__container"},T0={class:"pl-multi-dropdown__field"},B0=["disabled","placeholder"],V0={class:"pl-multi-dropdown__append"},A0={key:0},N0={key:0,class:"required-icon"},P0={class:"pl-multi-dropdown__open-chips-container"},D0={key:0,class:"nothing-found"},F0={key:0,class:"pl-multi-dropdown__error"},R0={key:1,class:"pl-multi-dropdown__helper"},M0={name:"PlDropdownMulti"},I0=r.defineComponent({...M0,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=k=>n("update:modelValue",k),s=r.useSlots(),l=t,c=r.ref(),u=r.ref(),p=r.ref(),f=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),S=r.computed(()=>Rr(l.options).filter(k=>yl(m.value,k.value))),E=r.computed(()=>{const k=r.unref(m),O=Rr(l.options);return(f.search?O.filter(A=>{const q=f.search.toLowerCase();return A.label.toLowerCase().includes(q)?!0:typeof A.value=="string"?A.value.toLowerCase().includes(q):A.value===f.search}):[...O]).map(A=>({...A,selected:yl(k,A.value)}))}),M=r.computed(()=>l.disabled?void 0:"0"),V=()=>{f.activeOption=ro(E.value.findIndex(k=>Pt(k.value,l.modelValue)),k=>k<0?0:k)},F=k=>{var O;const A=r.unref(m);i(yl(A,k)?A.filter(q=>!Pt(q,k)):[...A,k]),f.search="",(O=c==null?void 0:c.value)==null||O.focus()},C=k=>i(r.unref(m).filter(O=>!Pt(O,k))),G=()=>{var k;return(k=p.value)==null?void 0:k.focus()},Q=()=>f.open=!f.open,I=k=>{var O,A;const q=k.relatedTarget;!((O=c.value)!=null&&O.contains(q))&&!((A=u.value)!=null&&A.contains(q))&&(f.search="",f.open=!1)},L=()=>{const k=u.value;k&&ot(k.querySelector(".hovered-item"),O=>{io(k,O)})},U=k=>{var O;const{open:A,activeOption:q}=f;if(!A){k.code==="Enter"&&(f.open=!0);return}k.code==="Escape"&&(f.open=!1,(O=c.value)==null||O.focus());const se=r.unref(E),{length:$}=se;if(!$)return;["ArrowDown","ArrowUp","Enter"].includes(k.code)&&k.preventDefault(),k.code==="Enter"&&F(se[q].value);const N=k.code==="ArrowDown"?1:k.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(q+N+$)%$,requestAnimationFrame(L)};In(c),r.watch(()=>l.modelValue,()=>V(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&L()});const T=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,k=>{if(k){const O=k.getBoundingClientRect();f.optionsHeight=O.height,window.dispatchEvent(new CustomEvent("adjust"))}}),no(c,k=>{const O=k.top+k.height+5;O+f.optionsHeight>k.clientHeight?T.top=k.top-f.optionsHeight-5+"px":T.top=O+"px",T.left=k.left+"px",T.width=k.width+"px"}),(k,O)=>(r.openBlock(),r.createElementBlock("div",k0,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:M.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:k.error,disabled:k.disabled}]),onKeydown:U,onFocusout:I},[r.createElementVNode("div",E0,[r.createElementVNode("div",T0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":O[0]||(O[0]=A=>f.search=A),type:"text",tabindex:"-1",disabled:k.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O[1]||(O[1]=A=>f.open=!0)},null,40,B0),[[r.vModelText,f.search]]),O[3]||(O[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:G},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(A,q)=>(r.openBlock(),r.createBlock(r.unref(_l),{key:q,closeable:"",small:"",onClick:O[2]||(O[2]=r.withModifiers(se=>f.open=!0,["stop"])),onClose:se=>C(A.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(A.label||A.value),1)]),_:2},1032,["onClose"]))),128))])),O[4]||(O[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(Q,["stop"])}),O[5]||(O[5]=r.createTextVNode()),r.createElementVNode("div",V0,[r.renderSlot(k.$slots,"append")])]),O[10]||(O[10]=r.createTextVNode()),k.label?(r.openBlock(),r.createElementBlock("label",A0,[k.required?(r.openBlock(),r.createElementBlock("i",N0)):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(k.label),1),O[7]||(O[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),O[11]||(O[11]=r.createTextVNode()),f.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-multi-dropdown__options",style:r.normalizeStyle(T),tabindex:"-1",onFocusout:I},[r.createElementVNode("div",P0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(A,q)=>(r.openBlock(),r.createBlock(r.unref(_l),{key:q,closeable:"",small:"",onClose:se=>C(A.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(A.label||A.value),1)]),_:2},1032,["onClose"]))),128))]),O[8]||(O[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(A,q)=>(r.openBlock(),r.createBlock(oo,{key:q,option:A,"text-item":"text","is-selected":A.selected,"is-hovered":f.activeOption==q,size:"medium","use-checkbox":"",onClick:r.withModifiers(se=>F(A.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),O[9]||(O[9]=r.createTextVNode()),E.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",D0,"Nothing found"))],36)])):r.createCommentVNode("",!0),O[12]||(O[12]=r.createTextVNode()),r.createVNode(ar,{class:"pl-multi-dropdown__contour"})])],42,S0),O[13]||(O[13]=r.createTextVNode()),k.error?(r.openBlock(),r.createElementBlock("div",F0,r.toDisplayString(k.error),1)):k.helper?(r.openBlock(),r.createElementBlock("div",R0,r.toDisplayString(k.helper),1)):r.createCommentVNode("",!0)]))}}),Cl=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:i.disabled}]),onClick:s[0]||(s[0]=l=>i.$emit("update:modelValue",!i.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>i.$emit("update:modelValue",!i.modelValue),["enter"]))},null,34))}}),L0={name:"PlCheckbox"},Au=r.defineComponent({...L0,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(i,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:i.disabled}])},[r.createVNode(Cl,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>i.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>i.$emit("update:modelValue",!i.$props.modelValue))},[r.renderSlot(i.$slots,"default")])],2)):(r.openBlock(),r.createBlock(Cl,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>i.$emit("update:modelValue",l))}),null,16))}}),O0={key:0},G0=["onClick"],z0={name:"PlCheckboxGroup"},Z0=r.defineComponent({...z0,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=c=>i.modelValue.includes(c),l=c=>{const u=i.modelValue??[];n("update:modelValue",s(c)?u.filter(p=>p!==c):[...u,c])};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",O0,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,f)=>(r.openBlock(),r.createElementBlock("div",{key:f},[r.createVNode(Cl,{disabled:c.disabled,label:p.label,"model-value":s(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,G0)]))),128))],2))}}),U0="_component_tupwt_1",$0={component:U0},W0={};function H0(t,e){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(t.$style.component)},e[0]||(e[0]=[r.createElementVNode("div",null,null,-1)]),2)}const j0={$style:$0},q0=or(W0,[["render",H0],["__cssModules",j0]]),K0={key:1,class:"pl-dialog-modal__title"},Y0={inheritAttrs:!1},wl=r.defineComponent({...Y0,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();function u(p){l.value&&document.contains(p.target)&&!l.value.contains(p.target)&&i("update:modelValue",!1)}return tt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&i("update:modelValue",!1)}),(p,f)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[r.createElementVNode("div",r.mergeProps(r.unref(c),{ref_key:"modal",ref:l,class:["pl-dialog-modal",{"has-title":r.unref(n).title,"has-content":r.unref(n).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(r.openBlock(),r.createBlock(q0,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>i("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",K0,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),f[2]||(f[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[r.renderSlot(p.$slots,"default")],2),f[3]||(f[3]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[r.renderSlot(p.$slots,"actions")],2)):r.createCommentVNode("",!0)],16)])):r.createCommentVNode("",!0)]),_:3})]))}}),J0=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),_:3}))}}),X0={key:0,class:"pl-slide-modal__title"},Q0={class:"pl-slide-modal__content"},eb={key:1,class:"pl-slide-modal__actions"},tb={name:"PlSlideModal",inheritAttrs:!1},nb=r.defineComponent({...tb,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();return ps(l,()=>{s.modelValue&&s.closeOnOutsideClick&&i("update:modelValue",!1)}),tt(document,"keydown",u=>{u.key==="Escape"&&i("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(J0,null,{default:r.withCtx(()=>[u.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:u.width}},r.unref(c),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>i("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",X0,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",Q0,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",eb,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),rb={key:0,class:"label"},ib={name:"PlToggleSwitch"},gs=r.defineComponent({...ib,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=i=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(i=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",rb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Nu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function ob(t){return r.unref(t)}const sb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function ab(t,e,n={}){const{immediate:i=!0}=n,s=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,c()}function p(...f){c(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},ob(e))}return i&&(s.value=!0,sb&&p()),Nu(u),{isPending:r.readonly(s),start:p,stop:u}}function lb(t,e,n){return r.watch(t,(i,s,l)=>{i&&e(i,s,l)},{...n,once:!1})}function cb(t,e,n){const{start:i}=ab(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),i())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),Nu(u),{isActive:s,pause:u,resume:c}}const db="[==PROGRESS==]";function ub(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function i(){var l;let c=e.value;if(c===void 0)return;const u=t.mockPlatforma??window.platforma;if(!u){console.warn("Platforma API is not available");return}for(;;){const p=await u.logDriver.readText(c.logHandle,100,c.lastOffset);if(c.error=void 0,n.errorCount=0,p.shouldUpdateHandle||c.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const f=t.progressPrefix??db,m=new TextDecoder().decode(p.data).replace(new RegExp(`${ub(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=cb(()=>i().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return lb(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,s.pause()):l!==((c=e.value)==null?void 0:c.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,s.resume())},{immediate:!0}),e}const hb={key:0},fb={key:1,class:"pl-log-view__error"},mb={name:"PlLogView"},gb=r.defineComponent({...mb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=S=>{if(S&&S.ok===!1)return S.errors.join(`
|
|
51
|
+
`)},n=t,i=pb(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var S;return((S=i.value)==null?void 0:S.error)??n.error??e(n.output)}),p=r.computed(()=>{var S;return((S=i.value)==null?void 0:S.lines)??n.value??gv(n.output)});In(c);const f=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},m=()=>{Fr(l.value,S=>{s.value&&S.scrollTo(S.scrollLeft,S.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{m()})},{immediate:!0});const y=S=>{const E=S.target;s.value=E.scrollTop+20>=E.scrollHeight-E.offsetHeight};return(S,E)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",hb,r.toDisplayString(S.label),1)):r.createCommentVNode("",!0),E[0]||(E[0]=r.createTextVNode()),r.createVNode(ar,{class:"pl-log-view__contour"}),E[1]||(E[1]=r.createTextVNode()),r.createVNode(r.unref(Ln),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:f}),E[2]||(E[2]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",fb,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:y},r.toDisplayString(p.value),545))],2))}}),yb="_component_1ukal_1",vb="_tab_1ukal_14",_b="_disabled_1ukal_27",Cb="_active_1ukal_56",wb="_topLine_1ukal_69",ai={component:yb,tab:vb,disabled:_b,active:Cb,topLine:wb},bb=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const i=r.unref(e);if(!i)return;const s=i.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Nt),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),xb={name:"PlTabs"},kb=r.defineComponent({...xb,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(ai).component,{[r.unref(ai).disabled]:s.disabled,[r.unref(ai).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createBlock(bb,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(ai).active]:s.modelValue===c.value,[r.unref(ai).disabled]:c.disabled},r.unref(ai).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>i(c.value),["enter"]),onClick:p=>i(c.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}});function Sb(t){const e=t.split("/"),n=[];for(let i=0;i<e.length;i++)n.push({index:i,name:i===0?"Root":e[i],path:e.slice(0,i+1).join("/")});return n}const Eb={class:"file-dialog"},Tb={class:"file-dialog__search"},Bb={class:"ls-container"},Vb={class:"ls-head"},Ab={class:"ls-head__breadcrumbs"},Nb=["title","onClick"],Pb={key:0,class:"icon-16 icon-chevron-right"},Db={class:"d-flex ml-auto align-center gap-12"},Fb={class:"ls-head__selected"},Rb={key:0,class:"ls-loader"},Mb={key:1,class:"ls-empty"},Ib={key:2,class:"ls-error"},Lb={class:"ls-error__message"},Ob={key:3,class:"ls-body"},Gb=["onClick"],zb=["title"],Zb=["onClick"],Ub=["title"],Pu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,i=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),c=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(T=>!T.name.startsWith("."))),u=r.computed(()=>{var T;return{modelValue:i.modelValue,dirPath:l.dirPath,storageHandle:(T=l.storageEntry)==null?void 0:T.handle}}),p=(T,k)=>{window.platforma&&l.currentLoadingPath!==k&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=k,window.platforma.lsDriver.listFiles(T,k).then(O=>{k===l.dirPath&&(l.items=Jd(O).entries.map(A=>({path:A.fullPath,name:A.name,isDir:A.type==="dir",canBeSelected:A.type==="file"&&(!i.extensions||i.extensions.some(q=>A.fullPath.endsWith(q))),handle:A.type==="file"?A.handle:void 0,selected:!1})).sort((A,q)=>A.isDir&&!q.isDir?-1:!A.isDir&&q.isDir?1:A.name.localeCompare(q.name)).map((A,q)=>({id:q,...A})),l.lastSelected=void 0)}).catch(O=>l.error=String(O)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:T,dirPath:k,modelValue:O}=u.value;T&&O&&p(T,k)},m=eu(T=>{l.dirPath=T??""},1e3),y=r.computed(()=>Sb(l.dirPath)),S=r.computed(()=>l.items.filter(T=>T.canBeSelected&&T.selected&&!T.isDir)),E=r.computed(()=>S.value.length>0),M=()=>{n("update:modelValue",!1)},V=()=>{var T;E.value&&(T=l.storageEntry)!=null&&T.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:S.value.map(k=>k.handle)}),M())},F=T=>{l.dirPath=T,l.storageEntry&&f()},C=(T,k)=>{const{shiftKey:O,metaKey:A}=T,{lastSelected:q}=l;if(T.preventDefault(),k.canBeSelected){if(i.multi||l.items.forEach(se=>se.selected=!1),k.selected=!0,!i.multi)return;!A&&!O&&l.items.forEach(se=>{se.id!==k.id&&(se.selected=!1)}),O&&q!==void 0&&l.items.forEach(se=>{hv(se.id,q,k.id)&&(se.selected=!0)}),k.selected&&(l.lastSelected=k.id)}},G=T=>{T&&!i.multi||l.items.filter(k=>k.canBeSelected).forEach(k=>{k.selected=T})},Q=()=>G(!0),I=()=>G(!1),L=()=>{if(l.error="",l.lastSelected=void 0,I(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(T=>{l.storageOptions=T.map(k=>({text:k.name,value:k})),i.autoSelectStorage&&Fr(T.find(k=>k.name==="local"||k.name.startsWith("local_disk_")&&k.initialFullPath.length>4),k=>{l.storageEntry=k,l.dirPath=k.initialFullPath})}).catch(T=>l.error=String(T))};r.watch(r.toRef(l,"storageEntry"),T=>{l.dirPath=(T==null?void 0:T.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>i.modelValue,T=>{T?L():Object.assign(l,s())},{immediate:!0}),tt(document,"keydown",T=>{i.modelValue&&T.target===document.body&&(T.metaKey&&T.code==="KeyA"&&(T.preventDefault(),Q()),T.metaKey&&T.shiftKey&&T.code==="Period"&&(T.preventDefault(),l.showHiddenItems=!l.showHiddenItems),T.code==="Enter"&&V())}),r.onUpdated(L);const U={mounted:T=>{if(T.clientWidth<T.scrollWidth){const k=T.innerText;T.innerText=k.substring(0,57)+"..."+k.substring(k.length-10)}}};return(T,k)=>(r.openBlock(),r.createBlock(r.unref(wl),{"no-content-gutters":!0,class:"split","model-value":T.modelValue,width:"688px",height:"720px","onUpdate:modelValue":M,onClick:r.withModifiers(I,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(T.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(dl),{style:{"min-width":"160px"},disabled:!E.value,onClick:r.withModifiers(V,["stop"])},{default:r.withCtx(()=>k[14]||(k[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),k[16]||(k[16]=r.createTextVNode()),r.createVNode(r.unref(pl),{"justify-center":!1,onClick:r.withModifiers(M,["stop"])},{default:r.withCtx(()=>k[15]||(k[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[k[17]||(k[17]=r.createTextVNode()),r.createElementVNode("div",Eb,[r.createElementVNode("div",Tb,[r.createVNode(r.unref(so),{modelValue:l.storageEntry,"onUpdate:modelValue":k[0]||(k[0]=O=>l.storageEntry=O),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),k[1]||(k[1]=r.createTextVNode()),r.createVNode(r.unref(fs),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),k[13]||(k[13]=r.createTextVNode()),r.createElementVNode("div",Bb,[r.createElementVNode("div",Vb,[r.createElementVNode("div",Ab,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(O,A)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:A},[r.createElementVNode("div",{title:O.path,onClick:q=>F(O.path)},r.toDisplayString(O.name),9,Nb),k[2]||(k[2]=r.createTextVNode()),O.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",Pb)):r.createCommentVNode("",!0)],64))),128))]),k[3]||(k[3]=r.createTextVNode()),r.createElementVNode("div",Db,[r.createElementVNode("span",Fb,"Selected: "+r.toDisplayString(S.value.length),1)])]),k[12]||(k[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Rb,k[4]||(k[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",Ib,[k[6]||(k[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),k[7]||(k[7]=r.createTextVNode()),r.createElementVNode("div",Lb,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Ob,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,O=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:O.id},[O.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:A=>F(O.path)},[k[8]||(k[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),k[9]||(k[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:O.name},[r.createTextVNode(r.toDisplayString(O.name),1)],8,zb)),[[U]])],8,Gb)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:O.canBeSelected,selected:O.selected}),onClick:r.withModifiers(A=>C(A,O),["stop"])},[k[10]||(k[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),k[11]||(k[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:O.name},[r.createTextVNode(r.toDisplayString(O.name),1)],8,Ub)),[[U]])],10,Zb))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Mb,k[5]||(k[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),k[18]||(k[18]=r.createTextVNode())]),_:1},8,["model-value"]))}});var Ie;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var bl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(bl||(bl={}));const oe=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),lr=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},X=Ie.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$b=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Lt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Lt.create=t=>new Lt(t);const li=(t,e)=>{let n;switch(t.code){case X.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case X.invalid_union:n="Invalid input";break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case X.invalid_arguments:n="Invalid function arguments";break;case X.invalid_return_type:n="Invalid function return type";break;case X.invalid_date:n="Invalid date";break;case X.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case X.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case X.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case X.custom:n="Invalid input";break;case X.invalid_intersection_types:n="Intersection results could not be merged";break;case X.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case X.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let Du=li;function Wb(t){Du=t}function ys(){return Du}const vs=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Hb=[];function re(t,e){const n=ys(),i=vs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===li?void 0:li].filter(s=>!!s)});t.common.issues.push(i)}class yt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return yt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),_s=t=>({status:"dirty",value:t}),kt=t=>({status:"valid",value:t}),xl=t=>t.status==="aborted",kl=t=>t.status==="dirty",ao=t=>t.status==="valid",lo=t=>typeof Promise<"u"&&t instanceof Promise;function Cs(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Fu(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ue||(ue={}));var co,uo;class Tn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ru=(t,e)=>{if(ao(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Lt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,c)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:(u=f??i)!==null&&u!==void 0?u:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:c.defaultError}},description:s}}class Ve{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return lr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:lr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:lr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(lo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Ru(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lr(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(lo(s)?s:Promise.resolve(s));return Ru(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:X.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new cn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Vn.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ln.create(this,this._def)}promise(){return pi.create(this,this._def)}or(e){return mo.create([this,e],this._def)}and(e){return go.create(this,e,this._def)}transform(e){return new cn({...Ee(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new wo({...Ee(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Tl({typeName:ve.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new bo({...Ee(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return xo.create(this,e)}readonly(){return ko.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jb=/^c[^\s-]{8,}$/i,qb=/^[0-9a-z]+$/,Kb=/^[0-9A-HJKMNP-TV-Z]{26}$/,Yb=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jb=/^[a-z0-9_-]{21}$/i,Xb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Qb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Sl;const tx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nx=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,rx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Mu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ix=new RegExp(`^${Mu}$`);function Iu(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ox(t){return new RegExp(`^${Iu(t)}$`)}function Lu(t){let e=`${Mu}T${Iu(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function sx(t,e){return!!((e==="v4"||!e)&&tx.test(t)||(e==="v6"||!e)&&nx.test(t))}class an extends Ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.string,received:s.parsedType}),Ce}const n=new yt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(e,i),l?re(i,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&re(i,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Qb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"email",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Sl||(Sl=new RegExp(ex,"u")),Sl.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"emoji",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Yb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"uuid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Jb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"nanoid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")jb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")qb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid2",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Kb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ulid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),re(i,{validation:"url",code:X.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"regex",code:X.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Lu(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ix.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ox(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Xb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"duration",code:X.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?sx(e.data,s.version)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ip",code:X.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?rx.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"base64",code:X.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:X.invalid_string,...ue.errToObj(i)})}_addCheck(e){return new an({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ue.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ue.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ue.errToObj(n)})}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new an({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new an({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new an({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}an.create=t=>{var e;return new an({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function ax(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class cr extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.number,received:s.parsedType}),Ce}let n;const i=new yt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?ax(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_finite,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,i,s){return new cr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new cr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ie.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}cr.create=t=>new cr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class dr extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==oe.bigint){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.bigint,received:s.parsedType}),Ce}let n;const i=new yt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,i,s){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}dr.create=t=>{var e;return new dr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class po extends Ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.boolean,received:n.parsedType}),Ce}return kt(e.data)}}po.create=t=>new po({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Mr extends Ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_date}),Ce}const n=new yt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Mr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Mr.create=t=>new Mr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ee(t)});class ws extends Ve{_parse(e){if(this._getType(e)!==oe.symbol){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.symbol,received:n.parsedType}),Ce}return kt(e.data)}}ws.create=t=>new ws({typeName:ve.ZodSymbol,...Ee(t)});class ho extends Ve{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.undefined,received:n.parsedType}),Ce}return kt(e.data)}}ho.create=t=>new ho({typeName:ve.ZodUndefined,...Ee(t)});class fo extends Ve{_parse(e){if(this._getType(e)!==oe.null){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.null,received:n.parsedType}),Ce}return kt(e.data)}}fo.create=t=>new fo({typeName:ve.ZodNull,...Ee(t)});class ci extends Ve{constructor(){super(...arguments),this._any=!0}_parse(e){return kt(e.data)}}ci.create=t=>new ci({typeName:ve.ZodAny,...Ee(t)});class Ir extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kt(e.data)}}Ir.create=t=>new Ir({typeName:ve.ZodUnknown,...Ee(t)});class On extends Ve{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.never,received:n.parsedType}),Ce}}On.create=t=>new On({typeName:ve.ZodNever,...Ee(t)});class bs extends Ve{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.void,received:n.parsedType}),Ce}return kt(e.data)}}bs.create=t=>new bs({typeName:ve.ZodVoid,...Ee(t)});class ln extends Ve{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==oe.array)return re(n,{code:X.invalid_type,expected:oe.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(re(n,{code:c?X.too_big:X.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:X.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:X.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Tn(n,c,n.path,u)))).then(c=>yt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Tn(n,c,n.path,u)));return yt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new ln({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new ln({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new ln({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}ln.create=(t,e)=>new ln({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ee(e)});function di(t){if(t instanceof Xe){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Vn.create(di(i))}return new Xe({...t._def,shape:()=>e})}else return t instanceof ln?new ln({...t._def,type:di(t.element)}):t instanceof Vn?Vn.create(di(t.unwrap())):t instanceof hr?hr.create(di(t.unwrap())):t instanceof Bn?Bn.create(t.items.map(e=>di(e))):t}class Xe extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ie.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==oe.object){const p=this._getOrReturnCtx(e);return re(p,{code:X.invalid_type,expected:oe.object,received:p.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof On&&this._def.unknownKeys==="strip"))for(const p in i.data)l.includes(p)||c.push(p);const u=[];for(const p of l){const f=s[p],m=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Tn(i,m,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof On){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(p==="strict")c.length>0&&(re(i,{code:X.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const f of c){const m=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Tn(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>yt.mergeObjectSync(n,p)):yt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new Xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ue.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Xe({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Xe({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Xe({...this._def,shape:()=>n})}deepPartial(){return di(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Xe({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Vn;)s=s._def.innerType;n[i]=s}}),new Xe({...this._def,shape:()=>n})}keyof(){return Ou(Ie.objectKeys(this.shape))}}Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:On.create(),typeName:ve.ZodObject,...Ee(e)}),Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:On.create(),typeName:ve.ZodObject,...Ee(e)}),Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:On.create(),typeName:ve.ZodObject,...Ee(e)});class mo extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Lt(u.ctx.common.issues));return re(n,{code:X.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Lt(p));return re(n,{code:X.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}mo.create=(t,e)=>new mo({options:t,typeName:ve.ZodUnion,...Ee(e)});const ur=t=>t instanceof vo?ur(t.schema):t instanceof cn?ur(t.innerType()):t instanceof _o?[t.value]:t instanceof pr?t.options:t instanceof Co?Ie.objectValues(t.enum):t instanceof wo?ur(t._def.innerType):t instanceof ho?[void 0]:t instanceof fo?[null]:t instanceof Vn?[void 0,...ur(t.unwrap())]:t instanceof hr?[null,...ur(t.unwrap())]:t instanceof Tl||t instanceof ko?ur(t.unwrap()):t instanceof bo?ur(t._def.innerType):[];class xs extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return re(n,{code:X.invalid_type,expected:oe.object,received:n.parsedType}),Ce;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=ur(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new xs({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(i)})}}function El(t,e){const n=lr(t),i=lr(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&i===oe.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=El(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=El(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class go extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(xl(l)||xl(c))return Ce;const u=El(l.value,c.value);return u.valid?((kl(l)||kl(c))&&n.dirty(),{status:n.value,value:u.data}):(re(i,{code:X.invalid_intersection_types}),Ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}go.create=(t,e,n)=>new go({left:t,right:e,typeName:ve.ZodIntersection,...Ee(n)});class Bn extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return re(i,{code:X.invalid_type,expected:oe.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return re(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(re(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Tn(i,l,i.path,c)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>yt.mergeArray(n,l)):yt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Bn({...this._def,rest:e})}}Bn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:t,typeName:ve.ZodTuple,rest:null,...Ee(e)})};class yo extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return re(i,{code:X.invalid_type,expected:oe.object,received:i.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new Tn(i,u,i.path,u)),value:c._parse(new Tn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?yt.mergeObjectAsync(n,s):yt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ve?new yo({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ee(i)}):new yo({keyType:an.create(),valueType:e,typeName:ve.ZodRecord,...Ee(n)})}}class ks extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return re(i,{code:X.invalid_type,expected:oe.map,received:i.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new Tn(i,u,i.path,[f,"key"])),value:l._parse(new Tn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ks.create=(t,e,n)=>new ks({valueType:e,keyType:t,typeName:ve.ZodMap,...Ee(n)});class Lr extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return re(i,{code:X.invalid_type,expected:oe.set,received:i.parsedType}),Ce;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(re(i,{code:X.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(re(i,{code:X.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new Tn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Lr({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new Lr({...this._def,maxSize:{value:e,message:ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Lr.create=(t,e)=>new Lr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ee(e)});class ui extends Ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.function)return re(n,{code:X.invalid_type,expected:oe.function,received:n.parsedType}),Ce;function i(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),li].filter(f=>!!f),issueData:{code:X.invalid_arguments,argumentsError:p}})}function s(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),li].filter(f=>!!f),issueData:{code:X.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof pi){const u=this;return kt(async function(...p){const f=new Lt([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(S=>{throw f.addIssue(s(y,S)),f})})}else{const u=this;return kt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Lt([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new Lt([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ui({...this._def,args:Bn.create(e).rest(Ir.create())})}returns(e){return new ui({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new ui({args:e||Bn.create([]).rest(Ir.create()),returns:n||Ir.create(),typeName:ve.ZodFunction,...Ee(i)})}}class vo extends Ve{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}vo.create=(t,e)=>new vo({getter:t,typeName:ve.ZodLazy,...Ee(e)});class _o extends Ve{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}_o.create=(t,e)=>new _o({value:t,typeName:ve.ZodLiteral,...Ee(e)});function Ou(t,e){return new pr({values:t,typeName:ve.ZodEnum,...Ee(e)})}class pr extends Ve{constructor(){super(...arguments),co.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{expected:Ie.joinValues(i),received:n.parsedType,code:X.invalid_type}),Ce}if(Cs(this,co)||Fu(this,co,new Set(this._def.values)),!Cs(this,co).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{received:n.data,code:X.invalid_enum_value,options:i}),Ce}return kt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pr.create(e,{...this._def,...n})}exclude(e,n=this._def){return pr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}co=new WeakMap,pr.create=Ou;class Co extends Ve{constructor(){super(...arguments),uo.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){const s=Ie.objectValues(n);return re(i,{expected:Ie.joinValues(s),received:i.parsedType,code:X.invalid_type}),Ce}if(Cs(this,uo)||Fu(this,uo,new Set(Ie.getValidEnumValues(this._def.values))),!Cs(this,uo).has(e.data)){const s=Ie.objectValues(n);return re(i,{received:i.data,code:X.invalid_enum_value,options:s}),Ce}return kt(e.data)}get enum(){return this._def.values}}uo=new WeakMap,Co.create=(t,e)=>new Co({values:t,typeName:ve.ZodNativeEnum,...Ee(e)});class pi extends Ve{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return re(n,{code:X.invalid_type,expected:oe.promise,received:n.parsedType}),Ce;const i=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return kt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}pi.create=(t,e)=>new pi({type:t,typeName:ve.ZodPromise,...Ee(e)});class cn extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{re(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?_s(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?_s(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ao(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>ao(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Ie.assertNever(s)}}cn.create=(t,e,n)=>new cn({schema:t,typeName:ve.ZodEffects,effect:e,...Ee(n)}),cn.createWithPreprocess=(t,e,n)=>new cn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ee(n)});class Vn extends Ve{_parse(e){return this._getType(e)===oe.undefined?kt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vn.create=(t,e)=>new Vn({innerType:t,typeName:ve.ZodOptional,...Ee(e)});class hr extends Ve{_parse(e){return this._getType(e)===oe.null?kt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:ve.ZodNullable,...Ee(e)});class wo extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}wo.create=(t,e)=>new wo({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class bo extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return lo(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Lt(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}bo.create=(t,e)=>new bo({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Ss extends Ve{_parse(e){if(this._getType(e)!==oe.nan){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Ss.create=t=>new Ss({typeName:ve.ZodNaN,...Ee(t)});const lx=Symbol("zod_brand");class Tl extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class xo extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),_s(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new xo({in:e,out:n,typeName:ve.ZodPipeline})}}class ko extends Ve{_parse(e){const n=this._def.innerType._parse(e),i=s=>(ao(s)&&(s.value=Object.freeze(s.value)),s);return lo(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}ko.create=(t,e)=>new ko({innerType:t,typeName:ve.ZodReadonly,...Ee(e)});function Gu(t,e={},n){return t?ci.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ci.create()}const cx={object:Xe.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const dx=(t,e={message:`Input not instance of ${t.name}`})=>Gu(n=>n instanceof t,e),zu=an.create,Zu=cr.create,ux=Ss.create,px=dr.create,Uu=po.create,hx=Mr.create,fx=ws.create,mx=ho.create,gx=fo.create,yx=ci.create,vx=Ir.create,_x=On.create,Cx=bs.create,wx=ln.create,bx=Xe.create,xx=Xe.strictCreate,kx=mo.create,Sx=xs.create,Ex=go.create,Tx=Bn.create,Bx=yo.create,Vx=ks.create,Ax=Lr.create,Nx=ui.create,Px=vo.create,Dx=_o.create,Fx=pr.create,Rx=Co.create,Mx=pi.create,$u=cn.create,Ix=Vn.create,Lx=hr.create,Ox=cn.createWithPreprocess,Gx=xo.create;var Es=Object.freeze({__proto__:null,defaultErrorMap:li,setErrorMap:Wb,getErrorMap:ys,makeIssue:vs,EMPTY_PATH:Hb,addIssueToContext:re,ParseStatus:yt,INVALID:Ce,DIRTY:_s,OK:kt,isAborted:xl,isDirty:kl,isValid:ao,isAsync:lo,get util(){return Ie},get objectUtil(){return bl},ZodParsedType:oe,getParsedType:lr,ZodType:Ve,datetimeRegex:Lu,ZodString:an,ZodNumber:cr,ZodBigInt:dr,ZodBoolean:po,ZodDate:Mr,ZodSymbol:ws,ZodUndefined:ho,ZodNull:fo,ZodAny:ci,ZodUnknown:Ir,ZodNever:On,ZodVoid:bs,ZodArray:ln,ZodObject:Xe,ZodUnion:mo,ZodDiscriminatedUnion:xs,ZodIntersection:go,ZodTuple:Bn,ZodRecord:yo,ZodMap:ks,ZodSet:Lr,ZodFunction:ui,ZodLazy:vo,ZodLiteral:_o,ZodEnum:pr,ZodNativeEnum:Co,ZodPromise:pi,ZodEffects:cn,ZodTransformer:cn,ZodOptional:Vn,ZodNullable:hr,ZodDefault:wo,ZodCatch:bo,ZodNaN:Ss,BRAND:lx,ZodBranded:Tl,ZodPipeline:xo,ZodReadonly:ko,custom:Gu,Schema:Ve,ZodSchema:Ve,late:cx,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>an.create({...t,coerce:!0}),number:t=>cr.create({...t,coerce:!0}),boolean:t=>po.create({...t,coerce:!0}),bigint:t=>dr.create({...t,coerce:!0}),date:t=>Mr.create({...t,coerce:!0})},any:yx,array:wx,bigint:px,boolean:Uu,date:hx,discriminatedUnion:Sx,effect:$u,enum:Fx,function:Nx,instanceof:dx,intersection:Ex,lazy:Px,literal:Dx,map:Vx,nan:ux,nativeEnum:Rx,never:_x,null:gx,nullable:Lx,number:Zu,object:bx,oboolean:()=>Uu().optional(),onumber:()=>Zu().optional(),optional:Ix,ostring:()=>zu().optional(),pipeline:Gx,preprocess:Ox,promise:Mx,record:Bx,set:Ax,strictObject:xx,string:zu,symbol:fx,transformer:$u,tuple:Tx,undefined:mx,union:kx,unknown:vx,void:Cx,NEVER:Ce,ZodIssueCode:X,quotelessJson:$b,ZodError:Lt});function zx(t){throw new Error("Unexpected object: "+t)}const Wu="upload://upload/",Hu="index://index/";function Zx(t){return t.startsWith(Wu)}function Ux(t){return t.startsWith(Hu)}function $x(t){if(Ux(t)){const e=t.slice(Hu.length);return JSON.parse(decodeURIComponent(e)).path}else if(Zx(t)){const e=t.slice(Wu.length);return JSON.parse(decodeURIComponent(e)).localPath}zx(t)}Es.object({__isRef:Es.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Es.string().describe("Upstream block id"),name:Es.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Wx(t){return t.replace(/^.*[\\/]/,"")}const Hx={key:0,ref:"label"},jx={key:0,class:"required-icon"},qx=["data-placeholder"],Kx={key:5,class:"pl-file-input__stats"},Yx={key:0,class:"pl-file-input__error"},Jx={key:1,class:"upl-file-input__helper"},ju=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1}),i=r.useSlots(),s=e,l=t,c=r.computed(()=>{if(l.modelValue)try{const C=$x(l.modelValue).trim();return l.showFilenameOnly?Wx(C):C}catch(C){return console.error(C),l.modelValue}return""}),u=r.computed(()=>l.progress&&!l.progress.done),p=r.computed(()=>l.progress&&l.progress.done),f=r.computed(()=>l.error),m=r.computed(()=>l.error),y=r.computed(()=>{const{status:C,done:G}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!G?tl(C.bytesProcessed,{})+" / "+tl(C.bytesTotal,{}):tl(C.bytesTotal,{})}),S=r.computed(()=>{var C;const{progress:G}=l;return G?{width:G.done?"100%":Math.round((((C=G.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),E=()=>{n.fileDialogOpen=!0},M=C=>{C.files.length&&s("update:modelValue",C.files[0])},V=()=>s("update:modelValue",void 0),F=r.ref();return l.cellStyle||In(F),(C,G)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!C.cellStyle,"has-file":!!c.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:F,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(E,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(S.value)},null,4),G[3]||(G[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",Hx,[C.required?(r.openBlock(),r.createElementBlock("i",jx)):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),G[2]||(G[2]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),G[4]||(G[4]=r.createTextVNode()),f.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:1,name:"restart"})):u.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:2,name:"cloud-upload"})):p.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Ln),{key:4,name:"paper-clip"})),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(E,["stop"])},r.toDisplayString(c.value),9,qx),G[6]||(G[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",Kx,r.toDisplayString(y.value),1)):r.createCommentVNode("",!0),G[7]||(G[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(Ln),{key:6,name:"close",onClick:r.withModifiers(V,["stop"])})):r.createCommentVNode("",!0),G[8]||(G[8]=r.createTextVNode()),r.createVNode(ar,{class:"pl-file-input__contour"})],34),G[9]||(G[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",Yx,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",Jx,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),G[10]||(G[10]=r.createTextVNode()),r.createVNode(r.unref(Pu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":G[0]||(G[0]=Q=>n.fileDialogOpen=Q),extensions:C.extensions,title:C.fileDialogTitle,"onImport:files":M},null,8,["modelValue","extensions","title"])],64))}}),Xx={class:"pl-notification-alert__wrapper d-flex"},Qx={class:"pl-notification-alert__content flex-grow-1"},ek={key:0,class:"pl-notification-alert__close"},tk={key:0,class:"pl-notification-alert__actions d-flex"},qu=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function i(){e.closable&&(n.value=!1)}return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",Xx,[r.createElementVNode("div",Qx,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",ek,[r.createVNode(r.unref(pl),{icon:"close",onClick:i})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",tk,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Ku=r.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const n=e,i=r.ref(!1),s=r.computed(()=>i.value?"mask-clipboard-copied":"mask-clipboard");function l(){i.value=!0,setTimeout(()=>i.value=!1,700),n("copy")}return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.value,"mask-24"]),onClick:l},null,2))}}),nk=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,i)=>r.renderSlot(n.$slots,"default")}});function vt(t,e,n){return e>t?e:t>n?n:t}const Bl=t=>r.computed(()=>{const e=[100],{min:n,max:i,step:s}=t.value;let l=n;for(;l<i;){l+=s;const c=(1-(vt(l,n,i)-n)/(i-n))*100;e.push(c)}return e}),rk={class:"ui-slider__wrapper"},ik={class:"ui-slider__label-section"},ok={key:0,class:"text-s"},sk={key:1,class:"ui-slider__value-static text-s"},ak={class:"ui-slider__base"},lk={class:"ui-slider__container"},ck={class:"ui-slider__container ui-slider__container-thumb"},dk={class:"ui-slider__input-wrapper d-flex"},uk=["value"],pk={key:0,class:"ui-slider__error"},Yu=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const L=s.modelValue;return Number.isFinite(L)?L<s.min?`Min value: ${s.min}`:L>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),y=Bl(m),S=r.computed(()=>(u.value-s.min)/c.value),E=r.computed(()=>({right:Math.ceil((1-S.value)*100)+"%"})),M=r.computed(()=>({right:`calc(${Math.ceil((1-S.value)*100)}%) `})),V=r.ref(),F=r.ref();r.watch(()=>s.modelValue,L=>{p.value=L});function C(L){const U=vt(L,s.min,s.max);return Math.round((U+Number.EPSILON)*(1/s.step))/(1/s.step)}sr(F,L=>{var U;ot((U=r.unref(V))==null?void 0:U.getBoundingClientRect(),T=>{const{dx:k}=L;l.deltaValue=k/T.width*c.value,p.value=C(vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),L.stop&&(i("update:modelValue",C(u.value)),l.deltaValue=0)})});function G(L){i("update:modelValue",C(L))}function Q(L){G(+L.target.value)}function I(L){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(L.code)&&L.preventDefault();const U=L.code==="ArrowUp"||L.code==="ArrowRight"?s.step*1:L.code==="ArrowDown"||L.code==="ArrowLeft"?s.step*-1:0;G(s.modelValue+U)}return(L,U)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",rk,[r.createElementVNode("div",ik,[L.label?(r.openBlock(),r.createElementBlock("label",ok,[r.createElementVNode("span",null,r.toDisplayString(L.label),1),U[1]||(U[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(L.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),U[2]||(U[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",sk,r.toDisplayString(p.value)+r.toDisplayString(L.measure),1)):r.createCommentVNode("",!0)]),U[6]||(U[6]=r.createTextVNode()),r.createElementVNode("div",ak,[r.createElementVNode("div",lk,[r.createElementVNode("div",{ref_key:"barRef",ref:V,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(E.value)},null,4)],512)]),U[5]||(U[5]=r.createTextVNode()),r.createElementVNode("div",ck,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(T,k)=>(r.openBlock(),r.createElementBlock("div",{key:k,style:r.normalizeStyle({right:`${T}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),U[4]||(U[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:F,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(M.value),onKeydown:I},U[3]||(U[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),U[7]||(U[7]=r.createTextVNode()),r.createElementVNode("div",dk,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:U[0]||(U[0]=T=>Q(T))},null,40,uk)):r.createCommentVNode("",!0)])],2),U[8]||(U[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",pk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function hk(t,e=null,n=null){function i(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const y=f-p-m,S=p>e?e:0,E=y>e?m-e-S:m;return`linear-gradient(
|
|
52
52
|
to bottom,
|
|
53
53
|
transparent,
|
|
54
|
-
black ${k}px,
|
|
55
54
|
black ${S}px,
|
|
55
|
+
black ${E}px,
|
|
56
56
|
transparent 100%
|
|
57
|
-
)`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const
|
|
57
|
+
)`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const y=f-p-m,S=p>n?n:0,E=y>n?m-n-S:m;return`linear-gradient(
|
|
58
58
|
to right,
|
|
59
59
|
transparent,
|
|
60
|
-
black ${k}px,
|
|
61
60
|
black ${S}px,
|
|
61
|
+
black ${E}px,
|
|
62
62
|
transparent 100%
|
|
63
|
-
)`}function l(){const u=t.value;if(!u)return;const p=[i(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const c=el(l);r.onMounted(l),et(window,"scroll",c,!0),et(window,"resize",c,!0)}function Hu(t,e){gu(()=>{it(r.unref(t),n=>{yu(n,()=>e(n))})}),r.onUnmounted(()=>{it(r.unref(t),n=>{vu(n)})})}const ur={item:"sortable__item",animate:"sortable__animate"},wo=t=>t.getBoundingClientRect().y,ju=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},pk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function hk(t,e){const n={item:void 0,options(){var S;return[...((S=t.value)==null?void 0:S.children)??[]]}},i=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(S){const F=e.handle?this.querySelector(e.handle):null;F&&!F.contains(S.target)||(this.classList.remove(ur.animate),this.classList.add(ur.item),n.item={el:this,y:S.y,dy:0,orderChanged:!1})}function u(S){const F=n.options();return F.slice(0,F.indexOf(S))}function p(S){const F=n.options();return F.slice(F.indexOf(S)+1)}function f(S,F){const T=n.options().filter(C=>C!==F),N=T.indexOf(S);return T.splice(N,0,F),T}function m(S,F){const T=n.options().filter(C=>C!==F),N=T.indexOf(S);return T.splice(N+1,0,F),T}function v(S,F){S.dy=F-S.y,S.el.style.setProperty("transform",`translateY(${S.dy}px)`)}function k(S){var F;if(!n.item)return;const{el:T}=n.item;if(!T.isConnected){n.item=void 0;return}const N=S.map(U=>wo(U)),C=wo(T);(F=t.value)==null||F.replaceChildren(...S);const I=wo(T),Q=S.map(U=>wo(U)),M=[];for(let U=0;U<Q.length;U++){const z=S[U];if(z===n.item.el)continue;const P=Q[U],Z=N[U]-P;z.style.transform=`translateY(${Z}px)`,M.push(z)}const R=I-C;n.item.y=n.item.y+R,n.item.dy=n.item.dy-R,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),M.forEach(U=>U.classList.remove(ur.animate)),requestAnimationFrame(function(){M.forEach(U=>{U.classList.add(ur.animate),U.style.transform="",U.addEventListener("transitionend",()=>{U.classList.remove(ur.animate)})})})}et(window,"mousemove",S=>{if(!n.item)return;const{el:F}=n.item;v(n.item,S.y);const T=wo(n.item.el),N=pk(n.item.el),C=u(F),I=p(F);C.forEach(Q=>{const M=ju(Q);T+s<M&&k(f(Q,F))}),I.forEach(Q=>{const M=ju(Q);N-s>M&&k(m(Q,F))})}),et(window,"mouseup",()=>{if(!n.item)return;const{el:S,orderChanged:F}=n.item;S.classList.add(ur.animate),S.style.removeProperty("transform"),S.addEventListener("transitionend",()=>{S.classList.remove(ur.animate,ur.item)}),setTimeout(()=>{if(!F)return;const T=n.options().map(C=>Number(C.getAttribute("data-index"))),N=t.value;if(N){for(const C of n.options())N.removeChild(C);i.value.forEach(C=>{N.appendChild(C)})}e.onChange(T)},l),n.item=void 0}),r.watchEffect(()=>{i.value.forEach((S,F)=>{S.removeEventListener("mousedown",c),S.addEventListener("mousedown",c),S.setAttribute("data-index",String(F))})})}function fk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function mk(t,e,n){const i=r.reactive({data:qa.deepClone(e(t.value)),changed:!1});return r.watch(()=>i.data,s=>{i.changed?n(qa.deepClone(s)):i.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(i,{data:qa.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),i}function gk(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(i){this.error=i}finally{this.isLoading=!1}},debounce(n,i=1e3){return Yd(()=>{const s=n();this.run(...s).catch(console.error)},i)}});return e.run=e.run.bind(e),e}function yk(t,e){function n(c,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-c.x}px, ${u.y-c.y}px)`;p.style.setProperty("transform",f),e(u)}function i(c){const u=p=>n(c,p);document.addEventListener("mousemove",u),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",u),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function s(){var c;(c=r.unref(t))==null||c.addEventListener("mousedown",i)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",i)}r.onMounted(s),r.onUnmounted(l)}const vk={class:"ui-slider__wrapper"},_k={class:"ui-slider__label-section"},Ck={key:0,class:"text-s"},wk={class:"ui-slider__base"},bk={class:"ui-slider__container"},xk={class:"ui-slider__container ui-slider__container-thumb"},kk=["data-percent"],Sk=["data-percent"],Ek=["data-percent"],Tk={key:0,class:"ui-slider__error"},Bk=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),v=r.computed(()=>s),k=xl(v),S=r.computed(()=>gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),F=r.computed(()=>gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),T=r.computed(()=>gt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),N=r.computed(()=>{const G=s.modelValue;if(!(Array.isArray(G)&&G.length===3&&G.every(ve=>Number.isFinite(ve))))return"Expected model [number, number, number]";const Y=[];return[...s.modelValue].forEach(ve=>{ve>s.max&&Y.push(`Max model value must be lower than max props ${s.max}.`),ve<s.min&&Y.push("Min model value must be greater than max props.")}),Y.length>0?Y.join(" "):s.error}),C=r.computed(()=>(S.value-s.min)/m.value),I=r.computed(()=>(F.value-s.min)/m.value),Q=r.computed(()=>(T.value-s.min)/m.value),M=r.computed(()=>O()),R=r.computed(()=>({right:M.value[0]+"%",left:100-M.value[2]+"%"})),U=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),z=r.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"})),P=r.computed(()=>({right:Math.ceil((1-Q.value)*100)+"%"}));rr(u,G=>{var Y;it((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),ve=>{const{dx:xe}=G;l.deltaValue1=xe/ve.width*m.value,u.value&&Z(u.value,s.modelValue[0],l.deltaValue1),G.stop&&(ue([K(S.value),K(F.value),K(T.value)]),l.deltaValue1=0)})}),rr(p,G=>{var Y;it((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),ve=>{const{dx:xe}=G;l.deltaValue2=xe/ve.width*m.value,p.value&&Z(p.value,s.modelValue[1],l.deltaValue2),G.stop&&(ue([K(S.value),K(F.value),K(T.value)]),l.deltaValue2=0)})}),rr(f,G=>{var Y;it((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),ve=>{const{dx:xe}=G;l.deltaValue3=xe/ve.width*m.value,f.value&&Z(f.value,s.modelValue[2],l.deltaValue3),G.stop&&(ue([K(S.value),K(F.value),K(T.value)]),l.deltaValue3=0)})});function Z(G,Y,ve){const xe=K(gt((Y??0)+ve,s.min,s.max));G.dataset.percent=`${xe}${s.measure}`,W()}function O(){const G=Math.ceil((1-C.value)*100),Y=Math.ceil((1-I.value)*100),ve=Math.ceil((1-Q.value)*100);return[G,Y,ve].sort((xe,Gt)=>xe-Gt)}function K(G){const Y=gt(G,s.min,s.max);return Math.round((Y+Number.EPSILON)*(1/s.step))/(1/s.step)}function ue(G){i("update:modelValue",G)}function W(){const G=Number(U.value.right.substring(0,U.value.right.length-1)),Y=Number(z.value.right.substring(0,z.value.right.length-1)),ve=Number(P.value.right.substring(0,P.value.right.length-1)),xe=[{r:G,th:u},{r:Y,th:p},{r:ve,th:f}].sort((Gt,jt)=>Gt.r-jt.r);xe[0].th.value&&(xe[0].th.value.dataset.hint="high"),xe[1].th.value&&(xe[1].th.value.dataset.hint="mid"),xe[2].th.value&&(xe[2].th.value.dataset.hint="low")}function A(G,Y){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const ve=G.code==="ArrowUp"||G.code==="ArrowRight"?s.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?s.step*-1:0,xe=[...s.modelValue];xe[Y]=gt(xe[Y]+ve,s.min,s.max),ue(xe),W()}return r.onMounted(()=>{W()}),(G,Y)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",vk,[r.createElementVNode("div",_k,[G.label?(r.openBlock(),r.createElementBlock("label",Ck,[r.createElementVNode("span",null,r.toDisplayString(G.label),1),Y[3]||(Y[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(G.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),Y[11]||(Y[11]=r.createTextVNode()),r.createElementVNode("div",wk,[r.createElementVNode("div",bk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(R.value)},null,4)],512)]),Y[10]||(Y[10]=r.createTextVNode()),r.createElementVNode("div",xk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(k),(ve,xe)=>(r.openBlock(),r.createElementBlock("div",{key:xe,style:r.normalizeStyle({right:`${ve}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Y[7]||(Y[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(U.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:Y[0]||(Y[0]=ve=>A(ve,0))},Y[4]||(Y[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,kk),Y[8]||(Y[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(z.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:Y[1]||(Y[1]=ve=>A(ve,1))},Y[5]||(Y[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Sk),Y[9]||(Y[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(P.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:Y[2]||(Y[2]=ve=>A(ve,2))},Y[6]||(Y[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Ek)])])]),Y[12]||(Y[12]=r.createTextVNode()),Y[13]||(Y[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),Y[14]||(Y[14]=r.createTextVNode()),N.value?(r.openBlock(),r.createElementBlock("div",Tk,r.toDisplayString(N.value),1)):r.createCommentVNode("",!0)],2))}}),Ak={class:"ui-input-range__separator"},Pk=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,i=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),u=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>u.value,m=>(s.left=m.left)&&(s.right=m.right));function p(){i("update:modelValue",[+s.left,+s.right]),i("change",[+s.left,+s.right])}function f(m,v){const k=v.target.value;/^[0-9]{0,2}$/.test(k)?m?s.left=+k:s.right=+k:m?s.left=+k.slice(0,k.length-1):s.right=+k.slice(0,k.length-1)}return(m,v)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":v[0]||(v[0]=k=>u.value.left=k),class:"text-s",type:"text",onChange:p,onFocus:v[1]||(v[1]=k=>l.value=!0),onFocusout:v[2]||(v[2]=k=>l.value=!1),onInput:v[3]||(v[3]=k=>f(!0,k))},null,544),[[r.vModelText,u.value.left]]),v[8]||(v[8]=r.createTextVNode()),r.createElementVNode("div",Ak,r.toDisplayString(n.separator),1),v[9]||(v[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":v[4]||(v[4]=k=>u.value.right=k),class:"text-s",type:"text",onChange:p,onFocus:v[5]||(v[5]=k=>l.value=!0),onFocusout:v[6]||(v[6]=k=>l.value=!1),onInput:v[7]||(v[7]=k=>f(!1,k))},null,544),[[r.vModelText,u.value.right]])],16))}}),Vk={class:"ui-slider__wrapper"},Nk={class:"ui-slider__label-section"},Dk={key:0,class:"text-s"},Fk={key:1,class:"ui-slider__value-static text-s"},Rk={class:"ui-slider__base"},Mk={class:"ui-slider__container"},Ik={class:"ui-slider__container ui-slider__container-thumb"},Lk={class:"ui-slider__input-wrapper d-flex"},Ok={key:0,class:"ui-slider__error"},Gk=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),v=r.ref(s.modelValue[1]),k=r.computed(()=>s),S=xl(k),F=r.computed(()=>[m.value,v.value].sort((W,A)=>W-A).join("-")),T=r.computed(()=>s.max-s.min),N=r.computed(()=>gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),I=r.computed(()=>{const W=s.modelValue;return Array.isArray(W)&&W.length===2&&W.every(A=>Number.isFinite(A))?s.error:"Expected model [number, number]"}),Q=r.computed(()=>(N.value-s.min)/T.value),M=r.computed(()=>(C.value-s.min)/T.value),R=r.computed(()=>Z()),U=r.computed(()=>({right:R.value[0]+"%",left:100-R.value[1]+"%"})),z=r.computed(()=>({right:Math.ceil((1-Q.value)*100)+"%"})),P=r.computed(()=>({right:Math.ceil((1-M.value)*100)+"%"}));r.watch(()=>s.modelValue,W=>{f.value=W,m.value=+W[0],v.value=+W[1]},{immediate:!0}),rr(u,W=>{var A;it((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:Y}=W;l.deltaValue1=Y/G.width*T.value,m.value=O(gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,v.value].sort((ve,xe)=>ve-xe),W.stop&&(K([O(N.value),O(C.value)]),l.deltaValue1=0)})}),rr(p,W=>{var A;it((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:Y}=W;l.deltaValue2=Y/G.width*T.value,v.value=O(gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,v.value].sort((ve,xe)=>ve-xe),W.stop&&(K([O(N.value),O(C.value)]),l.deltaValue2=0)})});function Z(){const W=Math.ceil((1-Q.value)*100),A=Math.ceil((1-M.value)*100);return[W,A].sort((G,Y)=>G-Y)}function O(W){const A=gt(W,s.min,s.max);return Math.round((A+Number.EPSILON)*(1/s.step))/(1/s.step)}function K(W){i("update:modelValue",W)}function ue(W,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(W.code)&&W.preventDefault();const G=W.code==="ArrowUp"||W.code==="ArrowRight"?s.step*1:W.code==="ArrowDown"||W.code==="ArrowLeft"?s.step*-1:0,Y=[...s.modelValue];Y[A]=gt(Y[A]+G,s.min,s.max),K(Y)}return(W,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Vk,[r.createElementVNode("div",Nk,[W.label?(r.openBlock(),r.createElementBlock("label",Dk,[r.createElementVNode("span",null,r.toDisplayString(W.label),1),A[3]||(A[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(W.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[4]||(A[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Fk,r.toDisplayString(F.value),1)):r.createCommentVNode("",!0)]),A[10]||(A[10]=r.createTextVNode()),r.createElementVNode("div",Rk,[r.createElementVNode("div",Mk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(U.value)},null,4)],512)]),A[9]||(A[9]=r.createTextVNode()),r.createElementVNode("div",Ik,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(G,Y)=>(r.openBlock(),r.createElementBlock("div",{key:Y,style:r.normalizeStyle({right:`${G}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),A[7]||(A[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(z.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[0]||(A[0]=G=>ue(G,0))},A[5]||(A[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),A[8]||(A[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(P.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[1]||(A[1]=G=>ue(G,1))},A[6]||(A[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),A[11]||(A[11]=r.createTextVNode()),r.createElementVNode("div",Lk,[s.mode==="input"?(r.openBlock(),r.createBlock(Pk,{key:0,modelValue:f.value,"onUpdate:modelValue":A[2]||(A[2]=G=>f.value=G),class:"ui-focused-border",onChange:K},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),A[12]||(A[12]=r.createTextVNode()),I.value?(r.openBlock(),r.createElementBlock("div",Ok,r.toDisplayString(I.value),1)):r.createCommentVNode("",!0)],2))}}),zk=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientHeight/(i.scrollHeight||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:i.scrollTop*p+"px",height:Math.floor(i.clientHeight*p)+"px"}});return et(s,"pointerdown",p=>{const f={clientY:p.clientY},m=dl(document,"mousemove",v=>{const k=(v.clientY-f.clientY)/l.value;n("update:scrollTop",i.scrollTop+k),f.clientY=v.clientY});["mouseup","pointercancel"].forEach(v=>{document.addEventListener(v,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),Zk=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientWidth/(i.scrollWidth||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:i.scrollLeft*p+"px",width:Math.floor(i.clientWidth*p)+"px"}});return et(s,"pointerdown",p=>{const f={clientX:p.clientX},m=dl(document,"mousemove",v=>{const k=(v.clientX-f.clientX)/l.value;n("update:scrollLeft",i.scrollLeft+k),f.clientX=v.clientX});["mouseup","pointercancel"].forEach(v=>{document.addEventListener(v,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),$k={class:"ui-scrollable"},Uk=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function i(u){_C(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,i(p)};function l(u){it(r.unref(e),p=>{p.scrollTop=u,i(p)})}function c(u){it(r.unref(e),p=>{p.scrollLeft=u,i(p)})}return Hu(e,u=>{it(u,p=>i(p))}),r.onMounted(()=>{it(r.unref(e),u=>{i(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{it(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",$k,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:s},[r.renderSlot(u.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(zk,{"scroll-top":n.scrollTop,"client-height":n.clientHeight,"scroll-height":n.scrollHeight,onWheel:p[0]||(p[0]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":l},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=r.createTextVNode()),r.createVNode(Zk,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":c},null,8,["scroll-left","client-width","scroll-width"])]))}}),Wk="add.svg",Hk="box.svg",jk="calendar.svg",qk="checkmark.svg",Kk="clipboard.svg",Yk="close.svg",Jk="copy.svg",Xk="download.svg",Qk="duplicate.svg",eS="edit.svg",tS="error.svg",nS="filter.svg",rS="help.svg",iS="info.svg",oS="link.svg",sS="loading.svg",aS="lock.svg",lS="maximize.svg",cS="minimize.svg",dS="minus.svg",uS="more.svg",pS="open.svg",hS="pause.svg",fS="play.svg",mS="renew.svg",gS="restart.svg",yS="reverse.svg",vS="settings.svg",_S="sort.svg",CS="stop.svg",wS="success.svg",bS="time.svg",xS="tune.svg",kS="warning.svg",SS="zip.svg",ES={add:Wk,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",box:Hk,calendar:jk,"caret-down":"caret-down.svg","caret-left":"caret-left.svg","caret-right":"caret-right.svg","caret-up":"caret-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:qk,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:Kk,close:Yk,copy:Jk,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:Xk,"drag-dots":"drag-dots.svg",duplicate:Qk,edit:eS,error:tS,export:"export.svg","filter-on":"filter-on.svg",filter:nS,"help-outline":"help-outline.svg",help:rS,"info-outline":"info-outline.svg",info:iS,"jump-link":"jump-link.svg",link:oS,loading:sS,lock:aS,maximize:lS,minimize:cS,minus:dS,more:uS,open:pS,"paper-clip":"paper-clip.svg",pause:hS,play:fS,renew:mS,restart:gS,reverse:yS,settings:vS,sort:_S,stop:CS,success:wS,time:bS,tune:xS,warning:kS,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:SS},TS="add.svg",BS="annotate.svg",AS="annotation.svg",PS="area.svg",VS="axes.svg",NS="bar.svg",DS="bindot.svg",FS="box.svg",RS="boxplot.svg",MS="bubble.svg",IS="calendar.svg",LS="canvas.svg",OS="checkbox.svg",GS="checkmark.svg",zS="clipboard.svg",ZS="close.svg",$S="cluster.svg",US="code.svg",WS="color.svg",HS="columns.svg",jS="container.svg",qS="cookie.svg",KS="copy.svg",YS="cpu.svg",JS="debug.svg",XS="dna.svg",QS="download.svg",e1="duplicate.svg",t1="edit.svg",n1="error.svg",r1="filter.svg",i1="generate.svg",o1="graph.svg",s1="heatmap.svg",a1="help.svg",l1="info.svg",c1="jitter.svg",d1="lasso.svg",u1="layers.svg",p1="learn.svg",h1="legend.svg",f1="line.svg",m1="link.svg",g1="loading.svg",y1="lock.svg",v1="maximize.svg",_1="menu.svg",C1="minimize.svg",w1="minus.svg",b1="more.svg",x1="pause.svg",k1="pin.svg",S1="play.svg",E1="product.svg",T1="publications.svg",B1="renew.svg",A1="restart.svg",P1="reverse.svg",V1="search.svg",N1="server.svg",D1="settings.svg",F1="sina.svg",R1="skatterplot.svg",M1="slice.svg",I1="sort.svg",L1="statistics.svg",O1="stop.svg",G1="success.svg",z1="table.svg",Z1="template.svg",$1="terminal.svg",U1="time.svg",W1="tune.svg",H1="venn.svg",j1="violin.svg",q1="warning.svg",K1="wetlab.svg",Y1="zip.svg",J1={"add-layer":"add-layer.svg",add:TS,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:BS,annotation:AS,area:PS,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:VS,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:NS,bindot:DS,box:FS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:RS,bubble:MS,calendar:IS,canvas:LS,"cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg","checkbox-checked":"checkbox-checked.svg","checkbox-intermediate":"checkbox-intermediate.svg",checkbox:OS,checkmark:GS,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:zS,close:ZS,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:$S,code:US,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:WS,columns:HS,"connected-points":"connected-points.svg",container:jS,cookie:qS,copy:KS,cpu:YS,"data-dimentions":"data-dimentions.svg",debug:JS,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg",dna:XS,download:QS,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:e1,edit:t1,"error-bar":"error-bar.svg",error:n1,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","files-export":"files-export.svg","files-import":"files-import.svg","filter-on":"filter-on.svg",filter:r1,"fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type-all":"frame-type-all.svg","frame-type-bottom":"frame-type-bottom.svg","frame-type-left-bottom":"frame-type-left-bottom.svg","frame-type-left":"frame-type-left.svg","frame-type-none":"frame-type-none.svg",generate:i1,graph:o1,heatmap:s1,"help-outline":"help-outline.svg",help:a1,"info-outline":"info-outline.svg",info:l1,jitter:c1,"jump-link":"jump-link.svg",lasso:d1,layers:u1,learn:p1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:h1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:f1,"linetype-dashed":"linetype-dashed.svg","linetype-dotdash":"linetype-dotdash.svg","linetype-dotted":"linetype-dotted.svg","linetype-longdash":"linetype-longdash.svg","linetype-solid":"linetype-solid.svg","linetype-twodash":"linetype-twodash.svg","link-disabled":"link-disabled.svg",link:m1,loading:g1,lock:y1,maximize:v1,menu:_1,minimize:C1,minus:w1,more:b1,"paper-clip":"paper-clip.svg",pause:x1,pin:k1,play:S1,"position-bottom-annotation":"position-bottom-annotation.svg","position-bottom":"position-bottom.svg","position-left-annotation":"position-left-annotation.svg","position-left":"position-left.svg","position-right-annotation":"position-right-annotation.svg","position-right":"position-right.svg","position-top-annotation":"position-top-annotation.svg","position-top":"position-top.svg",product:E1,publications:T1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:B1,restart:A1,reverse:P1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:V1,"server-on":"server-on.svg",server:N1,settings:D1,sina:F1,skatterplot:R1,slice:M1,"social-github":"social-github.svg","social-linkedin":"social-linkedin.svg","social-twitter-X":"social-twitter-X.svg","social-twitter-bird":"social-twitter-bird.svg","social-youtube":"social-youtube.svg","sort-list-down":"sort-list-down.svg","sort-list-up":"sort-list-up.svg",sort:I1,statistics:L1,stop:O1,"strip-plot":"strip-plot.svg",success:G1,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:z1,template:Z1,terminal:$1,"text-align-center":"text-align-center.svg","text-align-left":"text-align-left.svg","text-align-right":"text-align-right.svg","theme-dark":"theme-dark.svg","theme-light":"theme-light.svg",time:U1,tune:W1,venn:H1,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:j1,warning:q1,wetlab:K1,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:Y1,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function X1(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const Q1=["add","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","box","calendar","caret-down","caret-left","caret-right","caret-up","cell-type-num","cell-type-txt","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","clipboard-copied","clipboard","close","copy","data-dimentions","delete-bin","delete-circle","delete-clear","download","drag-dots","duplicate","edit","error","export","filter-on","filter","help-outline","help","info-outline","info","jump-link","link","loading","lock","maximize","minimize","minus","more","open","paper-clip","pause","play","renew","restart","reverse","settings","sort","stop","success","time","tune","warning","x-axis","y-axis","zip"],eE=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","files-export","files-import","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],tE={allCssVariables:X1(),icons16:ES,icons24:J1},nE={class:"block__not-found"},rE=r.defineComponent({__name:"NotFound",setup(t){const n=Ha().useApp(),i=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",nE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(ol),{onClick:r.withModifiers(i,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),kl=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},iE={},oE={class:"block__loader-page"};function sE(t,e){return r.openBlock(),r.createElementBlock("div",oE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const aE=kl(iE,[["render",sE]]),lE={class:"pl-app-notification-alert"},cE={class:"pl-app-notification-alert__content"},dE={class:"pl-app-notification-alert__title"},uE={class:"pl-app-notification-alert__error-description"},pE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),i=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(u=>!!u[1]));function l(){n.value=!0}function c(u){navigator.clipboard&&navigator.clipboard.writeText(JSON.stringify(u))}return r.watch(()=>e.errors,u=>{i.value=Object.values(u).some(p=>!!p)},{immediate:!0,deep:!0}),(u,p)=>(r.openBlock(),r.createElementBlock("div",lE,[r.createVNode(r.unref(gl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),width:"50%",style:{"max-height":"100vh"}},{title:r.withCtx(()=>p[2]||(p[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",cE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>{var m;return r.openBlock(),r.createElementBlock("div",{key:f[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",dE,r.toDisplayString(f[0]),1),r.createElementVNode("div",uE,[r.createElementVNode("code",null,r.toDisplayString((m=f[1])==null?void 0:m.message),1),r.createVNode(r.unref(Wu),{class:"pl-app-notification-alert__copy-icon",onCopyData:v=>c(f[1])},null,8,["onCopyData"])])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Uu),{modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=f=>i.value=f),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(il),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>p[3]||(p[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(fu))]),default:r.withCtx(()=>[p[4]||(p[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),hE={class:"block block__layout"},fE={key:0},mE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Ha(),n=p=>{try{return new URL(p,"http://dummy").pathname}catch{console.error("Invalid href",p);return}},i=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const p=e.useApp(),f=n(p.snapshot.navigationState.href);return f?p.getRoute(f):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var p;return((p=l.value)==null?void 0:p.showErrorsNotification)??!0});return(p,f)=>(r.openBlock(),r.createElementBlock("div",hE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",fE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:i.value})):(r.openBlock(),r.createBlock(rE,{key:3})):(r.openBlock(),r.createBlock(aE,{key:1},{default:r.withCtx(()=>f[0]||(f[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(pE),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var bs={exports:{}};/**
|
|
63
|
+
)`}function l(){const u=t.value;if(!u)return;const p=[i(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const c=sl(l);r.onMounted(l),tt(window,"scroll",c,!0),tt(window,"resize",c,!0)}function Ju(t,e){Cu(()=>{ot(r.unref(t),n=>{wu(n,()=>e(n))})}),r.onUnmounted(()=>{ot(r.unref(t),n=>{bu(n)})})}const fr={item:"sortable__item",animate:"sortable__animate"},So=t=>t.getBoundingClientRect().y,Xu=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},fk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function mk(t,e){const n={item:void 0,options(){var E;return[...((E=t.value)==null?void 0:E.children)??[]]}},i=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(E){const M=e.handle?this.querySelector(e.handle):null;M&&!M.contains(E.target)||(this.classList.remove(fr.animate),this.classList.add(fr.item),n.item={el:this,y:E.y,dy:0,orderChanged:!1})}function u(E){const M=n.options();return M.slice(0,M.indexOf(E))}function p(E){const M=n.options();return M.slice(M.indexOf(E)+1)}function f(E,M){const V=n.options().filter(C=>C!==M),F=V.indexOf(E);return V.splice(F,0,M),V}function m(E,M){const V=n.options().filter(C=>C!==M),F=V.indexOf(E);return V.splice(F+1,0,M),V}function y(E,M){E.dy=M-E.y,E.el.style.setProperty("transform",`translateY(${E.dy}px)`)}function S(E){var M;if(!n.item)return;const{el:V}=n.item;if(!V.isConnected){n.item=void 0;return}const F=E.map(U=>So(U)),C=So(V);(M=t.value)==null||M.replaceChildren(...E);const G=So(V),Q=E.map(U=>So(U)),I=[];for(let U=0;U<Q.length;U++){const T=E[U];if(T===n.item.el)continue;const k=Q[U],O=F[U]-k;T.style.transform=`translateY(${O}px)`,I.push(T)}const L=G-C;n.item.y=n.item.y+L,n.item.dy=n.item.dy-L,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),I.forEach(U=>U.classList.remove(fr.animate)),requestAnimationFrame(function(){I.forEach(U=>{U.classList.add(fr.animate),U.style.transform="",U.addEventListener("transitionend",()=>{U.classList.remove(fr.animate)})})})}tt(window,"mousemove",E=>{if(!n.item)return;const{el:M}=n.item;y(n.item,E.y);const V=So(n.item.el),F=fk(n.item.el),C=u(M),G=p(M);C.forEach(Q=>{const I=Xu(Q);V+s<I&&S(f(Q,M))}),G.forEach(Q=>{const I=Xu(Q);F-s>I&&S(m(Q,M))})}),tt(window,"mouseup",()=>{if(!n.item)return;const{el:E,orderChanged:M}=n.item;E.classList.add(fr.animate),E.style.removeProperty("transform"),E.addEventListener("transitionend",()=>{E.classList.remove(fr.animate,fr.item)}),setTimeout(()=>{if(!M)return;const V=n.options().map(C=>Number(C.getAttribute("data-index"))),F=t.value;if(F){for(const C of n.options())F.removeChild(C);i.value.forEach(C=>{F.appendChild(C)})}e.onChange(V)},l),n.item=void 0}),r.watchEffect(()=>{i.value.forEach((E,M)=>{E.removeEventListener("mousedown",c),E.addEventListener("mousedown",c),E.setAttribute("data-index",String(M))})})}function gk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function yk(t,e,n){const i=r.reactive({data:el.deepClone(e(t.value)),changed:!1});return r.watch(()=>i.data,s=>{i.changed?n(el.deepClone(s)):i.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(i,{data:el.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),i}function vk(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(i){this.error=i}finally{this.isLoading=!1}},debounce(n,i=1e3){return eu(()=>{const s=n();this.run(...s).catch(console.error)},i)}});return e.run=e.run.bind(e),e}function _k(t,e){function n(c,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-c.x}px, ${u.y-c.y}px)`;p.style.setProperty("transform",f),e(u)}function i(c){const u=p=>n(c,p);document.addEventListener("mousemove",u),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",u),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function s(){var c;(c=r.unref(t))==null||c.addEventListener("mousedown",i)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",i)}r.onMounted(s),r.onUnmounted(l)}const Ck={class:"ui-slider__wrapper"},wk={class:"ui-slider__label-section"},bk={key:0,class:"text-s"},xk={class:"ui-slider__base"},kk={class:"ui-slider__container"},Sk={class:"ui-slider__container ui-slider__container-thumb"},Ek=["data-percent"],Tk=["data-percent"],Bk=["data-percent"],Vk={key:0,class:"ui-slider__error"},Ak=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),S=Bl(y),E=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),M=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),V=r.computed(()=>vt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),F=r.computed(()=>{const Z=s.modelValue;if(!(Array.isArray(Z)&&Z.length===3&&Z.every(pe=>Number.isFinite(pe))))return"Expected model [number, number, number]";const Y=[];return[...s.modelValue].forEach(pe=>{pe>s.max&&Y.push(`Max model value must be lower than max props ${s.max}.`),pe<s.min&&Y.push("Min model value must be greater than max props.")}),Y.length>0?Y.join(" "):s.error}),C=r.computed(()=>(E.value-s.min)/m.value),G=r.computed(()=>(M.value-s.min)/m.value),Q=r.computed(()=>(V.value-s.min)/m.value),I=r.computed(()=>A()),L=r.computed(()=>({right:I.value[0]+"%",left:100-I.value[2]+"%"})),U=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),T=r.computed(()=>({right:Math.ceil((1-G.value)*100)+"%"})),k=r.computed(()=>({right:Math.ceil((1-Q.value)*100)+"%"}));sr(u,Z=>{var Y;ot((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue1=we/pe.width*m.value,u.value&&O(u.value,s.modelValue[0],l.deltaValue1),Z.stop&&(se([q(E.value),q(M.value),q(V.value)]),l.deltaValue1=0)})}),sr(p,Z=>{var Y;ot((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue2=we/pe.width*m.value,p.value&&O(p.value,s.modelValue[1],l.deltaValue2),Z.stop&&(se([q(E.value),q(M.value),q(V.value)]),l.deltaValue2=0)})}),sr(f,Z=>{var Y;ot((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue3=we/pe.width*m.value,f.value&&O(f.value,s.modelValue[2],l.deltaValue3),Z.stop&&(se([q(E.value),q(M.value),q(V.value)]),l.deltaValue3=0)})});function O(Z,Y,pe){const we=q(vt((Y??0)+pe,s.min,s.max));Z.dataset.percent=`${we}${s.measure}`,$()}function A(){const Z=Math.ceil((1-C.value)*100),Y=Math.ceil((1-G.value)*100),pe=Math.ceil((1-Q.value)*100);return[Z,Y,pe].sort((we,Ct)=>we-Ct)}function q(Z){const Y=vt(Z,s.min,s.max);return Math.round((Y+Number.EPSILON)*(1/s.step))/(1/s.step)}function se(Z){i("update:modelValue",Z)}function $(){const Z=Number(U.value.right.substring(0,U.value.right.length-1)),Y=Number(T.value.right.substring(0,T.value.right.length-1)),pe=Number(k.value.right.substring(0,k.value.right.length-1)),we=[{r:Z,th:u},{r:Y,th:p},{r:pe,th:f}].sort((Ct,Tt)=>Ct.r-Tt.r);we[0].th.value&&(we[0].th.value.dataset.hint="high"),we[1].th.value&&(we[1].th.value.dataset.hint="mid"),we[2].th.value&&(we[2].th.value.dataset.hint="low")}function N(Z,Y){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(Z.code)&&Z.preventDefault();const pe=Z.code==="ArrowUp"||Z.code==="ArrowRight"?s.step*1:Z.code==="ArrowDown"||Z.code==="ArrowLeft"?s.step*-1:0,we=[...s.modelValue];we[Y]=vt(we[Y]+pe,s.min,s.max),se(we),$()}return r.onMounted(()=>{$()}),(Z,Y)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Ck,[r.createElementVNode("div",wk,[Z.label?(r.openBlock(),r.createElementBlock("label",bk,[r.createElementVNode("span",null,r.toDisplayString(Z.label),1),Y[3]||(Y[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(Z.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),Y[11]||(Y[11]=r.createTextVNode()),r.createElementVNode("div",xk,[r.createElementVNode("div",kk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(L.value)},null,4)],512)]),Y[10]||(Y[10]=r.createTextVNode()),r.createElementVNode("div",Sk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(pe,we)=>(r.openBlock(),r.createElementBlock("div",{key:we,style:r.normalizeStyle({right:`${pe}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Y[7]||(Y[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(U.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:Y[0]||(Y[0]=pe=>N(pe,0))},Y[4]||(Y[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Ek),Y[8]||(Y[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(T.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:Y[1]||(Y[1]=pe=>N(pe,1))},Y[5]||(Y[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Tk),Y[9]||(Y[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(k.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:Y[2]||(Y[2]=pe=>N(pe,2))},Y[6]||(Y[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Bk)])])]),Y[12]||(Y[12]=r.createTextVNode()),Y[13]||(Y[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),Y[14]||(Y[14]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",Vk,r.toDisplayString(F.value),1)):r.createCommentVNode("",!0)],2))}}),Nk={class:"ui-input-range__separator"},Pk=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,i=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),u=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>u.value,m=>(s.left=m.left)&&(s.right=m.right));function p(){i("update:modelValue",[+s.left,+s.right]),i("change",[+s.left,+s.right])}function f(m,y){const S=y.target.value;/^[0-9]{0,2}$/.test(S)?m?s.left=+S:s.right=+S:m?s.left=+S.slice(0,S.length-1):s.right=+S.slice(0,S.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=S=>u.value.left=S),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=S=>l.value=!0),onFocusout:y[2]||(y[2]=S=>l.value=!1),onInput:y[3]||(y[3]=S=>f(!0,S))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",Nk,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=S=>u.value.right=S),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=S=>l.value=!0),onFocusout:y[6]||(y[6]=S=>l.value=!1),onInput:y[7]||(y[7]=S=>f(!1,S))},null,544),[[r.vModelText,u.value.right]])],16))}}),Dk={class:"ui-slider__wrapper"},Fk={class:"ui-slider__label-section"},Rk={key:0,class:"text-s"},Mk={key:1,class:"ui-slider__value-static text-s"},Ik={class:"ui-slider__base"},Lk={class:"ui-slider__container"},Ok={class:"ui-slider__container ui-slider__container-thumb"},Gk={class:"ui-slider__input-wrapper d-flex"},zk={key:0,class:"ui-slider__error"},Zk=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),y=r.ref(s.modelValue[1]),S=r.computed(()=>s),E=Bl(S),M=r.computed(()=>[m.value,y.value].sort(($,N)=>$-N).join("-")),V=r.computed(()=>s.max-s.min),F=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),G=r.computed(()=>{const $=s.modelValue;return Array.isArray($)&&$.length===2&&$.every(N=>Number.isFinite(N))?s.error:"Expected model [number, number]"}),Q=r.computed(()=>(F.value-s.min)/V.value),I=r.computed(()=>(C.value-s.min)/V.value),L=r.computed(()=>O()),U=r.computed(()=>({right:L.value[0]+"%",left:100-L.value[1]+"%"})),T=r.computed(()=>({right:Math.ceil((1-Q.value)*100)+"%"})),k=r.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"}));r.watch(()=>s.modelValue,$=>{f.value=$,m.value=+$[0],y.value=+$[1]},{immediate:!0}),sr(u,$=>{var N;ot((N=r.unref(c))==null?void 0:N.getBoundingClientRect(),Z=>{const{dx:Y}=$;l.deltaValue1=Y/Z.width*V.value,m.value=A(vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),$.stop&&(q([A(F.value),A(C.value)]),l.deltaValue1=0)})}),sr(p,$=>{var N;ot((N=r.unref(c))==null?void 0:N.getBoundingClientRect(),Z=>{const{dx:Y}=$;l.deltaValue2=Y/Z.width*V.value,y.value=A(vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),$.stop&&(q([A(F.value),A(C.value)]),l.deltaValue2=0)})});function O(){const $=Math.ceil((1-Q.value)*100),N=Math.ceil((1-I.value)*100);return[$,N].sort((Z,Y)=>Z-Y)}function A($){const N=vt($,s.min,s.max);return Math.round((N+Number.EPSILON)*(1/s.step))/(1/s.step)}function q($){i("update:modelValue",$)}function se($,N){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes($.code)&&$.preventDefault();const Z=$.code==="ArrowUp"||$.code==="ArrowRight"?s.step*1:$.code==="ArrowDown"||$.code==="ArrowLeft"?s.step*-1:0,Y=[...s.modelValue];Y[N]=vt(Y[N]+Z,s.min,s.max),q(Y)}return($,N)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Dk,[r.createElementVNode("div",Fk,[$.label?(r.openBlock(),r.createElementBlock("label",Rk,[r.createElementVNode("span",null,r.toDisplayString($.label),1),N[3]||(N[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Nt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot($.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),N[4]||(N[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Mk,r.toDisplayString(M.value),1)):r.createCommentVNode("",!0)]),N[10]||(N[10]=r.createTextVNode()),r.createElementVNode("div",Ik,[r.createElementVNode("div",Lk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(U.value)},null,4)],512)]),N[9]||(N[9]=r.createTextVNode()),r.createElementVNode("div",Ok,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(E),(Z,Y)=>(r.openBlock(),r.createElementBlock("div",{key:Y,style:r.normalizeStyle({right:`${Z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(T.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:N[0]||(N[0]=Z=>se(Z,0))},N[5]||(N[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),N[8]||(N[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(k.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:N[1]||(N[1]=Z=>se(Z,1))},N[6]||(N[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),N[11]||(N[11]=r.createTextVNode()),r.createElementVNode("div",Gk,[s.mode==="input"?(r.openBlock(),r.createBlock(Pk,{key:0,modelValue:f.value,"onUpdate:modelValue":N[2]||(N[2]=Z=>f.value=Z),class:"ui-focused-border",onChange:q},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),N[12]||(N[12]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",zk,r.toDisplayString(G.value),1)):r.createCommentVNode("",!0)],2))}}),Uk=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientHeight/(i.scrollHeight||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:i.scrollTop*p+"px",height:Math.floor(i.clientHeight*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=gl(document,"mousemove",y=>{const S=(y.clientY-f.clientY)/l.value;n("update:scrollTop",i.scrollTop+S),f.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),$k=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientWidth/(i.scrollWidth||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:i.scrollLeft*p+"px",width:Math.floor(i.clientWidth*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=gl(document,"mousemove",y=>{const S=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",i.scrollLeft+S),f.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),Wk={class:"ui-scrollable"},Hk=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function i(u){SC(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,i(p)};function l(u){ot(r.unref(e),p=>{p.scrollTop=u,i(p)})}function c(u){ot(r.unref(e),p=>{p.scrollLeft=u,i(p)})}return Ju(e,u=>{ot(u,p=>i(p))}),r.onMounted(()=>{ot(r.unref(e),u=>{i(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{ot(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",Wk,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:s},[r.renderSlot(u.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(Uk,{"scroll-top":n.scrollTop,"client-height":n.clientHeight,"scroll-height":n.scrollHeight,onWheel:p[0]||(p[0]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":l},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=r.createTextVNode()),r.createVNode($k,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":c},null,8,["scroll-left","client-width","scroll-width"])]))}}),jk="add.svg",qk="box.svg",Kk="calendar.svg",Yk="checkmark.svg",Jk="clipboard.svg",Xk="close.svg",Qk="copy.svg",eS="download.svg",tS="duplicate.svg",nS="edit.svg",rS="error.svg",iS="filter.svg",oS="help.svg",sS="info.svg",aS="link.svg",lS="loading.svg",cS="lock.svg",dS="maximize.svg",uS="minimize.svg",pS="minus.svg",hS="more.svg",fS="open.svg",mS="pause.svg",gS="play.svg",yS="renew.svg",vS="restart.svg",_S="reverse.svg",CS="settings.svg",wS="sort.svg",bS="stop.svg",xS="success.svg",kS="time.svg",SS="tune.svg",ES="warning.svg",TS="zip.svg",BS={add:jk,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",box:qk,calendar:Kk,"caret-down":"caret-down.svg","caret-left":"caret-left.svg","caret-right":"caret-right.svg","caret-up":"caret-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:Yk,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:Jk,close:Xk,copy:Qk,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:eS,"drag-dots":"drag-dots.svg",duplicate:tS,edit:nS,error:rS,export:"export.svg","filter-on":"filter-on.svg",filter:iS,"help-outline":"help-outline.svg",help:oS,"info-outline":"info-outline.svg",info:sS,"jump-link":"jump-link.svg",link:aS,loading:lS,lock:cS,maximize:dS,minimize:uS,minus:pS,more:hS,open:fS,"paper-clip":"paper-clip.svg",pause:mS,play:gS,renew:yS,restart:vS,reverse:_S,settings:CS,sort:wS,stop:bS,success:xS,time:kS,tune:SS,warning:ES,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:TS},VS="add.svg",AS="annotate.svg",NS="annotation.svg",PS="area.svg",DS="axes.svg",FS="bar.svg",RS="bindot.svg",MS="box.svg",IS="boxplot.svg",LS="bubble.svg",OS="calendar.svg",GS="canvas.svg",zS="checkbox.svg",ZS="checkmark.svg",US="clipboard.svg",$S="close.svg",WS="cluster.svg",HS="code.svg",jS="color.svg",qS="columns.svg",KS="container.svg",YS="cookie.svg",JS="copy.svg",XS="cpu.svg",QS="debug.svg",e1="dna.svg",t1="download.svg",n1="duplicate.svg",r1="edit.svg",i1="error.svg",o1="filter.svg",s1="generate.svg",a1="graph.svg",l1="heatmap.svg",c1="help.svg",d1="info.svg",u1="jitter.svg",p1="lasso.svg",h1="layers.svg",f1="learn.svg",m1="legend.svg",g1="line.svg",y1="link.svg",v1="loading.svg",_1="lock.svg",C1="maximize.svg",w1="menu.svg",b1="minimize.svg",x1="minus.svg",k1="more.svg",S1="pause.svg",E1="pin.svg",T1="play.svg",B1="product.svg",V1="publications.svg",A1="renew.svg",N1="restart.svg",P1="reverse.svg",D1="search.svg",F1="server.svg",R1="settings.svg",M1="sina.svg",I1="skatterplot.svg",L1="slice.svg",O1="sort.svg",G1="statistics.svg",z1="stop.svg",Z1="success.svg",U1="table.svg",$1="template.svg",W1="terminal.svg",H1="time.svg",j1="tune.svg",q1="venn.svg",K1="violin.svg",Y1="warning.svg",J1="wetlab.svg",X1="zip.svg",Q1={"add-layer":"add-layer.svg",add:VS,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:AS,annotation:NS,area:PS,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:DS,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:FS,bindot:RS,box:MS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:IS,bubble:LS,calendar:OS,canvas:GS,"cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg","checkbox-checked":"checkbox-checked.svg","checkbox-intermediate":"checkbox-intermediate.svg",checkbox:zS,checkmark:ZS,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:US,close:$S,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:WS,code:HS,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:jS,columns:qS,"connected-points":"connected-points.svg",container:KS,cookie:YS,copy:JS,cpu:XS,"data-dimentions":"data-dimentions.svg",debug:QS,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg",dna:e1,download:t1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:n1,edit:r1,"error-bar":"error-bar.svg",error:i1,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","files-export":"files-export.svg","files-import":"files-import.svg","filter-on":"filter-on.svg",filter:o1,"fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type-all":"frame-type-all.svg","frame-type-bottom":"frame-type-bottom.svg","frame-type-left-bottom":"frame-type-left-bottom.svg","frame-type-left":"frame-type-left.svg","frame-type-none":"frame-type-none.svg",generate:s1,graph:a1,heatmap:l1,"help-outline":"help-outline.svg",help:c1,"info-outline":"info-outline.svg",info:d1,jitter:u1,"jump-link":"jump-link.svg",lasso:p1,layers:h1,learn:f1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:m1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:g1,"linetype-dashed":"linetype-dashed.svg","linetype-dotdash":"linetype-dotdash.svg","linetype-dotted":"linetype-dotted.svg","linetype-longdash":"linetype-longdash.svg","linetype-solid":"linetype-solid.svg","linetype-twodash":"linetype-twodash.svg","link-disabled":"link-disabled.svg",link:y1,loading:v1,lock:_1,maximize:C1,menu:w1,minimize:b1,minus:x1,more:k1,"paper-clip":"paper-clip.svg",pause:S1,pin:E1,play:T1,"position-bottom-annotation":"position-bottom-annotation.svg","position-bottom":"position-bottom.svg","position-left-annotation":"position-left-annotation.svg","position-left":"position-left.svg","position-right-annotation":"position-right-annotation.svg","position-right":"position-right.svg","position-top-annotation":"position-top-annotation.svg","position-top":"position-top.svg",product:B1,publications:V1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:A1,restart:N1,reverse:P1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:D1,"server-on":"server-on.svg",server:F1,settings:R1,sina:M1,skatterplot:I1,slice:L1,"social-github":"social-github.svg","social-linkedin":"social-linkedin.svg","social-twitter-X":"social-twitter-X.svg","social-twitter-bird":"social-twitter-bird.svg","social-youtube":"social-youtube.svg","sort-list-down":"sort-list-down.svg","sort-list-up":"sort-list-up.svg",sort:O1,statistics:G1,stop:z1,"strip-plot":"strip-plot.svg",success:Z1,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:U1,template:$1,terminal:W1,"text-align-center":"text-align-center.svg","text-align-left":"text-align-left.svg","text-align-right":"text-align-right.svg","theme-dark":"theme-dark.svg","theme-light":"theme-light.svg",time:H1,tune:j1,venn:q1,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:K1,warning:Y1,wetlab:J1,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:X1,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function eE(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const tE=["add","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","box","calendar","caret-down","caret-left","caret-right","caret-up","cell-type-num","cell-type-txt","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","clipboard-copied","clipboard","close","copy","data-dimentions","delete-bin","delete-circle","delete-clear","download","drag-dots","duplicate","edit","error","export","filter-on","filter","help-outline","help","info-outline","info","jump-link","link","loading","lock","maximize","minimize","minus","more","open","paper-clip","pause","play","renew","restart","reverse","settings","sort","stop","success","time","tune","warning","x-axis","y-axis","zip"],nE=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","files-export","files-import","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],rE={allCssVariables:eE(),icons16:BS,icons24:Q1},iE={class:"block__not-found"},oE=r.defineComponent({__name:"NotFound",setup(t){const n=Xa().useApp(),i=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",iE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(ul),{onClick:r.withModifiers(i,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Ts=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},sE={},aE={class:"block__loader-page"};function lE(t,e){return r.openBlock(),r.createElementBlock("div",aE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const cE=Ts(sE,[["render",lE]]),dE={class:"pl-app-notification-alert"},uE={class:"pl-app-notification-alert__content"},pE={class:"pl-app-notification-alert__title"},hE={class:"pl-app-notification-alert__error-description"},fE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),i=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(u=>!!u[1]));function l(){n.value=!0}function c(u){navigator.clipboard&&navigator.clipboard.writeText(JSON.stringify(u))}return r.watch(()=>e.errors,u=>{i.value=Object.values(u).some(p=>!!p)},{immediate:!0,deep:!0}),(u,p)=>(r.openBlock(),r.createElementBlock("div",dE,[r.createVNode(r.unref(wl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),width:"50%",style:{"max-height":"100vh"}},{title:r.withCtx(()=>p[2]||(p[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",uE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>{var m;return r.openBlock(),r.createElementBlock("div",{key:f[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",pE,r.toDisplayString(f[0]),1),r.createElementVNode("div",hE,[r.createElementVNode("code",null,r.toDisplayString((m=f[1])==null?void 0:m.message),1),r.createVNode(r.unref(Ku),{class:"pl-app-notification-alert__copy-icon",onCopyData:y=>c(f[1])},null,8,["onCopyData"])])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(qu),{modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=f=>i.value=f),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(dl),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>p[3]||(p[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(vu))]),default:r.withCtx(()=>[p[4]||(p[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),mE={class:"block block__layout"},gE={key:0},yE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Xa(),n=p=>{try{return new URL(p,"http://dummy").pathname}catch{console.error("Invalid href",p);return}},i=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const p=e.useApp(),f=n(p.snapshot.navigationState.href);return f?p.getRoute(f):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var p;return((p=l.value)==null?void 0:p.showErrorsNotification)??!0});return(p,f)=>(r.openBlock(),r.createElementBlock("div",mE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",gE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:i.value})):(r.openBlock(),r.createBlock(oE,{key:3})):(r.openBlock(),r.createBlock(cE,{key:1},{default:r.withCtx(()=>f[0]||(f[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(fE),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Bs={exports:{}};/**
|
|
64
64
|
* @license
|
|
65
65
|
* Lodash <https://lodash.com/>
|
|
66
66
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
67
67
|
* Released under MIT license <https://lodash.com/license>
|
|
68
68
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
69
69
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
70
|
-
*/bs.exports,function(t,e){(function(){var n,i="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",v=1,k=2,S=4,F=1,T=2,N=1,C=2,I=4,Q=8,M=16,R=32,U=64,z=128,P=256,Z=512,O=30,K="...",ue=800,W=16,A=1,G=2,Y=3,ve=1/0,xe=9007199254740991,Gt=17976931348623157e292,jt=NaN,At=4294967295,ko=At-1,Lr=At>>>1,So=[["ary",z],["bind",N],["bindKey",C],["curry",Q],["curryRight",M],["flip",Z],["partial",R],["partialRight",U],["rearg",P]],hi="[object Arguments]",Es="[object Array]",qE="[object AsyncFunction]",Eo="[object Boolean]",To="[object Date]",KE="[object DOMException]",Ts="[object Error]",Bs="[object Function]",lp="[object GeneratorFunction]",yn="[object Map]",Bo="[object Number]",YE="[object Null]",On="[object Object]",cp="[object Promise]",JE="[object Proxy]",Ao="[object RegExp]",vn="[object Set]",Po="[object String]",As="[object Symbol]",XE="[object Undefined]",Vo="[object WeakMap]",QE="[object WeakSet]",No="[object ArrayBuffer]",fi="[object DataView]",Pl="[object Float32Array]",Vl="[object Float64Array]",Nl="[object Int8Array]",Dl="[object Int16Array]",Fl="[object Int32Array]",Rl="[object Uint8Array]",Ml="[object Uint8ClampedArray]",Il="[object Uint16Array]",Ll="[object Uint32Array]",eT=/\b__p \+= '';/g,tT=/\b(__p \+=) '' \+/g,nT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dp=/&(?:amp|lt|gt|quot|#39);/g,up=/[&<>"']/g,rT=RegExp(dp.source),iT=RegExp(up.source),oT=/<%-([\s\S]+?)%>/g,sT=/<%([\s\S]+?)%>/g,pp=/<%=([\s\S]+?)%>/g,aT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lT=/^\w*$/,cT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ol=/[\\^$.*+?()[\]{}|]/g,dT=RegExp(Ol.source),Gl=/^\s+/,uT=/\s/,pT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hT=/\{\n\/\* \[wrapped with (.+)\] \*/,fT=/,? & /,mT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gT=/[()=,{}\[\]\/\s]/,yT=/\\(\\)?/g,vT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hp=/\w*$/,_T=/^[-+]0x[0-9a-f]+$/i,CT=/^0b[01]+$/i,wT=/^\[object .+?Constructor\]$/,bT=/^0o[0-7]+$/i,xT=/^(?:0|[1-9]\d*)$/,kT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ps=/($^)/,ST=/['\n\r\u2028\u2029\\]/g,Vs="\\ud800-\\udfff",ET="\\u0300-\\u036f",TT="\\ufe20-\\ufe2f",BT="\\u20d0-\\u20ff",fp=ET+TT+BT,mp="\\u2700-\\u27bf",gp="a-z\\xdf-\\xf6\\xf8-\\xff",AT="\\xac\\xb1\\xd7\\xf7",PT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",VT="\\u2000-\\u206f",NT=" \\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",yp="A-Z\\xc0-\\xd6\\xd8-\\xde",vp="\\ufe0e\\ufe0f",_p=AT+PT+VT+NT,zl="['’]",DT="["+Vs+"]",Cp="["+_p+"]",Ns="["+fp+"]",wp="\\d+",FT="["+mp+"]",bp="["+gp+"]",xp="[^"+Vs+_p+wp+mp+gp+yp+"]",Zl="\\ud83c[\\udffb-\\udfff]",RT="(?:"+Ns+"|"+Zl+")",kp="[^"+Vs+"]",$l="(?:\\ud83c[\\udde6-\\uddff]){2}",Ul="[\\ud800-\\udbff][\\udc00-\\udfff]",mi="["+yp+"]",Sp="\\u200d",Ep="(?:"+bp+"|"+xp+")",MT="(?:"+mi+"|"+xp+")",Tp="(?:"+zl+"(?:d|ll|m|re|s|t|ve))?",Bp="(?:"+zl+"(?:D|LL|M|RE|S|T|VE))?",Ap=RT+"?",Pp="["+vp+"]?",IT="(?:"+Sp+"(?:"+[kp,$l,Ul].join("|")+")"+Pp+Ap+")*",LT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vp=Pp+Ap+IT,GT="(?:"+[FT,$l,Ul].join("|")+")"+Vp,zT="(?:"+[kp+Ns+"?",Ns,$l,Ul,DT].join("|")+")",ZT=RegExp(zl,"g"),$T=RegExp(Ns,"g"),Wl=RegExp(Zl+"(?="+Zl+")|"+zT+Vp,"g"),UT=RegExp([mi+"?"+bp+"+"+Tp+"(?="+[Cp,mi,"$"].join("|")+")",MT+"+"+Bp+"(?="+[Cp,mi+Ep,"$"].join("|")+")",mi+"?"+Ep+"+"+Tp,mi+"+"+Bp,OT,LT,wp,GT].join("|"),"g"),WT=RegExp("["+Sp+Vs+fp+vp+"]"),HT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],qT=-1,He={};He[Pl]=He[Vl]=He[Nl]=He[Dl]=He[Fl]=He[Rl]=He[Ml]=He[Il]=He[Ll]=!0,He[hi]=He[Es]=He[No]=He[Eo]=He[fi]=He[To]=He[Ts]=He[Bs]=He[yn]=He[Bo]=He[On]=He[Ao]=He[vn]=He[Po]=He[Vo]=!1;var Ue={};Ue[hi]=Ue[Es]=Ue[No]=Ue[fi]=Ue[Eo]=Ue[To]=Ue[Pl]=Ue[Vl]=Ue[Nl]=Ue[Dl]=Ue[Fl]=Ue[yn]=Ue[Bo]=Ue[On]=Ue[Ao]=Ue[vn]=Ue[Po]=Ue[As]=Ue[Rl]=Ue[Ml]=Ue[Il]=Ue[Ll]=!0,Ue[Ts]=Ue[Bs]=Ue[Vo]=!1;var KT={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},YT={"&":"&","<":"<",">":">",'"':""","'":"'"},JT={"&":"&","<":"<",">":">",""":'"',"'":"'"},XT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},QT=parseFloat,eB=parseInt,Np=typeof Ai=="object"&&Ai&&Ai.Object===Object&&Ai,tB=typeof self=="object"&&self&&self.Object===Object&&self,pt=Np||tB||Function("return this")(),Hl=e&&!e.nodeType&&e,Or=Hl&&!0&&t&&!t.nodeType&&t,Dp=Or&&Or.exports===Hl,jl=Dp&&Np.process,qt=function(){try{var B=Or&&Or.require&&Or.require("util").types;return B||jl&&jl.binding&&jl.binding("util")}catch{}}(),Fp=qt&&qt.isArrayBuffer,Rp=qt&&qt.isDate,Mp=qt&&qt.isMap,Ip=qt&&qt.isRegExp,Lp=qt&&qt.isSet,Op=qt&&qt.isTypedArray;function zt(B,$,L){switch(L.length){case 0:return B.call($);case 1:return B.call($,L[0]);case 2:return B.call($,L[0],L[1]);case 3:return B.call($,L[0],L[1],L[2])}return B.apply($,L)}function nB(B,$,L,se){for(var be=-1,Oe=B==null?0:B.length;++be<Oe;){var st=B[be];$(se,st,L(st),B)}return se}function Kt(B,$){for(var L=-1,se=B==null?0:B.length;++L<se&&$(B[L],L,B)!==!1;);return B}function rB(B,$){for(var L=B==null?0:B.length;L--&&$(B[L],L,B)!==!1;);return B}function Gp(B,$){for(var L=-1,se=B==null?0:B.length;++L<se;)if(!$(B[L],L,B))return!1;return!0}function fr(B,$){for(var L=-1,se=B==null?0:B.length,be=0,Oe=[];++L<se;){var st=B[L];$(st,L,B)&&(Oe[be++]=st)}return Oe}function Ds(B,$){var L=B==null?0:B.length;return!!L&&gi(B,$,0)>-1}function ql(B,$,L){for(var se=-1,be=B==null?0:B.length;++se<be;)if(L($,B[se]))return!0;return!1}function qe(B,$){for(var L=-1,se=B==null?0:B.length,be=Array(se);++L<se;)be[L]=$(B[L],L,B);return be}function mr(B,$){for(var L=-1,se=$.length,be=B.length;++L<se;)B[be+L]=$[L];return B}function Kl(B,$,L,se){var be=-1,Oe=B==null?0:B.length;for(se&&Oe&&(L=B[++be]);++be<Oe;)L=$(L,B[be],be,B);return L}function iB(B,$,L,se){var be=B==null?0:B.length;for(se&&be&&(L=B[--be]);be--;)L=$(L,B[be],be,B);return L}function Yl(B,$){for(var L=-1,se=B==null?0:B.length;++L<se;)if($(B[L],L,B))return!0;return!1}var oB=Jl("length");function sB(B){return B.split("")}function aB(B){return B.match(mT)||[]}function zp(B,$,L){var se;return L(B,function(be,Oe,st){if($(be,Oe,st))return se=Oe,!1}),se}function Fs(B,$,L,se){for(var be=B.length,Oe=L+(se?1:-1);se?Oe--:++Oe<be;)if($(B[Oe],Oe,B))return Oe;return-1}function gi(B,$,L){return $===$?_B(B,$,L):Fs(B,Zp,L)}function lB(B,$,L,se){for(var be=L-1,Oe=B.length;++be<Oe;)if(se(B[be],$))return be;return-1}function Zp(B){return B!==B}function $p(B,$){var L=B==null?0:B.length;return L?Ql(B,$)/L:jt}function Jl(B){return function($){return $==null?n:$[B]}}function Xl(B){return function($){return B==null?n:B[$]}}function Up(B,$,L,se,be){return be(B,function(Oe,st,$e){L=se?(se=!1,Oe):$(L,Oe,st,$e)}),L}function cB(B,$){var L=B.length;for(B.sort($);L--;)B[L]=B[L].value;return B}function Ql(B,$){for(var L,se=-1,be=B.length;++se<be;){var Oe=$(B[se]);Oe!==n&&(L=L===n?Oe:L+Oe)}return L}function ec(B,$){for(var L=-1,se=Array(B);++L<B;)se[L]=$(L);return se}function dB(B,$){return qe($,function(L){return[L,B[L]]})}function Wp(B){return B&&B.slice(0,Kp(B)+1).replace(Gl,"")}function Zt(B){return function($){return B($)}}function tc(B,$){return qe($,function(L){return B[L]})}function Do(B,$){return B.has($)}function Hp(B,$){for(var L=-1,se=B.length;++L<se&&gi($,B[L],0)>-1;);return L}function jp(B,$){for(var L=B.length;L--&&gi($,B[L],0)>-1;);return L}function uB(B,$){for(var L=B.length,se=0;L--;)B[L]===$&&++se;return se}var pB=Xl(KT),hB=Xl(YT);function fB(B){return"\\"+XT[B]}function mB(B,$){return B==null?n:B[$]}function yi(B){return WT.test(B)}function gB(B){return HT.test(B)}function yB(B){for(var $,L=[];!($=B.next()).done;)L.push($.value);return L}function nc(B){var $=-1,L=Array(B.size);return B.forEach(function(se,be){L[++$]=[be,se]}),L}function qp(B,$){return function(L){return B($(L))}}function gr(B,$){for(var L=-1,se=B.length,be=0,Oe=[];++L<se;){var st=B[L];(st===$||st===m)&&(B[L]=m,Oe[be++]=L)}return Oe}function Rs(B){var $=-1,L=Array(B.size);return B.forEach(function(se){L[++$]=se}),L}function vB(B){var $=-1,L=Array(B.size);return B.forEach(function(se){L[++$]=[se,se]}),L}function _B(B,$,L){for(var se=L-1,be=B.length;++se<be;)if(B[se]===$)return se;return-1}function CB(B,$,L){for(var se=L+1;se--;)if(B[se]===$)return se;return se}function vi(B){return yi(B)?bB(B):oB(B)}function _n(B){return yi(B)?xB(B):sB(B)}function Kp(B){for(var $=B.length;$--&&uT.test(B.charAt($)););return $}var wB=Xl(JT);function bB(B){for(var $=Wl.lastIndex=0;Wl.test(B);)++$;return $}function xB(B){return B.match(Wl)||[]}function kB(B){return B.match(UT)||[]}var SB=function B($){$=$==null?pt:_i.defaults(pt.Object(),$,_i.pick(pt,jT));var L=$.Array,se=$.Date,be=$.Error,Oe=$.Function,st=$.Math,$e=$.Object,rc=$.RegExp,EB=$.String,Yt=$.TypeError,Ms=L.prototype,TB=Oe.prototype,Ci=$e.prototype,Is=$["__core-js_shared__"],Ls=TB.toString,Ze=Ci.hasOwnProperty,BB=0,Yp=function(){var o=/[^.]+$/.exec(Is&&Is.keys&&Is.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Os=Ci.toString,AB=Ls.call($e),PB=pt._,VB=rc("^"+Ls.call(Ze).replace(Ol,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gs=Dp?$.Buffer:n,yr=$.Symbol,zs=$.Uint8Array,Jp=Gs?Gs.allocUnsafe:n,Zs=qp($e.getPrototypeOf,$e),Xp=$e.create,Qp=Ci.propertyIsEnumerable,$s=Ms.splice,eh=yr?yr.isConcatSpreadable:n,Fo=yr?yr.iterator:n,Gr=yr?yr.toStringTag:n,Us=function(){try{var o=Wr($e,"defineProperty");return o({},"",{}),o}catch{}}(),NB=$.clearTimeout!==pt.clearTimeout&&$.clearTimeout,DB=se&&se.now!==pt.Date.now&&se.now,FB=$.setTimeout!==pt.setTimeout&&$.setTimeout,Ws=st.ceil,Hs=st.floor,ic=$e.getOwnPropertySymbols,RB=Gs?Gs.isBuffer:n,th=$.isFinite,MB=Ms.join,IB=qp($e.keys,$e),at=st.max,vt=st.min,LB=se.now,OB=$.parseInt,nh=st.random,GB=Ms.reverse,oc=Wr($,"DataView"),Ro=Wr($,"Map"),sc=Wr($,"Promise"),wi=Wr($,"Set"),Mo=Wr($,"WeakMap"),Io=Wr($e,"create"),js=Mo&&new Mo,bi={},zB=Hr(oc),ZB=Hr(Ro),$B=Hr(sc),UB=Hr(wi),WB=Hr(Mo),qs=yr?yr.prototype:n,Lo=qs?qs.valueOf:n,rh=qs?qs.toString:n;function y(o){if(Qe(o)&&!ke(o)&&!(o instanceof De)){if(o instanceof Jt)return o;if(Ze.call(o,"__wrapped__"))return of(o)}return new Jt(o)}var xi=function(){function o(){}return function(a){if(!Je(a))return{};if(Xp)return Xp(a);o.prototype=a;var d=new o;return o.prototype=n,d}}();function Ks(){}function Jt(o,a){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}y.templateSettings={escape:oT,evaluate:sT,interpolate:pp,variable:"",imports:{_:y}},y.prototype=Ks.prototype,y.prototype.constructor=y,Jt.prototype=xi(Ks.prototype),Jt.prototype.constructor=Jt;function De(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=At,this.__views__=[]}function HB(){var o=new De(this.__wrapped__);return o.__actions__=Pt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Pt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Pt(this.__views__),o}function jB(){if(this.__filtered__){var o=new De(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function qB(){var o=this.__wrapped__.value(),a=this.__dir__,d=ke(o),h=a<0,g=d?o.length:0,_=sP(0,g,this.__views__),x=_.start,E=_.end,V=E-x,H=h?E:x-1,j=this.__iteratees__,q=j.length,te=0,le=vt(V,this.__takeCount__);if(!d||!h&&g==V&&le==V)return Th(o,this.__actions__);var fe=[];e:for(;V--&&te<le;){H+=a;for(var Pe=-1,me=o[H];++Pe<q;){var Ne=j[Pe],Fe=Ne.iteratee,Wt=Ne.type,Et=Fe(me);if(Wt==G)me=Et;else if(!Et){if(Wt==A)continue e;break e}}fe[te++]=me}return fe}De.prototype=xi(Ks.prototype),De.prototype.constructor=De;function zr(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function KB(){this.__data__=Io?Io(null):{},this.size=0}function YB(o){var a=this.has(o)&&delete this.__data__[o];return this.size-=a?1:0,a}function JB(o){var a=this.__data__;if(Io){var d=a[o];return d===p?n:d}return Ze.call(a,o)?a[o]:n}function XB(o){var a=this.__data__;return Io?a[o]!==n:Ze.call(a,o)}function QB(o,a){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Io&&a===n?p:a,this}zr.prototype.clear=KB,zr.prototype.delete=YB,zr.prototype.get=JB,zr.prototype.has=XB,zr.prototype.set=QB;function Gn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function eA(){this.__data__=[],this.size=0}function tA(o){var a=this.__data__,d=Ys(a,o);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():$s.call(a,d,1),--this.size,!0}function nA(o){var a=this.__data__,d=Ys(a,o);return d<0?n:a[d][1]}function rA(o){return Ys(this.__data__,o)>-1}function iA(o,a){var d=this.__data__,h=Ys(d,o);return h<0?(++this.size,d.push([o,a])):d[h][1]=a,this}Gn.prototype.clear=eA,Gn.prototype.delete=tA,Gn.prototype.get=nA,Gn.prototype.has=rA,Gn.prototype.set=iA;function zn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function oA(){this.size=0,this.__data__={hash:new zr,map:new(Ro||Gn),string:new zr}}function sA(o){var a=la(this,o).delete(o);return this.size-=a?1:0,a}function aA(o){return la(this,o).get(o)}function lA(o){return la(this,o).has(o)}function cA(o,a){var d=la(this,o),h=d.size;return d.set(o,a),this.size+=d.size==h?0:1,this}zn.prototype.clear=oA,zn.prototype.delete=sA,zn.prototype.get=aA,zn.prototype.has=lA,zn.prototype.set=cA;function Zr(o){var a=-1,d=o==null?0:o.length;for(this.__data__=new zn;++a<d;)this.add(o[a])}function dA(o){return this.__data__.set(o,p),this}function uA(o){return this.__data__.has(o)}Zr.prototype.add=Zr.prototype.push=dA,Zr.prototype.has=uA;function Cn(o){var a=this.__data__=new Gn(o);this.size=a.size}function pA(){this.__data__=new Gn,this.size=0}function hA(o){var a=this.__data__,d=a.delete(o);return this.size=a.size,d}function fA(o){return this.__data__.get(o)}function mA(o){return this.__data__.has(o)}function gA(o,a){var d=this.__data__;if(d instanceof Gn){var h=d.__data__;if(!Ro||h.length<s-1)return h.push([o,a]),this.size=++d.size,this;d=this.__data__=new zn(h)}return d.set(o,a),this.size=d.size,this}Cn.prototype.clear=pA,Cn.prototype.delete=hA,Cn.prototype.get=fA,Cn.prototype.has=mA,Cn.prototype.set=gA;function ih(o,a){var d=ke(o),h=!d&&jr(o),g=!d&&!h&&br(o),_=!d&&!h&&!g&&Ti(o),x=d||h||g||_,E=x?ec(o.length,EB):[],V=E.length;for(var H in o)(a||Ze.call(o,H))&&!(x&&(H=="length"||g&&(H=="offset"||H=="parent")||_&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Wn(H,V)))&&E.push(H);return E}function oh(o){var a=o.length;return a?o[yc(0,a-1)]:n}function yA(o,a){return ca(Pt(o),$r(a,0,o.length))}function vA(o){return ca(Pt(o))}function ac(o,a,d){(d!==n&&!wn(o[a],d)||d===n&&!(a in o))&&Zn(o,a,d)}function Oo(o,a,d){var h=o[a];(!(Ze.call(o,a)&&wn(h,d))||d===n&&!(a in o))&&Zn(o,a,d)}function Ys(o,a){for(var d=o.length;d--;)if(wn(o[d][0],a))return d;return-1}function _A(o,a,d,h){return vr(o,function(g,_,x){a(h,g,d(g),x)}),h}function sh(o,a){return o&&Pn(a,ut(a),o)}function CA(o,a){return o&&Pn(a,Nt(a),o)}function Zn(o,a,d){a=="__proto__"&&Us?Us(o,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[a]=d}function lc(o,a){for(var d=-1,h=a.length,g=L(h),_=o==null;++d<h;)g[d]=_?n:Zc(o,a[d]);return g}function $r(o,a,d){return o===o&&(d!==n&&(o=o<=d?o:d),a!==n&&(o=o>=a?o:a)),o}function Xt(o,a,d,h,g,_){var x,E=a&v,V=a&k,H=a&S;if(d&&(x=g?d(o,h,g,_):d(o)),x!==n)return x;if(!Je(o))return o;var j=ke(o);if(j){if(x=lP(o),!E)return Pt(o,x)}else{var q=_t(o),te=q==Bs||q==lp;if(br(o))return Ph(o,E);if(q==On||q==hi||te&&!g){if(x=V||te?{}:Kh(o),!E)return V?JA(o,CA(x,o)):YA(o,sh(x,o))}else{if(!Ue[q])return g?o:{};x=cP(o,q,E)}}_||(_=new Cn);var le=_.get(o);if(le)return le;_.set(o,x),Sf(o)?o.forEach(function(me){x.add(Xt(me,a,d,me,o,_))}):xf(o)&&o.forEach(function(me,Ne){x.set(Ne,Xt(me,a,d,Ne,o,_))});var fe=H?V?Bc:Tc:V?Nt:ut,Pe=j?n:fe(o);return Kt(Pe||o,function(me,Ne){Pe&&(Ne=me,me=o[Ne]),Oo(x,Ne,Xt(me,a,d,Ne,o,_))}),x}function wA(o){var a=ut(o);return function(d){return ah(d,o,a)}}function ah(o,a,d){var h=d.length;if(o==null)return!h;for(o=$e(o);h--;){var g=d[h],_=a[g],x=o[g];if(x===n&&!(g in o)||!_(x))return!1}return!0}function lh(o,a,d){if(typeof o!="function")throw new Yt(c);return Ho(function(){o.apply(n,d)},a)}function Go(o,a,d,h){var g=-1,_=Ds,x=!0,E=o.length,V=[],H=a.length;if(!E)return V;d&&(a=qe(a,Zt(d))),h?(_=ql,x=!1):a.length>=s&&(_=Do,x=!1,a=new Zr(a));e:for(;++g<E;){var j=o[g],q=d==null?j:d(j);if(j=h||j!==0?j:0,x&&q===q){for(var te=H;te--;)if(a[te]===q)continue e;V.push(j)}else _(a,q,h)||V.push(j)}return V}var vr=Rh(An),ch=Rh(dc,!0);function bA(o,a){var d=!0;return vr(o,function(h,g,_){return d=!!a(h,g,_),d}),d}function Js(o,a,d){for(var h=-1,g=o.length;++h<g;){var _=o[h],x=a(_);if(x!=null&&(E===n?x===x&&!Ut(x):d(x,E)))var E=x,V=_}return V}function xA(o,a,d,h){var g=o.length;for(d=Te(d),d<0&&(d=-d>g?0:g+d),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=d>h?0:Tf(h);d<h;)o[d++]=a;return o}function dh(o,a){var d=[];return vr(o,function(h,g,_){a(h,g,_)&&d.push(h)}),d}function ht(o,a,d,h,g){var _=-1,x=o.length;for(d||(d=uP),g||(g=[]);++_<x;){var E=o[_];a>0&&d(E)?a>1?ht(E,a-1,d,h,g):mr(g,E):h||(g[g.length]=E)}return g}var cc=Mh(),uh=Mh(!0);function An(o,a){return o&&cc(o,a,ut)}function dc(o,a){return o&&uh(o,a,ut)}function Xs(o,a){return fr(a,function(d){return Hn(o[d])})}function Ur(o,a){a=Cr(a,o);for(var d=0,h=a.length;o!=null&&d<h;)o=o[Vn(a[d++])];return d&&d==h?o:n}function ph(o,a,d){var h=a(o);return ke(o)?h:mr(h,d(o))}function kt(o){return o==null?o===n?XE:YE:Gr&&Gr in $e(o)?oP(o):vP(o)}function uc(o,a){return o>a}function kA(o,a){return o!=null&&Ze.call(o,a)}function SA(o,a){return o!=null&&a in $e(o)}function EA(o,a,d){return o>=vt(a,d)&&o<at(a,d)}function pc(o,a,d){for(var h=d?ql:Ds,g=o[0].length,_=o.length,x=_,E=L(_),V=1/0,H=[];x--;){var j=o[x];x&&a&&(j=qe(j,Zt(a))),V=vt(j.length,V),E[x]=!d&&(a||g>=120&&j.length>=120)?new Zr(x&&j):n}j=o[0];var q=-1,te=E[0];e:for(;++q<g&&H.length<V;){var le=j[q],fe=a?a(le):le;if(le=d||le!==0?le:0,!(te?Do(te,fe):h(H,fe,d))){for(x=_;--x;){var Pe=E[x];if(!(Pe?Do(Pe,fe):h(o[x],fe,d)))continue e}te&&te.push(fe),H.push(le)}}return H}function TA(o,a,d,h){return An(o,function(g,_,x){a(h,d(g),_,x)}),h}function zo(o,a,d){a=Cr(a,o),o=Qh(o,a);var h=o==null?o:o[Vn(en(a))];return h==null?n:zt(h,o,d)}function hh(o){return Qe(o)&&kt(o)==hi}function BA(o){return Qe(o)&&kt(o)==No}function AA(o){return Qe(o)&&kt(o)==To}function Zo(o,a,d,h,g){return o===a?!0:o==null||a==null||!Qe(o)&&!Qe(a)?o!==o&&a!==a:PA(o,a,d,h,Zo,g)}function PA(o,a,d,h,g,_){var x=ke(o),E=ke(a),V=x?Es:_t(o),H=E?Es:_t(a);V=V==hi?On:V,H=H==hi?On:H;var j=V==On,q=H==On,te=V==H;if(te&&br(o)){if(!br(a))return!1;x=!0,j=!1}if(te&&!j)return _||(_=new Cn),x||Ti(o)?Hh(o,a,d,h,g,_):rP(o,a,V,d,h,g,_);if(!(d&F)){var le=j&&Ze.call(o,"__wrapped__"),fe=q&&Ze.call(a,"__wrapped__");if(le||fe){var Pe=le?o.value():o,me=fe?a.value():a;return _||(_=new Cn),g(Pe,me,d,h,_)}}return te?(_||(_=new Cn),iP(o,a,d,h,g,_)):!1}function VA(o){return Qe(o)&&_t(o)==yn}function hc(o,a,d,h){var g=d.length,_=g,x=!h;if(o==null)return!_;for(o=$e(o);g--;){var E=d[g];if(x&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++g<_;){E=d[g];var V=E[0],H=o[V],j=E[1];if(x&&E[2]){if(H===n&&!(V in o))return!1}else{var q=new Cn;if(h)var te=h(H,j,V,o,a,q);if(!(te===n?Zo(j,H,F|T,h,q):te))return!1}}return!0}function fh(o){if(!Je(o)||hP(o))return!1;var a=Hn(o)?VB:wT;return a.test(Hr(o))}function NA(o){return Qe(o)&&kt(o)==Ao}function DA(o){return Qe(o)&&_t(o)==vn}function FA(o){return Qe(o)&&ma(o.length)&&!!He[kt(o)]}function mh(o){return typeof o=="function"?o:o==null?Dt:typeof o=="object"?ke(o)?vh(o[0],o[1]):yh(o):Lf(o)}function fc(o){if(!Wo(o))return IB(o);var a=[];for(var d in $e(o))Ze.call(o,d)&&d!="constructor"&&a.push(d);return a}function RA(o){if(!Je(o))return yP(o);var a=Wo(o),d=[];for(var h in o)h=="constructor"&&(a||!Ze.call(o,h))||d.push(h);return d}function mc(o,a){return o<a}function gh(o,a){var d=-1,h=Vt(o)?L(o.length):[];return vr(o,function(g,_,x){h[++d]=a(g,_,x)}),h}function yh(o){var a=Pc(o);return a.length==1&&a[0][2]?Jh(a[0][0],a[0][1]):function(d){return d===o||hc(d,o,a)}}function vh(o,a){return Nc(o)&&Yh(a)?Jh(Vn(o),a):function(d){var h=Zc(d,o);return h===n&&h===a?$c(d,o):Zo(a,h,F|T)}}function Qs(o,a,d,h,g){o!==a&&cc(a,function(_,x){if(g||(g=new Cn),Je(_))MA(o,a,x,d,Qs,h,g);else{var E=h?h(Fc(o,x),_,x+"",o,a,g):n;E===n&&(E=_),ac(o,x,E)}},Nt)}function MA(o,a,d,h,g,_,x){var E=Fc(o,d),V=Fc(a,d),H=x.get(V);if(H){ac(o,d,H);return}var j=_?_(E,V,d+"",o,a,x):n,q=j===n;if(q){var te=ke(V),le=!te&&br(V),fe=!te&&!le&&Ti(V);j=V,te||le||fe?ke(E)?j=E:tt(E)?j=Pt(E):le?(q=!1,j=Ph(V,!0)):fe?(q=!1,j=Vh(V,!0)):j=[]:jo(V)||jr(V)?(j=E,jr(E)?j=Bf(E):(!Je(E)||Hn(E))&&(j=Kh(V))):q=!1}q&&(x.set(V,j),g(j,V,h,_,x),x.delete(V)),ac(o,d,j)}function _h(o,a){var d=o.length;if(d)return a+=a<0?d:0,Wn(a,d)?o[a]:n}function Ch(o,a,d){a.length?a=qe(a,function(_){return ke(_)?function(x){return Ur(x,_.length===1?_[0]:_)}:_}):a=[Dt];var h=-1;a=qe(a,Zt(pe()));var g=gh(o,function(_,x,E){var V=qe(a,function(H){return H(_)});return{criteria:V,index:++h,value:_}});return cB(g,function(_,x){return KA(_,x,d)})}function IA(o,a){return wh(o,a,function(d,h){return $c(o,h)})}function wh(o,a,d){for(var h=-1,g=a.length,_={};++h<g;){var x=a[h],E=Ur(o,x);d(E,x)&&$o(_,Cr(x,o),E)}return _}function LA(o){return function(a){return Ur(a,o)}}function gc(o,a,d,h){var g=h?lB:gi,_=-1,x=a.length,E=o;for(o===a&&(a=Pt(a)),d&&(E=qe(o,Zt(d)));++_<x;)for(var V=0,H=a[_],j=d?d(H):H;(V=g(E,j,V,h))>-1;)E!==o&&$s.call(E,V,1),$s.call(o,V,1);return o}function bh(o,a){for(var d=o?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==_){var _=g;Wn(g)?$s.call(o,g,1):Cc(o,g)}}return o}function yc(o,a){return o+Hs(nh()*(a-o+1))}function OA(o,a,d,h){for(var g=-1,_=at(Ws((a-o)/(d||1)),0),x=L(_);_--;)x[h?_:++g]=o,o+=d;return x}function vc(o,a){var d="";if(!o||a<1||a>xe)return d;do a%2&&(d+=o),a=Hs(a/2),a&&(o+=o);while(a);return d}function Ve(o,a){return Rc(Xh(o,a,Dt),o+"")}function GA(o){return oh(Bi(o))}function zA(o,a){var d=Bi(o);return ca(d,$r(a,0,d.length))}function $o(o,a,d,h){if(!Je(o))return o;a=Cr(a,o);for(var g=-1,_=a.length,x=_-1,E=o;E!=null&&++g<_;){var V=Vn(a[g]),H=d;if(V==="__proto__"||V==="constructor"||V==="prototype")return o;if(g!=x){var j=E[V];H=h?h(j,V,E):n,H===n&&(H=Je(j)?j:Wn(a[g+1])?[]:{})}Oo(E,V,H),E=E[V]}return o}var xh=js?function(o,a){return js.set(o,a),o}:Dt,ZA=Us?function(o,a){return Us(o,"toString",{configurable:!0,enumerable:!1,value:Wc(a),writable:!0})}:Dt;function $A(o){return ca(Bi(o))}function Qt(o,a,d){var h=-1,g=o.length;a<0&&(a=-a>g?0:g+a),d=d>g?g:d,d<0&&(d+=g),g=a>d?0:d-a>>>0,a>>>=0;for(var _=L(g);++h<g;)_[h]=o[h+a];return _}function UA(o,a){var d;return vr(o,function(h,g,_){return d=a(h,g,_),!d}),!!d}function ea(o,a,d){var h=0,g=o==null?h:o.length;if(typeof a=="number"&&a===a&&g<=Lr){for(;h<g;){var _=h+g>>>1,x=o[_];x!==null&&!Ut(x)&&(d?x<=a:x<a)?h=_+1:g=_}return g}return _c(o,a,Dt,d)}function _c(o,a,d,h){var g=0,_=o==null?0:o.length;if(_===0)return 0;a=d(a);for(var x=a!==a,E=a===null,V=Ut(a),H=a===n;g<_;){var j=Hs((g+_)/2),q=d(o[j]),te=q!==n,le=q===null,fe=q===q,Pe=Ut(q);if(x)var me=h||fe;else H?me=fe&&(h||te):E?me=fe&&te&&(h||!le):V?me=fe&&te&&!le&&(h||!Pe):le||Pe?me=!1:me=h?q<=a:q<a;me?g=j+1:_=j}return vt(_,ko)}function kh(o,a){for(var d=-1,h=o.length,g=0,_=[];++d<h;){var x=o[d],E=a?a(x):x;if(!d||!wn(E,V)){var V=E;_[g++]=x===0?0:x}}return _}function Sh(o){return typeof o=="number"?o:Ut(o)?jt:+o}function $t(o){if(typeof o=="string")return o;if(ke(o))return qe(o,$t)+"";if(Ut(o))return rh?rh.call(o):"";var a=o+"";return a=="0"&&1/o==-ve?"-0":a}function _r(o,a,d){var h=-1,g=Ds,_=o.length,x=!0,E=[],V=E;if(d)x=!1,g=ql;else if(_>=s){var H=a?null:tP(o);if(H)return Rs(H);x=!1,g=Do,V=new Zr}else V=a?[]:E;e:for(;++h<_;){var j=o[h],q=a?a(j):j;if(j=d||j!==0?j:0,x&&q===q){for(var te=V.length;te--;)if(V[te]===q)continue e;a&&V.push(q),E.push(j)}else g(V,q,d)||(V!==E&&V.push(q),E.push(j))}return E}function Cc(o,a){return a=Cr(a,o),o=Qh(o,a),o==null||delete o[Vn(en(a))]}function Eh(o,a,d,h){return $o(o,a,d(Ur(o,a)),h)}function ta(o,a,d,h){for(var g=o.length,_=h?g:-1;(h?_--:++_<g)&&a(o[_],_,o););return d?Qt(o,h?0:_,h?_+1:g):Qt(o,h?_+1:0,h?g:_)}function Th(o,a){var d=o;return d instanceof De&&(d=d.value()),Kl(a,function(h,g){return g.func.apply(g.thisArg,mr([h],g.args))},d)}function wc(o,a,d){var h=o.length;if(h<2)return h?_r(o[0]):[];for(var g=-1,_=L(h);++g<h;)for(var x=o[g],E=-1;++E<h;)E!=g&&(_[g]=Go(_[g]||x,o[E],a,d));return _r(ht(_,1),a,d)}function Bh(o,a,d){for(var h=-1,g=o.length,_=a.length,x={};++h<g;){var E=h<_?a[h]:n;d(x,o[h],E)}return x}function bc(o){return tt(o)?o:[]}function xc(o){return typeof o=="function"?o:Dt}function Cr(o,a){return ke(o)?o:Nc(o,a)?[o]:rf(ze(o))}var WA=Ve;function wr(o,a,d){var h=o.length;return d=d===n?h:d,!a&&d>=h?o:Qt(o,a,d)}var Ah=NB||function(o){return pt.clearTimeout(o)};function Ph(o,a){if(a)return o.slice();var d=o.length,h=Jp?Jp(d):new o.constructor(d);return o.copy(h),h}function kc(o){var a=new o.constructor(o.byteLength);return new zs(a).set(new zs(o)),a}function HA(o,a){var d=a?kc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function jA(o){var a=new o.constructor(o.source,hp.exec(o));return a.lastIndex=o.lastIndex,a}function qA(o){return Lo?$e(Lo.call(o)):{}}function Vh(o,a){var d=a?kc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Nh(o,a){if(o!==a){var d=o!==n,h=o===null,g=o===o,_=Ut(o),x=a!==n,E=a===null,V=a===a,H=Ut(a);if(!E&&!H&&!_&&o>a||_&&x&&V&&!E&&!H||h&&x&&V||!d&&V||!g)return 1;if(!h&&!_&&!H&&o<a||H&&d&&g&&!h&&!_||E&&d&&g||!x&&g||!V)return-1}return 0}function KA(o,a,d){for(var h=-1,g=o.criteria,_=a.criteria,x=g.length,E=d.length;++h<x;){var V=Nh(g[h],_[h]);if(V){if(h>=E)return V;var H=d[h];return V*(H=="desc"?-1:1)}}return o.index-a.index}function Dh(o,a,d,h){for(var g=-1,_=o.length,x=d.length,E=-1,V=a.length,H=at(_-x,0),j=L(V+H),q=!h;++E<V;)j[E]=a[E];for(;++g<x;)(q||g<_)&&(j[d[g]]=o[g]);for(;H--;)j[E++]=o[g++];return j}function Fh(o,a,d,h){for(var g=-1,_=o.length,x=-1,E=d.length,V=-1,H=a.length,j=at(_-E,0),q=L(j+H),te=!h;++g<j;)q[g]=o[g];for(var le=g;++V<H;)q[le+V]=a[V];for(;++x<E;)(te||g<_)&&(q[le+d[x]]=o[g++]);return q}function Pt(o,a){var d=-1,h=o.length;for(a||(a=L(h));++d<h;)a[d]=o[d];return a}function Pn(o,a,d,h){var g=!d;d||(d={});for(var _=-1,x=a.length;++_<x;){var E=a[_],V=h?h(d[E],o[E],E,d,o):n;V===n&&(V=o[E]),g?Zn(d,E,V):Oo(d,E,V)}return d}function YA(o,a){return Pn(o,Vc(o),a)}function JA(o,a){return Pn(o,jh(o),a)}function na(o,a){return function(d,h){var g=ke(d)?nB:_A,_=a?a():{};return g(d,o,pe(h,2),_)}}function ki(o){return Ve(function(a,d){var h=-1,g=d.length,_=g>1?d[g-1]:n,x=g>2?d[2]:n;for(_=o.length>3&&typeof _=="function"?(g--,_):n,x&&St(d[0],d[1],x)&&(_=g<3?n:_,g=1),a=$e(a);++h<g;){var E=d[h];E&&o(a,E,h,_)}return a})}function Rh(o,a){return function(d,h){if(d==null)return d;if(!Vt(d))return o(d,h);for(var g=d.length,_=a?g:-1,x=$e(d);(a?_--:++_<g)&&h(x[_],_,x)!==!1;);return d}}function Mh(o){return function(a,d,h){for(var g=-1,_=$e(a),x=h(a),E=x.length;E--;){var V=x[o?E:++g];if(d(_[V],V,_)===!1)break}return a}}function XA(o,a,d){var h=a&N,g=Uo(o);function _(){var x=this&&this!==pt&&this instanceof _?g:o;return x.apply(h?d:this,arguments)}return _}function Ih(o){return function(a){a=ze(a);var d=yi(a)?_n(a):n,h=d?d[0]:a.charAt(0),g=d?wr(d,1).join(""):a.slice(1);return h[o]()+g}}function Si(o){return function(a){return Kl(Mf(Rf(a).replace(ZT,"")),o,"")}}function Uo(o){return function(){var a=arguments;switch(a.length){case 0:return new o;case 1:return new o(a[0]);case 2:return new o(a[0],a[1]);case 3:return new o(a[0],a[1],a[2]);case 4:return new o(a[0],a[1],a[2],a[3]);case 5:return new o(a[0],a[1],a[2],a[3],a[4]);case 6:return new o(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new o(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var d=xi(o.prototype),h=o.apply(d,a);return Je(h)?h:d}}function QA(o,a,d){var h=Uo(o);function g(){for(var _=arguments.length,x=L(_),E=_,V=Ei(g);E--;)x[E]=arguments[E];var H=_<3&&x[0]!==V&&x[_-1]!==V?[]:gr(x,V);if(_-=H.length,_<d)return Zh(o,a,ra,g.placeholder,n,x,H,n,n,d-_);var j=this&&this!==pt&&this instanceof g?h:o;return zt(j,this,x)}return g}function Lh(o){return function(a,d,h){var g=$e(a);if(!Vt(a)){var _=pe(d,3);a=ut(a),d=function(E){return _(g[E],E,g)}}var x=o(a,d,h);return x>-1?g[_?a[x]:x]:n}}function Oh(o){return Un(function(a){var d=a.length,h=d,g=Jt.prototype.thru;for(o&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Yt(c);if(g&&!x&&aa(_)=="wrapper")var x=new Jt([],!0)}for(h=x?h:d;++h<d;){_=a[h];var E=aa(_),V=E=="wrapper"?Ac(_):n;V&&Dc(V[0])&&V[1]==(z|Q|R|P)&&!V[4].length&&V[9]==1?x=x[aa(V[0])].apply(x,V[3]):x=_.length==1&&Dc(_)?x[E]():x.thru(_)}return function(){var H=arguments,j=H[0];if(x&&H.length==1&&ke(j))return x.plant(j).value();for(var q=0,te=d?a[q].apply(this,H):j;++q<d;)te=a[q].call(this,te);return te}})}function ra(o,a,d,h,g,_,x,E,V,H){var j=a&z,q=a&N,te=a&C,le=a&(Q|M),fe=a&Z,Pe=te?n:Uo(o);function me(){for(var Ne=arguments.length,Fe=L(Ne),Wt=Ne;Wt--;)Fe[Wt]=arguments[Wt];if(le)var Et=Ei(me),Ht=uB(Fe,Et);if(h&&(Fe=Dh(Fe,h,g,le)),_&&(Fe=Fh(Fe,_,x,le)),Ne-=Ht,le&&Ne<H){var nt=gr(Fe,Et);return Zh(o,a,ra,me.placeholder,d,Fe,nt,E,V,H-Ne)}var bn=q?d:this,qn=te?bn[o]:o;return Ne=Fe.length,E?Fe=_P(Fe,E):fe&&Ne>1&&Fe.reverse(),j&&V<Ne&&(Fe.length=V),this&&this!==pt&&this instanceof me&&(qn=Pe||Uo(qn)),qn.apply(bn,Fe)}return me}function Gh(o,a){return function(d,h){return TA(d,o,a(h),{})}}function ia(o,a){return function(d,h){var g;if(d===n&&h===n)return a;if(d!==n&&(g=d),h!==n){if(g===n)return h;typeof d=="string"||typeof h=="string"?(d=$t(d),h=$t(h)):(d=Sh(d),h=Sh(h)),g=o(d,h)}return g}}function Sc(o){return Un(function(a){return a=qe(a,Zt(pe())),Ve(function(d){var h=this;return o(a,function(g){return zt(g,h,d)})})})}function oa(o,a){a=a===n?" ":$t(a);var d=a.length;if(d<2)return d?vc(a,o):a;var h=vc(a,Ws(o/vi(a)));return yi(a)?wr(_n(h),0,o).join(""):h.slice(0,o)}function eP(o,a,d,h){var g=a&N,_=Uo(o);function x(){for(var E=-1,V=arguments.length,H=-1,j=h.length,q=L(j+V),te=this&&this!==pt&&this instanceof x?_:o;++H<j;)q[H]=h[H];for(;V--;)q[H++]=arguments[++E];return zt(te,g?d:this,q)}return x}function zh(o){return function(a,d,h){return h&&typeof h!="number"&&St(a,d,h)&&(d=h=n),a=jn(a),d===n?(d=a,a=0):d=jn(d),h=h===n?a<d?1:-1:jn(h),OA(a,d,h,o)}}function sa(o){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=tn(a),d=tn(d)),o(a,d)}}function Zh(o,a,d,h,g,_,x,E,V,H){var j=a&Q,q=j?x:n,te=j?n:x,le=j?_:n,fe=j?n:_;a|=j?R:U,a&=~(j?U:R),a&I||(a&=~(N|C));var Pe=[o,a,g,le,q,fe,te,E,V,H],me=d.apply(n,Pe);return Dc(o)&&ef(me,Pe),me.placeholder=h,tf(me,o,a)}function Ec(o){var a=st[o];return function(d,h){if(d=tn(d),h=h==null?0:vt(Te(h),292),h&&th(d)){var g=(ze(d)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(ze(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var tP=wi&&1/Rs(new wi([,-0]))[1]==ve?function(o){return new wi(o)}:qc;function $h(o){return function(a){var d=_t(a);return d==yn?nc(a):d==vn?vB(a):dB(a,o(a))}}function $n(o,a,d,h,g,_,x,E){var V=a&C;if(!V&&typeof o!="function")throw new Yt(c);var H=h?h.length:0;if(H||(a&=~(R|U),h=g=n),x=x===n?x:at(Te(x),0),E=E===n?E:Te(E),H-=g?g.length:0,a&U){var j=h,q=g;h=g=n}var te=V?n:Ac(o),le=[o,a,d,h,g,j,q,_,x,E];if(te&&gP(le,te),o=le[0],a=le[1],d=le[2],h=le[3],g=le[4],E=le[9]=le[9]===n?V?0:o.length:at(le[9]-H,0),!E&&a&(Q|M)&&(a&=~(Q|M)),!a||a==N)var fe=XA(o,a,d);else a==Q||a==M?fe=QA(o,a,E):(a==R||a==(N|R))&&!g.length?fe=eP(o,a,d,h):fe=ra.apply(n,le);var Pe=te?xh:ef;return tf(Pe(fe,le),o,a)}function Uh(o,a,d,h){return o===n||wn(o,Ci[d])&&!Ze.call(h,d)?a:o}function Wh(o,a,d,h,g,_){return Je(o)&&Je(a)&&(_.set(a,o),Qs(o,a,n,Wh,_),_.delete(a)),o}function nP(o){return jo(o)?n:o}function Hh(o,a,d,h,g,_){var x=d&F,E=o.length,V=a.length;if(E!=V&&!(x&&V>E))return!1;var H=_.get(o),j=_.get(a);if(H&&j)return H==a&&j==o;var q=-1,te=!0,le=d&T?new Zr:n;for(_.set(o,a),_.set(a,o);++q<E;){var fe=o[q],Pe=a[q];if(h)var me=x?h(Pe,fe,q,a,o,_):h(fe,Pe,q,o,a,_);if(me!==n){if(me)continue;te=!1;break}if(le){if(!Yl(a,function(Ne,Fe){if(!Do(le,Fe)&&(fe===Ne||g(fe,Ne,d,h,_)))return le.push(Fe)})){te=!1;break}}else if(!(fe===Pe||g(fe,Pe,d,h,_))){te=!1;break}}return _.delete(o),_.delete(a),te}function rP(o,a,d,h,g,_,x){switch(d){case fi:if(o.byteLength!=a.byteLength||o.byteOffset!=a.byteOffset)return!1;o=o.buffer,a=a.buffer;case No:return!(o.byteLength!=a.byteLength||!_(new zs(o),new zs(a)));case Eo:case To:case Bo:return wn(+o,+a);case Ts:return o.name==a.name&&o.message==a.message;case Ao:case Po:return o==a+"";case yn:var E=nc;case vn:var V=h&F;if(E||(E=Rs),o.size!=a.size&&!V)return!1;var H=x.get(o);if(H)return H==a;h|=T,x.set(o,a);var j=Hh(E(o),E(a),h,g,_,x);return x.delete(o),j;case As:if(Lo)return Lo.call(o)==Lo.call(a)}return!1}function iP(o,a,d,h,g,_){var x=d&F,E=Tc(o),V=E.length,H=Tc(a),j=H.length;if(V!=j&&!x)return!1;for(var q=V;q--;){var te=E[q];if(!(x?te in a:Ze.call(a,te)))return!1}var le=_.get(o),fe=_.get(a);if(le&&fe)return le==a&&fe==o;var Pe=!0;_.set(o,a),_.set(a,o);for(var me=x;++q<V;){te=E[q];var Ne=o[te],Fe=a[te];if(h)var Wt=x?h(Fe,Ne,te,a,o,_):h(Ne,Fe,te,o,a,_);if(!(Wt===n?Ne===Fe||g(Ne,Fe,d,h,_):Wt)){Pe=!1;break}me||(me=te=="constructor")}if(Pe&&!me){var Et=o.constructor,Ht=a.constructor;Et!=Ht&&"constructor"in o&&"constructor"in a&&!(typeof Et=="function"&&Et instanceof Et&&typeof Ht=="function"&&Ht instanceof Ht)&&(Pe=!1)}return _.delete(o),_.delete(a),Pe}function Un(o){return Rc(Xh(o,n,lf),o+"")}function Tc(o){return ph(o,ut,Vc)}function Bc(o){return ph(o,Nt,jh)}var Ac=js?function(o){return js.get(o)}:qc;function aa(o){for(var a=o.name+"",d=bi[a],h=Ze.call(bi,a)?d.length:0;h--;){var g=d[h],_=g.func;if(_==null||_==o)return g.name}return a}function Ei(o){var a=Ze.call(y,"placeholder")?y:o;return a.placeholder}function pe(){var o=y.iteratee||Hc;return o=o===Hc?mh:o,arguments.length?o(arguments[0],arguments[1]):o}function la(o,a){var d=o.__data__;return pP(a)?d[typeof a=="string"?"string":"hash"]:d.map}function Pc(o){for(var a=ut(o),d=a.length;d--;){var h=a[d],g=o[h];a[d]=[h,g,Yh(g)]}return a}function Wr(o,a){var d=mB(o,a);return fh(d)?d:n}function oP(o){var a=Ze.call(o,Gr),d=o[Gr];try{o[Gr]=n;var h=!0}catch{}var g=Os.call(o);return h&&(a?o[Gr]=d:delete o[Gr]),g}var Vc=ic?function(o){return o==null?[]:(o=$e(o),fr(ic(o),function(a){return Qp.call(o,a)}))}:Kc,jh=ic?function(o){for(var a=[];o;)mr(a,Vc(o)),o=Zs(o);return a}:Kc,_t=kt;(oc&&_t(new oc(new ArrayBuffer(1)))!=fi||Ro&&_t(new Ro)!=yn||sc&&_t(sc.resolve())!=cp||wi&&_t(new wi)!=vn||Mo&&_t(new Mo)!=Vo)&&(_t=function(o){var a=kt(o),d=a==On?o.constructor:n,h=d?Hr(d):"";if(h)switch(h){case zB:return fi;case ZB:return yn;case $B:return cp;case UB:return vn;case WB:return Vo}return a});function sP(o,a,d){for(var h=-1,g=d.length;++h<g;){var _=d[h],x=_.size;switch(_.type){case"drop":o+=x;break;case"dropRight":a-=x;break;case"take":a=vt(a,o+x);break;case"takeRight":o=at(o,a-x);break}}return{start:o,end:a}}function aP(o){var a=o.match(hT);return a?a[1].split(fT):[]}function qh(o,a,d){a=Cr(a,o);for(var h=-1,g=a.length,_=!1;++h<g;){var x=Vn(a[h]);if(!(_=o!=null&&d(o,x)))break;o=o[x]}return _||++h!=g?_:(g=o==null?0:o.length,!!g&&ma(g)&&Wn(x,g)&&(ke(o)||jr(o)))}function lP(o){var a=o.length,d=new o.constructor(a);return a&&typeof o[0]=="string"&&Ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function Kh(o){return typeof o.constructor=="function"&&!Wo(o)?xi(Zs(o)):{}}function cP(o,a,d){var h=o.constructor;switch(a){case No:return kc(o);case Eo:case To:return new h(+o);case fi:return HA(o,d);case Pl:case Vl:case Nl:case Dl:case Fl:case Rl:case Ml:case Il:case Ll:return Vh(o,d);case yn:return new h;case Bo:case Po:return new h(o);case Ao:return jA(o);case vn:return new h;case As:return qA(o)}}function dP(o,a){var d=a.length;if(!d)return o;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),o.replace(pT,`{
|
|
70
|
+
*/Bs.exports,function(t,e){(function(){var n,i="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,S=2,E=4,M=1,V=2,F=1,C=2,G=4,Q=8,I=16,L=32,U=64,T=128,k=256,O=512,A=30,q="...",se=800,$=16,N=1,Z=2,Y=3,pe=1/0,we=9007199254740991,Ct=17976931348623157e292,Tt=NaN,ht=4294967295,yr=ht-1,An=ht>>>1,vr=[["ary",T],["bind",F],["bindKey",C],["curry",Q],["curryRight",I],["flip",O],["partial",L],["partialRight",U],["rearg",k]],zn="[object Arguments]",Ge="[object Array]",Ps="[object AsyncFunction]",Bo="[object Boolean]",Vo="[object Date]",JE="[object DOMException]",Ds="[object Error]",Fs="[object Function]",fp="[object GeneratorFunction]",vn="[object Map]",Ao="[object Number]",XE="[object Null]",Zn="[object Object]",mp="[object Promise]",QE="[object Proxy]",No="[object RegExp]",_n="[object Set]",Po="[object String]",Rs="[object Symbol]",eT="[object Undefined]",Do="[object WeakMap]",tT="[object WeakSet]",Fo="[object ArrayBuffer]",vi="[object DataView]",Fl="[object Float32Array]",Rl="[object Float64Array]",Ml="[object Int8Array]",Il="[object Int16Array]",Ll="[object Int32Array]",Ol="[object Uint8Array]",Gl="[object Uint8ClampedArray]",zl="[object Uint16Array]",Zl="[object Uint32Array]",nT=/\b__p \+= '';/g,rT=/\b(__p \+=) '' \+/g,iT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gp=/&(?:amp|lt|gt|quot|#39);/g,yp=/[&<>"']/g,oT=RegExp(gp.source),sT=RegExp(yp.source),aT=/<%-([\s\S]+?)%>/g,lT=/<%([\s\S]+?)%>/g,vp=/<%=([\s\S]+?)%>/g,cT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dT=/^\w*$/,uT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ul=/[\\^$.*+?()[\]{}|]/g,pT=RegExp(Ul.source),$l=/^\s+/,hT=/\s/,fT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mT=/\{\n\/\* \[wrapped with (.+)\] \*/,gT=/,? & /,yT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vT=/[()=,{}\[\]\/\s]/,_T=/\\(\\)?/g,CT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_p=/\w*$/,wT=/^[-+]0x[0-9a-f]+$/i,bT=/^0b[01]+$/i,xT=/^\[object .+?Constructor\]$/,kT=/^0o[0-7]+$/i,ST=/^(?:0|[1-9]\d*)$/,ET=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ms=/($^)/,TT=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",BT="\\u0300-\\u036f",VT="\\ufe20-\\ufe2f",AT="\\u20d0-\\u20ff",Cp=BT+VT+AT,wp="\\u2700-\\u27bf",bp="a-z\\xdf-\\xf6\\xf8-\\xff",NT="\\xac\\xb1\\xd7\\xf7",PT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",DT="\\u2000-\\u206f",FT=" \\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",xp="A-Z\\xc0-\\xd6\\xd8-\\xde",kp="\\ufe0e\\ufe0f",Sp=NT+PT+DT+FT,Wl="['’]",RT="["+Is+"]",Ep="["+Sp+"]",Ls="["+Cp+"]",Tp="\\d+",MT="["+wp+"]",Bp="["+bp+"]",Vp="[^"+Is+Sp+Tp+wp+bp+xp+"]",Hl="\\ud83c[\\udffb-\\udfff]",IT="(?:"+Ls+"|"+Hl+")",Ap="[^"+Is+"]",jl="(?:\\ud83c[\\udde6-\\uddff]){2}",ql="[\\ud800-\\udbff][\\udc00-\\udfff]",_i="["+xp+"]",Np="\\u200d",Pp="(?:"+Bp+"|"+Vp+")",LT="(?:"+_i+"|"+Vp+")",Dp="(?:"+Wl+"(?:d|ll|m|re|s|t|ve))?",Fp="(?:"+Wl+"(?:D|LL|M|RE|S|T|VE))?",Rp=IT+"?",Mp="["+kp+"]?",OT="(?:"+Np+"(?:"+[Ap,jl,ql].join("|")+")"+Mp+Rp+")*",GT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ip=Mp+Rp+OT,ZT="(?:"+[MT,jl,ql].join("|")+")"+Ip,UT="(?:"+[Ap+Ls+"?",Ls,jl,ql,RT].join("|")+")",$T=RegExp(Wl,"g"),WT=RegExp(Ls,"g"),Kl=RegExp(Hl+"(?="+Hl+")|"+UT+Ip,"g"),HT=RegExp([_i+"?"+Bp+"+"+Dp+"(?="+[Ep,_i,"$"].join("|")+")",LT+"+"+Fp+"(?="+[Ep,_i+Pp,"$"].join("|")+")",_i+"?"+Pp+"+"+Dp,_i+"+"+Fp,zT,GT,Tp,ZT].join("|"),"g"),jT=RegExp("["+Np+Is+Cp+kp+"]"),qT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,KT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],YT=-1,qe={};qe[Fl]=qe[Rl]=qe[Ml]=qe[Il]=qe[Ll]=qe[Ol]=qe[Gl]=qe[zl]=qe[Zl]=!0,qe[zn]=qe[Ge]=qe[Fo]=qe[Bo]=qe[vi]=qe[Vo]=qe[Ds]=qe[Fs]=qe[vn]=qe[Ao]=qe[Zn]=qe[No]=qe[_n]=qe[Po]=qe[Do]=!1;var He={};He[zn]=He[Ge]=He[Fo]=He[vi]=He[Bo]=He[Vo]=He[Fl]=He[Rl]=He[Ml]=He[Il]=He[Ll]=He[vn]=He[Ao]=He[Zn]=He[No]=He[_n]=He[Po]=He[Rs]=He[Ol]=He[Gl]=He[zl]=He[Zl]=!0,He[Ds]=He[Fs]=He[Do]=!1;var JT={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},XT={"&":"&","<":"<",">":">",'"':""","'":"'"},QT={"&":"&","<":"<",">":">",""":'"',"'":"'"},eB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tB=parseFloat,nB=parseInt,Lp=typeof Di=="object"&&Di&&Di.Object===Object&&Di,rB=typeof self=="object"&&self&&self.Object===Object&&self,ft=Lp||rB||Function("return this")(),Yl=e&&!e.nodeType&&e,Ur=Yl&&!0&&t&&!t.nodeType&&t,Op=Ur&&Ur.exports===Yl,Jl=Op&&Lp.process,Kt=function(){try{var P=Ur&&Ur.require&&Ur.require("util").types;return P||Jl&&Jl.binding&&Jl.binding("util")}catch{}}(),Gp=Kt&&Kt.isArrayBuffer,zp=Kt&&Kt.isDate,Zp=Kt&&Kt.isMap,Up=Kt&&Kt.isRegExp,$p=Kt&&Kt.isSet,Wp=Kt&&Kt.isTypedArray;function Ut(P,W,z){switch(z.length){case 0:return P.call(W);case 1:return P.call(W,z[0]);case 2:return P.call(W,z[0],z[1]);case 3:return P.call(W,z[0],z[1],z[2])}return P.apply(W,z)}function iB(P,W,z,ae){for(var xe=-1,ze=P==null?0:P.length;++xe<ze;){var at=P[xe];W(ae,at,z(at),P)}return ae}function Yt(P,W){for(var z=-1,ae=P==null?0:P.length;++z<ae&&W(P[z],z,P)!==!1;);return P}function oB(P,W){for(var z=P==null?0:P.length;z--&&W(P[z],z,P)!==!1;);return P}function Hp(P,W){for(var z=-1,ae=P==null?0:P.length;++z<ae;)if(!W(P[z],z,P))return!1;return!0}function _r(P,W){for(var z=-1,ae=P==null?0:P.length,xe=0,ze=[];++z<ae;){var at=P[z];W(at,z,P)&&(ze[xe++]=at)}return ze}function Os(P,W){var z=P==null?0:P.length;return!!z&&Ci(P,W,0)>-1}function Xl(P,W,z){for(var ae=-1,xe=P==null?0:P.length;++ae<xe;)if(z(W,P[ae]))return!0;return!1}function Ye(P,W){for(var z=-1,ae=P==null?0:P.length,xe=Array(ae);++z<ae;)xe[z]=W(P[z],z,P);return xe}function Cr(P,W){for(var z=-1,ae=W.length,xe=P.length;++z<ae;)P[xe+z]=W[z];return P}function Ql(P,W,z,ae){var xe=-1,ze=P==null?0:P.length;for(ae&&ze&&(z=P[++xe]);++xe<ze;)z=W(z,P[xe],xe,P);return z}function sB(P,W,z,ae){var xe=P==null?0:P.length;for(ae&&xe&&(z=P[--xe]);xe--;)z=W(z,P[xe],xe,P);return z}function ec(P,W){for(var z=-1,ae=P==null?0:P.length;++z<ae;)if(W(P[z],z,P))return!0;return!1}var aB=tc("length");function lB(P){return P.split("")}function cB(P){return P.match(yT)||[]}function jp(P,W,z){var ae;return z(P,function(xe,ze,at){if(W(xe,ze,at))return ae=ze,!1}),ae}function Gs(P,W,z,ae){for(var xe=P.length,ze=z+(ae?1:-1);ae?ze--:++ze<xe;)if(W(P[ze],ze,P))return ze;return-1}function Ci(P,W,z){return W===W?wB(P,W,z):Gs(P,qp,z)}function dB(P,W,z,ae){for(var xe=z-1,ze=P.length;++xe<ze;)if(ae(P[xe],W))return xe;return-1}function qp(P){return P!==P}function Kp(P,W){var z=P==null?0:P.length;return z?rc(P,W)/z:Tt}function tc(P){return function(W){return W==null?n:W[P]}}function nc(P){return function(W){return P==null?n:P[W]}}function Yp(P,W,z,ae,xe){return xe(P,function(ze,at,We){z=ae?(ae=!1,ze):W(z,ze,at,We)}),z}function uB(P,W){var z=P.length;for(P.sort(W);z--;)P[z]=P[z].value;return P}function rc(P,W){for(var z,ae=-1,xe=P.length;++ae<xe;){var ze=W(P[ae]);ze!==n&&(z=z===n?ze:z+ze)}return z}function ic(P,W){for(var z=-1,ae=Array(P);++z<P;)ae[z]=W(z);return ae}function pB(P,W){return Ye(W,function(z){return[z,P[z]]})}function Jp(P){return P&&P.slice(0,th(P)+1).replace($l,"")}function $t(P){return function(W){return P(W)}}function oc(P,W){return Ye(W,function(z){return P[z]})}function Ro(P,W){return P.has(W)}function Xp(P,W){for(var z=-1,ae=P.length;++z<ae&&Ci(W,P[z],0)>-1;);return z}function Qp(P,W){for(var z=P.length;z--&&Ci(W,P[z],0)>-1;);return z}function hB(P,W){for(var z=P.length,ae=0;z--;)P[z]===W&&++ae;return ae}var fB=nc(JT),mB=nc(XT);function gB(P){return"\\"+eB[P]}function yB(P,W){return P==null?n:P[W]}function wi(P){return jT.test(P)}function vB(P){return qT.test(P)}function _B(P){for(var W,z=[];!(W=P.next()).done;)z.push(W.value);return z}function sc(P){var W=-1,z=Array(P.size);return P.forEach(function(ae,xe){z[++W]=[xe,ae]}),z}function eh(P,W){return function(z){return P(W(z))}}function wr(P,W){for(var z=-1,ae=P.length,xe=0,ze=[];++z<ae;){var at=P[z];(at===W||at===m)&&(P[z]=m,ze[xe++]=z)}return ze}function zs(P){var W=-1,z=Array(P.size);return P.forEach(function(ae){z[++W]=ae}),z}function CB(P){var W=-1,z=Array(P.size);return P.forEach(function(ae){z[++W]=[ae,ae]}),z}function wB(P,W,z){for(var ae=z-1,xe=P.length;++ae<xe;)if(P[ae]===W)return ae;return-1}function bB(P,W,z){for(var ae=z+1;ae--;)if(P[ae]===W)return ae;return ae}function bi(P){return wi(P)?kB(P):aB(P)}function Cn(P){return wi(P)?SB(P):lB(P)}function th(P){for(var W=P.length;W--&&hT.test(P.charAt(W)););return W}var xB=nc(QT);function kB(P){for(var W=Kl.lastIndex=0;Kl.test(P);)++W;return W}function SB(P){return P.match(Kl)||[]}function EB(P){return P.match(HT)||[]}var TB=function P(W){W=W==null?ft:xi.defaults(ft.Object(),W,xi.pick(ft,KT));var z=W.Array,ae=W.Date,xe=W.Error,ze=W.Function,at=W.Math,We=W.Object,ac=W.RegExp,BB=W.String,Jt=W.TypeError,Zs=z.prototype,VB=ze.prototype,ki=We.prototype,Us=W["__core-js_shared__"],$s=VB.toString,$e=ki.hasOwnProperty,AB=0,nh=function(){var o=/[^.]+$/.exec(Us&&Us.keys&&Us.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ws=ki.toString,NB=$s.call(We),PB=ft._,DB=ac("^"+$s.call($e).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hs=Op?W.Buffer:n,br=W.Symbol,js=W.Uint8Array,rh=Hs?Hs.allocUnsafe:n,qs=eh(We.getPrototypeOf,We),ih=We.create,oh=ki.propertyIsEnumerable,Ks=Zs.splice,sh=br?br.isConcatSpreadable:n,Mo=br?br.iterator:n,$r=br?br.toStringTag:n,Ys=function(){try{var o=Kr(We,"defineProperty");return o({},"",{}),o}catch{}}(),FB=W.clearTimeout!==ft.clearTimeout&&W.clearTimeout,RB=ae&&ae.now!==ft.Date.now&&ae.now,MB=W.setTimeout!==ft.setTimeout&&W.setTimeout,Js=at.ceil,Xs=at.floor,lc=We.getOwnPropertySymbols,IB=Hs?Hs.isBuffer:n,ah=W.isFinite,LB=Zs.join,OB=eh(We.keys,We),lt=at.max,wt=at.min,GB=ae.now,zB=W.parseInt,lh=at.random,ZB=Zs.reverse,cc=Kr(W,"DataView"),Io=Kr(W,"Map"),dc=Kr(W,"Promise"),Si=Kr(W,"Set"),Lo=Kr(W,"WeakMap"),Oo=Kr(We,"create"),Qs=Lo&&new Lo,Ei={},UB=Yr(cc),$B=Yr(Io),WB=Yr(dc),HB=Yr(Si),jB=Yr(Lo),ea=br?br.prototype:n,Go=ea?ea.valueOf:n,ch=ea?ea.toString:n;function v(o){if(et(o)&&!ke(o)&&!(o instanceof De)){if(o instanceof Xt)return o;if($e.call(o,"__wrapped__"))return uf(o)}return new Xt(o)}var Ti=function(){function o(){}return function(a){if(!Qe(a))return{};if(ih)return ih(a);o.prototype=a;var d=new o;return o.prototype=n,d}}();function ta(){}function Xt(o,a){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}v.templateSettings={escape:aT,evaluate:lT,interpolate:vp,variable:"",imports:{_:v}},v.prototype=ta.prototype,v.prototype.constructor=v,Xt.prototype=Ti(ta.prototype),Xt.prototype.constructor=Xt;function De(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ht,this.__views__=[]}function qB(){var o=new De(this.__wrapped__);return o.__actions__=Dt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Dt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Dt(this.__views__),o}function KB(){if(this.__filtered__){var o=new De(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function YB(){var o=this.__wrapped__.value(),a=this.__dir__,d=ke(o),h=a<0,g=d?o.length:0,_=lA(0,g,this.__views__),x=_.start,B=_.end,D=B-x,H=h?B:x-1,j=this.__iteratees__,K=j.length,te=0,ce=wt(D,this.__takeCount__);if(!d||!h&&g==D&&ce==D)return Dh(o,this.__actions__);var me=[];e:for(;D--&&te<ce;){H+=a;for(var Ae=-1,ge=o[H];++Ae<K;){var Pe=j[Ae],Fe=Pe.iteratee,jt=Pe.type,At=Fe(ge);if(jt==Z)ge=At;else if(!At){if(jt==N)continue e;break e}}me[te++]=ge}return me}De.prototype=Ti(ta.prototype),De.prototype.constructor=De;function Wr(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function JB(){this.__data__=Oo?Oo(null):{},this.size=0}function XB(o){var a=this.has(o)&&delete this.__data__[o];return this.size-=a?1:0,a}function QB(o){var a=this.__data__;if(Oo){var d=a[o];return d===p?n:d}return $e.call(a,o)?a[o]:n}function eV(o){var a=this.__data__;return Oo?a[o]!==n:$e.call(a,o)}function tV(o,a){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Oo&&a===n?p:a,this}Wr.prototype.clear=JB,Wr.prototype.delete=XB,Wr.prototype.get=QB,Wr.prototype.has=eV,Wr.prototype.set=tV;function Un(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function nV(){this.__data__=[],this.size=0}function rV(o){var a=this.__data__,d=na(a,o);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():Ks.call(a,d,1),--this.size,!0}function iV(o){var a=this.__data__,d=na(a,o);return d<0?n:a[d][1]}function oV(o){return na(this.__data__,o)>-1}function sV(o,a){var d=this.__data__,h=na(d,o);return h<0?(++this.size,d.push([o,a])):d[h][1]=a,this}Un.prototype.clear=nV,Un.prototype.delete=rV,Un.prototype.get=iV,Un.prototype.has=oV,Un.prototype.set=sV;function $n(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function aV(){this.size=0,this.__data__={hash:new Wr,map:new(Io||Un),string:new Wr}}function lV(o){var a=fa(this,o).delete(o);return this.size-=a?1:0,a}function cV(o){return fa(this,o).get(o)}function dV(o){return fa(this,o).has(o)}function uV(o,a){var d=fa(this,o),h=d.size;return d.set(o,a),this.size+=d.size==h?0:1,this}$n.prototype.clear=aV,$n.prototype.delete=lV,$n.prototype.get=cV,$n.prototype.has=dV,$n.prototype.set=uV;function Hr(o){var a=-1,d=o==null?0:o.length;for(this.__data__=new $n;++a<d;)this.add(o[a])}function pV(o){return this.__data__.set(o,p),this}function hV(o){return this.__data__.has(o)}Hr.prototype.add=Hr.prototype.push=pV,Hr.prototype.has=hV;function wn(o){var a=this.__data__=new Un(o);this.size=a.size}function fV(){this.__data__=new Un,this.size=0}function mV(o){var a=this.__data__,d=a.delete(o);return this.size=a.size,d}function gV(o){return this.__data__.get(o)}function yV(o){return this.__data__.has(o)}function vV(o,a){var d=this.__data__;if(d instanceof Un){var h=d.__data__;if(!Io||h.length<s-1)return h.push([o,a]),this.size=++d.size,this;d=this.__data__=new $n(h)}return d.set(o,a),this.size=d.size,this}wn.prototype.clear=fV,wn.prototype.delete=mV,wn.prototype.get=gV,wn.prototype.has=yV,wn.prototype.set=vV;function dh(o,a){var d=ke(o),h=!d&&Jr(o),g=!d&&!h&&Tr(o),_=!d&&!h&&!g&&Ni(o),x=d||h||g||_,B=x?ic(o.length,BB):[],D=B.length;for(var H in o)(a||$e.call(o,H))&&!(x&&(H=="length"||g&&(H=="offset"||H=="parent")||_&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||qn(H,D)))&&B.push(H);return B}function uh(o){var a=o.length;return a?o[wc(0,a-1)]:n}function _V(o,a){return ma(Dt(o),jr(a,0,o.length))}function CV(o){return ma(Dt(o))}function uc(o,a,d){(d!==n&&!bn(o[a],d)||d===n&&!(a in o))&&Wn(o,a,d)}function zo(o,a,d){var h=o[a];(!($e.call(o,a)&&bn(h,d))||d===n&&!(a in o))&&Wn(o,a,d)}function na(o,a){for(var d=o.length;d--;)if(bn(o[d][0],a))return d;return-1}function wV(o,a,d,h){return xr(o,function(g,_,x){a(h,g,d(g),x)}),h}function ph(o,a){return o&&Pn(a,pt(a),o)}function bV(o,a){return o&&Pn(a,Rt(a),o)}function Wn(o,a,d){a=="__proto__"&&Ys?Ys(o,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[a]=d}function pc(o,a){for(var d=-1,h=a.length,g=z(h),_=o==null;++d<h;)g[d]=_?n:Hc(o,a[d]);return g}function jr(o,a,d){return o===o&&(d!==n&&(o=o<=d?o:d),a!==n&&(o=o>=a?o:a)),o}function Qt(o,a,d,h,g,_){var x,B=a&y,D=a&S,H=a&E;if(d&&(x=g?d(o,h,g,_):d(o)),x!==n)return x;if(!Qe(o))return o;var j=ke(o);if(j){if(x=dA(o),!B)return Dt(o,x)}else{var K=bt(o),te=K==Fs||K==fp;if(Tr(o))return Mh(o,B);if(K==Zn||K==zn||te&&!g){if(x=D||te?{}:tf(o),!B)return D?QV(o,bV(x,o)):XV(o,ph(x,o))}else{if(!He[K])return g?o:{};x=uA(o,K,B)}}_||(_=new wn);var ce=_.get(o);if(ce)return ce;_.set(o,x),Nf(o)?o.forEach(function(ge){x.add(Qt(ge,a,d,ge,o,_))}):Vf(o)&&o.forEach(function(ge,Pe){x.set(Pe,Qt(ge,a,d,Pe,o,_))});var me=H?D?Pc:Nc:D?Rt:pt,Ae=j?n:me(o);return Yt(Ae||o,function(ge,Pe){Ae&&(Pe=ge,ge=o[Pe]),zo(x,Pe,Qt(ge,a,d,Pe,o,_))}),x}function xV(o){var a=pt(o);return function(d){return hh(d,o,a)}}function hh(o,a,d){var h=d.length;if(o==null)return!h;for(o=We(o);h--;){var g=d[h],_=a[g],x=o[g];if(x===n&&!(g in o)||!_(x))return!1}return!0}function fh(o,a,d){if(typeof o!="function")throw new Jt(c);return qo(function(){o.apply(n,d)},a)}function Zo(o,a,d,h){var g=-1,_=Os,x=!0,B=o.length,D=[],H=a.length;if(!B)return D;d&&(a=Ye(a,$t(d))),h?(_=Xl,x=!1):a.length>=s&&(_=Ro,x=!1,a=new Hr(a));e:for(;++g<B;){var j=o[g],K=d==null?j:d(j);if(j=h||j!==0?j:0,x&&K===K){for(var te=H;te--;)if(a[te]===K)continue e;D.push(j)}else _(a,K,h)||D.push(j)}return D}var xr=zh(Nn),mh=zh(fc,!0);function kV(o,a){var d=!0;return xr(o,function(h,g,_){return d=!!a(h,g,_),d}),d}function ra(o,a,d){for(var h=-1,g=o.length;++h<g;){var _=o[h],x=a(_);if(x!=null&&(B===n?x===x&&!Ht(x):d(x,B)))var B=x,D=_}return D}function SV(o,a,d,h){var g=o.length;for(d=Te(d),d<0&&(d=-d>g?0:g+d),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=d>h?0:Df(h);d<h;)o[d++]=a;return o}function gh(o,a){var d=[];return xr(o,function(h,g,_){a(h,g,_)&&d.push(h)}),d}function mt(o,a,d,h,g){var _=-1,x=o.length;for(d||(d=hA),g||(g=[]);++_<x;){var B=o[_];a>0&&d(B)?a>1?mt(B,a-1,d,h,g):Cr(g,B):h||(g[g.length]=B)}return g}var hc=Zh(),yh=Zh(!0);function Nn(o,a){return o&&hc(o,a,pt)}function fc(o,a){return o&&yh(o,a,pt)}function ia(o,a){return _r(a,function(d){return Kn(o[d])})}function qr(o,a){a=Sr(a,o);for(var d=0,h=a.length;o!=null&&d<h;)o=o[Dn(a[d++])];return d&&d==h?o:n}function vh(o,a,d){var h=a(o);return ke(o)?h:Cr(h,d(o))}function Bt(o){return o==null?o===n?eT:XE:$r&&$r in We(o)?aA(o):CA(o)}function mc(o,a){return o>a}function EV(o,a){return o!=null&&$e.call(o,a)}function TV(o,a){return o!=null&&a in We(o)}function BV(o,a,d){return o>=wt(a,d)&&o<lt(a,d)}function gc(o,a,d){for(var h=d?Xl:Os,g=o[0].length,_=o.length,x=_,B=z(_),D=1/0,H=[];x--;){var j=o[x];x&&a&&(j=Ye(j,$t(a))),D=wt(j.length,D),B[x]=!d&&(a||g>=120&&j.length>=120)?new Hr(x&&j):n}j=o[0];var K=-1,te=B[0];e:for(;++K<g&&H.length<D;){var ce=j[K],me=a?a(ce):ce;if(ce=d||ce!==0?ce:0,!(te?Ro(te,me):h(H,me,d))){for(x=_;--x;){var Ae=B[x];if(!(Ae?Ro(Ae,me):h(o[x],me,d)))continue e}te&&te.push(me),H.push(ce)}}return H}function VV(o,a,d,h){return Nn(o,function(g,_,x){a(h,d(g),_,x)}),h}function Uo(o,a,d){a=Sr(a,o),o=sf(o,a);var h=o==null?o:o[Dn(tn(a))];return h==null?n:Ut(h,o,d)}function _h(o){return et(o)&&Bt(o)==zn}function AV(o){return et(o)&&Bt(o)==Fo}function NV(o){return et(o)&&Bt(o)==Vo}function $o(o,a,d,h,g){return o===a?!0:o==null||a==null||!et(o)&&!et(a)?o!==o&&a!==a:PV(o,a,d,h,$o,g)}function PV(o,a,d,h,g,_){var x=ke(o),B=ke(a),D=x?Ge:bt(o),H=B?Ge:bt(a);D=D==zn?Zn:D,H=H==zn?Zn:H;var j=D==Zn,K=H==Zn,te=D==H;if(te&&Tr(o)){if(!Tr(a))return!1;x=!0,j=!1}if(te&&!j)return _||(_=new wn),x||Ni(o)?Xh(o,a,d,h,g,_):oA(o,a,D,d,h,g,_);if(!(d&M)){var ce=j&&$e.call(o,"__wrapped__"),me=K&&$e.call(a,"__wrapped__");if(ce||me){var Ae=ce?o.value():o,ge=me?a.value():a;return _||(_=new wn),g(Ae,ge,d,h,_)}}return te?(_||(_=new wn),sA(o,a,d,h,g,_)):!1}function DV(o){return et(o)&&bt(o)==vn}function yc(o,a,d,h){var g=d.length,_=g,x=!h;if(o==null)return!_;for(o=We(o);g--;){var B=d[g];if(x&&B[2]?B[1]!==o[B[0]]:!(B[0]in o))return!1}for(;++g<_;){B=d[g];var D=B[0],H=o[D],j=B[1];if(x&&B[2]){if(H===n&&!(D in o))return!1}else{var K=new wn;if(h)var te=h(H,j,D,o,a,K);if(!(te===n?$o(j,H,M|V,h,K):te))return!1}}return!0}function Ch(o){if(!Qe(o)||mA(o))return!1;var a=Kn(o)?DB:xT;return a.test(Yr(o))}function FV(o){return et(o)&&Bt(o)==No}function RV(o){return et(o)&&bt(o)==_n}function MV(o){return et(o)&&wa(o.length)&&!!qe[Bt(o)]}function wh(o){return typeof o=="function"?o:o==null?Mt:typeof o=="object"?ke(o)?kh(o[0],o[1]):xh(o):$f(o)}function vc(o){if(!jo(o))return OB(o);var a=[];for(var d in We(o))$e.call(o,d)&&d!="constructor"&&a.push(d);return a}function IV(o){if(!Qe(o))return _A(o);var a=jo(o),d=[];for(var h in o)h=="constructor"&&(a||!$e.call(o,h))||d.push(h);return d}function _c(o,a){return o<a}function bh(o,a){var d=-1,h=Ft(o)?z(o.length):[];return xr(o,function(g,_,x){h[++d]=a(g,_,x)}),h}function xh(o){var a=Fc(o);return a.length==1&&a[0][2]?rf(a[0][0],a[0][1]):function(d){return d===o||yc(d,o,a)}}function kh(o,a){return Mc(o)&&nf(a)?rf(Dn(o),a):function(d){var h=Hc(d,o);return h===n&&h===a?jc(d,o):$o(a,h,M|V)}}function oa(o,a,d,h,g){o!==a&&hc(a,function(_,x){if(g||(g=new wn),Qe(_))LV(o,a,x,d,oa,h,g);else{var B=h?h(Lc(o,x),_,x+"",o,a,g):n;B===n&&(B=_),uc(o,x,B)}},Rt)}function LV(o,a,d,h,g,_,x){var B=Lc(o,d),D=Lc(a,d),H=x.get(D);if(H){uc(o,d,H);return}var j=_?_(B,D,d+"",o,a,x):n,K=j===n;if(K){var te=ke(D),ce=!te&&Tr(D),me=!te&&!ce&&Ni(D);j=D,te||ce||me?ke(B)?j=B:nt(B)?j=Dt(B):ce?(K=!1,j=Mh(D,!0)):me?(K=!1,j=Ih(D,!0)):j=[]:Ko(D)||Jr(D)?(j=B,Jr(B)?j=Ff(B):(!Qe(B)||Kn(B))&&(j=tf(D))):K=!1}K&&(x.set(D,j),g(j,D,h,_,x),x.delete(D)),uc(o,d,j)}function Sh(o,a){var d=o.length;if(d)return a+=a<0?d:0,qn(a,d)?o[a]:n}function Eh(o,a,d){a.length?a=Ye(a,function(_){return ke(_)?function(x){return qr(x,_.length===1?_[0]:_)}:_}):a=[Mt];var h=-1;a=Ye(a,$t(he()));var g=bh(o,function(_,x,B){var D=Ye(a,function(H){return H(_)});return{criteria:D,index:++h,value:_}});return uB(g,function(_,x){return JV(_,x,d)})}function OV(o,a){return Th(o,a,function(d,h){return jc(o,h)})}function Th(o,a,d){for(var h=-1,g=a.length,_={};++h<g;){var x=a[h],B=qr(o,x);d(B,x)&&Wo(_,Sr(x,o),B)}return _}function GV(o){return function(a){return qr(a,o)}}function Cc(o,a,d,h){var g=h?dB:Ci,_=-1,x=a.length,B=o;for(o===a&&(a=Dt(a)),d&&(B=Ye(o,$t(d)));++_<x;)for(var D=0,H=a[_],j=d?d(H):H;(D=g(B,j,D,h))>-1;)B!==o&&Ks.call(B,D,1),Ks.call(o,D,1);return o}function Bh(o,a){for(var d=o?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==_){var _=g;qn(g)?Ks.call(o,g,1):kc(o,g)}}return o}function wc(o,a){return o+Xs(lh()*(a-o+1))}function zV(o,a,d,h){for(var g=-1,_=lt(Js((a-o)/(d||1)),0),x=z(_);_--;)x[h?_:++g]=o,o+=d;return x}function bc(o,a){var d="";if(!o||a<1||a>we)return d;do a%2&&(d+=o),a=Xs(a/2),a&&(o+=o);while(a);return d}function Ne(o,a){return Oc(of(o,a,Mt),o+"")}function ZV(o){return uh(Pi(o))}function UV(o,a){var d=Pi(o);return ma(d,jr(a,0,d.length))}function Wo(o,a,d,h){if(!Qe(o))return o;a=Sr(a,o);for(var g=-1,_=a.length,x=_-1,B=o;B!=null&&++g<_;){var D=Dn(a[g]),H=d;if(D==="__proto__"||D==="constructor"||D==="prototype")return o;if(g!=x){var j=B[D];H=h?h(j,D,B):n,H===n&&(H=Qe(j)?j:qn(a[g+1])?[]:{})}zo(B,D,H),B=B[D]}return o}var Vh=Qs?function(o,a){return Qs.set(o,a),o}:Mt,$V=Ys?function(o,a){return Ys(o,"toString",{configurable:!0,enumerable:!1,value:Kc(a),writable:!0})}:Mt;function WV(o){return ma(Pi(o))}function en(o,a,d){var h=-1,g=o.length;a<0&&(a=-a>g?0:g+a),d=d>g?g:d,d<0&&(d+=g),g=a>d?0:d-a>>>0,a>>>=0;for(var _=z(g);++h<g;)_[h]=o[h+a];return _}function HV(o,a){var d;return xr(o,function(h,g,_){return d=a(h,g,_),!d}),!!d}function sa(o,a,d){var h=0,g=o==null?h:o.length;if(typeof a=="number"&&a===a&&g<=An){for(;h<g;){var _=h+g>>>1,x=o[_];x!==null&&!Ht(x)&&(d?x<=a:x<a)?h=_+1:g=_}return g}return xc(o,a,Mt,d)}function xc(o,a,d,h){var g=0,_=o==null?0:o.length;if(_===0)return 0;a=d(a);for(var x=a!==a,B=a===null,D=Ht(a),H=a===n;g<_;){var j=Xs((g+_)/2),K=d(o[j]),te=K!==n,ce=K===null,me=K===K,Ae=Ht(K);if(x)var ge=h||me;else H?ge=me&&(h||te):B?ge=me&&te&&(h||!ce):D?ge=me&&te&&!ce&&(h||!Ae):ce||Ae?ge=!1:ge=h?K<=a:K<a;ge?g=j+1:_=j}return wt(_,yr)}function Ah(o,a){for(var d=-1,h=o.length,g=0,_=[];++d<h;){var x=o[d],B=a?a(x):x;if(!d||!bn(B,D)){var D=B;_[g++]=x===0?0:x}}return _}function Nh(o){return typeof o=="number"?o:Ht(o)?Tt:+o}function Wt(o){if(typeof o=="string")return o;if(ke(o))return Ye(o,Wt)+"";if(Ht(o))return ch?ch.call(o):"";var a=o+"";return a=="0"&&1/o==-pe?"-0":a}function kr(o,a,d){var h=-1,g=Os,_=o.length,x=!0,B=[],D=B;if(d)x=!1,g=Xl;else if(_>=s){var H=a?null:rA(o);if(H)return zs(H);x=!1,g=Ro,D=new Hr}else D=a?[]:B;e:for(;++h<_;){var j=o[h],K=a?a(j):j;if(j=d||j!==0?j:0,x&&K===K){for(var te=D.length;te--;)if(D[te]===K)continue e;a&&D.push(K),B.push(j)}else g(D,K,d)||(D!==B&&D.push(K),B.push(j))}return B}function kc(o,a){return a=Sr(a,o),o=sf(o,a),o==null||delete o[Dn(tn(a))]}function Ph(o,a,d,h){return Wo(o,a,d(qr(o,a)),h)}function aa(o,a,d,h){for(var g=o.length,_=h?g:-1;(h?_--:++_<g)&&a(o[_],_,o););return d?en(o,h?0:_,h?_+1:g):en(o,h?_+1:0,h?g:_)}function Dh(o,a){var d=o;return d instanceof De&&(d=d.value()),Ql(a,function(h,g){return g.func.apply(g.thisArg,Cr([h],g.args))},d)}function Sc(o,a,d){var h=o.length;if(h<2)return h?kr(o[0]):[];for(var g=-1,_=z(h);++g<h;)for(var x=o[g],B=-1;++B<h;)B!=g&&(_[g]=Zo(_[g]||x,o[B],a,d));return kr(mt(_,1),a,d)}function Fh(o,a,d){for(var h=-1,g=o.length,_=a.length,x={};++h<g;){var B=h<_?a[h]:n;d(x,o[h],B)}return x}function Ec(o){return nt(o)?o:[]}function Tc(o){return typeof o=="function"?o:Mt}function Sr(o,a){return ke(o)?o:Mc(o,a)?[o]:df(Ue(o))}var jV=Ne;function Er(o,a,d){var h=o.length;return d=d===n?h:d,!a&&d>=h?o:en(o,a,d)}var Rh=FB||function(o){return ft.clearTimeout(o)};function Mh(o,a){if(a)return o.slice();var d=o.length,h=rh?rh(d):new o.constructor(d);return o.copy(h),h}function Bc(o){var a=new o.constructor(o.byteLength);return new js(a).set(new js(o)),a}function qV(o,a){var d=a?Bc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function KV(o){var a=new o.constructor(o.source,_p.exec(o));return a.lastIndex=o.lastIndex,a}function YV(o){return Go?We(Go.call(o)):{}}function Ih(o,a){var d=a?Bc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Lh(o,a){if(o!==a){var d=o!==n,h=o===null,g=o===o,_=Ht(o),x=a!==n,B=a===null,D=a===a,H=Ht(a);if(!B&&!H&&!_&&o>a||_&&x&&D&&!B&&!H||h&&x&&D||!d&&D||!g)return 1;if(!h&&!_&&!H&&o<a||H&&d&&g&&!h&&!_||B&&d&&g||!x&&g||!D)return-1}return 0}function JV(o,a,d){for(var h=-1,g=o.criteria,_=a.criteria,x=g.length,B=d.length;++h<x;){var D=Lh(g[h],_[h]);if(D){if(h>=B)return D;var H=d[h];return D*(H=="desc"?-1:1)}}return o.index-a.index}function Oh(o,a,d,h){for(var g=-1,_=o.length,x=d.length,B=-1,D=a.length,H=lt(_-x,0),j=z(D+H),K=!h;++B<D;)j[B]=a[B];for(;++g<x;)(K||g<_)&&(j[d[g]]=o[g]);for(;H--;)j[B++]=o[g++];return j}function Gh(o,a,d,h){for(var g=-1,_=o.length,x=-1,B=d.length,D=-1,H=a.length,j=lt(_-B,0),K=z(j+H),te=!h;++g<j;)K[g]=o[g];for(var ce=g;++D<H;)K[ce+D]=a[D];for(;++x<B;)(te||g<_)&&(K[ce+d[x]]=o[g++]);return K}function Dt(o,a){var d=-1,h=o.length;for(a||(a=z(h));++d<h;)a[d]=o[d];return a}function Pn(o,a,d,h){var g=!d;d||(d={});for(var _=-1,x=a.length;++_<x;){var B=a[_],D=h?h(d[B],o[B],B,d,o):n;D===n&&(D=o[B]),g?Wn(d,B,D):zo(d,B,D)}return d}function XV(o,a){return Pn(o,Rc(o),a)}function QV(o,a){return Pn(o,Qh(o),a)}function la(o,a){return function(d,h){var g=ke(d)?iB:wV,_=a?a():{};return g(d,o,he(h,2),_)}}function Bi(o){return Ne(function(a,d){var h=-1,g=d.length,_=g>1?d[g-1]:n,x=g>2?d[2]:n;for(_=o.length>3&&typeof _=="function"?(g--,_):n,x&&Vt(d[0],d[1],x)&&(_=g<3?n:_,g=1),a=We(a);++h<g;){var B=d[h];B&&o(a,B,h,_)}return a})}function zh(o,a){return function(d,h){if(d==null)return d;if(!Ft(d))return o(d,h);for(var g=d.length,_=a?g:-1,x=We(d);(a?_--:++_<g)&&h(x[_],_,x)!==!1;);return d}}function Zh(o){return function(a,d,h){for(var g=-1,_=We(a),x=h(a),B=x.length;B--;){var D=x[o?B:++g];if(d(_[D],D,_)===!1)break}return a}}function eA(o,a,d){var h=a&F,g=Ho(o);function _(){var x=this&&this!==ft&&this instanceof _?g:o;return x.apply(h?d:this,arguments)}return _}function Uh(o){return function(a){a=Ue(a);var d=wi(a)?Cn(a):n,h=d?d[0]:a.charAt(0),g=d?Er(d,1).join(""):a.slice(1);return h[o]()+g}}function Vi(o){return function(a){return Ql(Zf(zf(a).replace($T,"")),o,"")}}function Ho(o){return function(){var a=arguments;switch(a.length){case 0:return new o;case 1:return new o(a[0]);case 2:return new o(a[0],a[1]);case 3:return new o(a[0],a[1],a[2]);case 4:return new o(a[0],a[1],a[2],a[3]);case 5:return new o(a[0],a[1],a[2],a[3],a[4]);case 6:return new o(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new o(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var d=Ti(o.prototype),h=o.apply(d,a);return Qe(h)?h:d}}function tA(o,a,d){var h=Ho(o);function g(){for(var _=arguments.length,x=z(_),B=_,D=Ai(g);B--;)x[B]=arguments[B];var H=_<3&&x[0]!==D&&x[_-1]!==D?[]:wr(x,D);if(_-=H.length,_<d)return qh(o,a,ca,g.placeholder,n,x,H,n,n,d-_);var j=this&&this!==ft&&this instanceof g?h:o;return Ut(j,this,x)}return g}function $h(o){return function(a,d,h){var g=We(a);if(!Ft(a)){var _=he(d,3);a=pt(a),d=function(B){return _(g[B],B,g)}}var x=o(a,d,h);return x>-1?g[_?a[x]:x]:n}}function Wh(o){return jn(function(a){var d=a.length,h=d,g=Xt.prototype.thru;for(o&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Jt(c);if(g&&!x&&ha(_)=="wrapper")var x=new Xt([],!0)}for(h=x?h:d;++h<d;){_=a[h];var B=ha(_),D=B=="wrapper"?Dc(_):n;D&&Ic(D[0])&&D[1]==(T|Q|L|k)&&!D[4].length&&D[9]==1?x=x[ha(D[0])].apply(x,D[3]):x=_.length==1&&Ic(_)?x[B]():x.thru(_)}return function(){var H=arguments,j=H[0];if(x&&H.length==1&&ke(j))return x.plant(j).value();for(var K=0,te=d?a[K].apply(this,H):j;++K<d;)te=a[K].call(this,te);return te}})}function ca(o,a,d,h,g,_,x,B,D,H){var j=a&T,K=a&F,te=a&C,ce=a&(Q|I),me=a&O,Ae=te?n:Ho(o);function ge(){for(var Pe=arguments.length,Fe=z(Pe),jt=Pe;jt--;)Fe[jt]=arguments[jt];if(ce)var At=Ai(ge),qt=hB(Fe,At);if(h&&(Fe=Oh(Fe,h,g,ce)),_&&(Fe=Gh(Fe,_,x,ce)),Pe-=qt,ce&&Pe<H){var rt=wr(Fe,At);return qh(o,a,ca,ge.placeholder,d,Fe,rt,B,D,H-Pe)}var xn=K?d:this,Jn=te?xn[o]:o;return Pe=Fe.length,B?Fe=wA(Fe,B):me&&Pe>1&&Fe.reverse(),j&&D<Pe&&(Fe.length=D),this&&this!==ft&&this instanceof ge&&(Jn=Ae||Ho(Jn)),Jn.apply(xn,Fe)}return ge}function Hh(o,a){return function(d,h){return VV(d,o,a(h),{})}}function da(o,a){return function(d,h){var g;if(d===n&&h===n)return a;if(d!==n&&(g=d),h!==n){if(g===n)return h;typeof d=="string"||typeof h=="string"?(d=Wt(d),h=Wt(h)):(d=Nh(d),h=Nh(h)),g=o(d,h)}return g}}function Vc(o){return jn(function(a){return a=Ye(a,$t(he())),Ne(function(d){var h=this;return o(a,function(g){return Ut(g,h,d)})})})}function ua(o,a){a=a===n?" ":Wt(a);var d=a.length;if(d<2)return d?bc(a,o):a;var h=bc(a,Js(o/bi(a)));return wi(a)?Er(Cn(h),0,o).join(""):h.slice(0,o)}function nA(o,a,d,h){var g=a&F,_=Ho(o);function x(){for(var B=-1,D=arguments.length,H=-1,j=h.length,K=z(j+D),te=this&&this!==ft&&this instanceof x?_:o;++H<j;)K[H]=h[H];for(;D--;)K[H++]=arguments[++B];return Ut(te,g?d:this,K)}return x}function jh(o){return function(a,d,h){return h&&typeof h!="number"&&Vt(a,d,h)&&(d=h=n),a=Yn(a),d===n?(d=a,a=0):d=Yn(d),h=h===n?a<d?1:-1:Yn(h),zV(a,d,h,o)}}function pa(o){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=nn(a),d=nn(d)),o(a,d)}}function qh(o,a,d,h,g,_,x,B,D,H){var j=a&Q,K=j?x:n,te=j?n:x,ce=j?_:n,me=j?n:_;a|=j?L:U,a&=~(j?U:L),a&G||(a&=~(F|C));var Ae=[o,a,g,ce,K,me,te,B,D,H],ge=d.apply(n,Ae);return Ic(o)&&af(ge,Ae),ge.placeholder=h,lf(ge,o,a)}function Ac(o){var a=at[o];return function(d,h){if(d=nn(d),h=h==null?0:wt(Te(h),292),h&&ah(d)){var g=(Ue(d)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(Ue(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var rA=Si&&1/zs(new Si([,-0]))[1]==pe?function(o){return new Si(o)}:Xc;function Kh(o){return function(a){var d=bt(a);return d==vn?sc(a):d==_n?CB(a):pB(a,o(a))}}function Hn(o,a,d,h,g,_,x,B){var D=a&C;if(!D&&typeof o!="function")throw new Jt(c);var H=h?h.length:0;if(H||(a&=~(L|U),h=g=n),x=x===n?x:lt(Te(x),0),B=B===n?B:Te(B),H-=g?g.length:0,a&U){var j=h,K=g;h=g=n}var te=D?n:Dc(o),ce=[o,a,d,h,g,j,K,_,x,B];if(te&&vA(ce,te),o=ce[0],a=ce[1],d=ce[2],h=ce[3],g=ce[4],B=ce[9]=ce[9]===n?D?0:o.length:lt(ce[9]-H,0),!B&&a&(Q|I)&&(a&=~(Q|I)),!a||a==F)var me=eA(o,a,d);else a==Q||a==I?me=tA(o,a,B):(a==L||a==(F|L))&&!g.length?me=nA(o,a,d,h):me=ca.apply(n,ce);var Ae=te?Vh:af;return lf(Ae(me,ce),o,a)}function Yh(o,a,d,h){return o===n||bn(o,ki[d])&&!$e.call(h,d)?a:o}function Jh(o,a,d,h,g,_){return Qe(o)&&Qe(a)&&(_.set(a,o),oa(o,a,n,Jh,_),_.delete(a)),o}function iA(o){return Ko(o)?n:o}function Xh(o,a,d,h,g,_){var x=d&M,B=o.length,D=a.length;if(B!=D&&!(x&&D>B))return!1;var H=_.get(o),j=_.get(a);if(H&&j)return H==a&&j==o;var K=-1,te=!0,ce=d&V?new Hr:n;for(_.set(o,a),_.set(a,o);++K<B;){var me=o[K],Ae=a[K];if(h)var ge=x?h(Ae,me,K,a,o,_):h(me,Ae,K,o,a,_);if(ge!==n){if(ge)continue;te=!1;break}if(ce){if(!ec(a,function(Pe,Fe){if(!Ro(ce,Fe)&&(me===Pe||g(me,Pe,d,h,_)))return ce.push(Fe)})){te=!1;break}}else if(!(me===Ae||g(me,Ae,d,h,_))){te=!1;break}}return _.delete(o),_.delete(a),te}function oA(o,a,d,h,g,_,x){switch(d){case vi:if(o.byteLength!=a.byteLength||o.byteOffset!=a.byteOffset)return!1;o=o.buffer,a=a.buffer;case Fo:return!(o.byteLength!=a.byteLength||!_(new js(o),new js(a)));case Bo:case Vo:case Ao:return bn(+o,+a);case Ds:return o.name==a.name&&o.message==a.message;case No:case Po:return o==a+"";case vn:var B=sc;case _n:var D=h&M;if(B||(B=zs),o.size!=a.size&&!D)return!1;var H=x.get(o);if(H)return H==a;h|=V,x.set(o,a);var j=Xh(B(o),B(a),h,g,_,x);return x.delete(o),j;case Rs:if(Go)return Go.call(o)==Go.call(a)}return!1}function sA(o,a,d,h,g,_){var x=d&M,B=Nc(o),D=B.length,H=Nc(a),j=H.length;if(D!=j&&!x)return!1;for(var K=D;K--;){var te=B[K];if(!(x?te in a:$e.call(a,te)))return!1}var ce=_.get(o),me=_.get(a);if(ce&&me)return ce==a&&me==o;var Ae=!0;_.set(o,a),_.set(a,o);for(var ge=x;++K<D;){te=B[K];var Pe=o[te],Fe=a[te];if(h)var jt=x?h(Fe,Pe,te,a,o,_):h(Pe,Fe,te,o,a,_);if(!(jt===n?Pe===Fe||g(Pe,Fe,d,h,_):jt)){Ae=!1;break}ge||(ge=te=="constructor")}if(Ae&&!ge){var At=o.constructor,qt=a.constructor;At!=qt&&"constructor"in o&&"constructor"in a&&!(typeof At=="function"&&At instanceof At&&typeof qt=="function"&&qt instanceof qt)&&(Ae=!1)}return _.delete(o),_.delete(a),Ae}function jn(o){return Oc(of(o,n,ff),o+"")}function Nc(o){return vh(o,pt,Rc)}function Pc(o){return vh(o,Rt,Qh)}var Dc=Qs?function(o){return Qs.get(o)}:Xc;function ha(o){for(var a=o.name+"",d=Ei[a],h=$e.call(Ei,a)?d.length:0;h--;){var g=d[h],_=g.func;if(_==null||_==o)return g.name}return a}function Ai(o){var a=$e.call(v,"placeholder")?v:o;return a.placeholder}function he(){var o=v.iteratee||Yc;return o=o===Yc?wh:o,arguments.length?o(arguments[0],arguments[1]):o}function fa(o,a){var d=o.__data__;return fA(a)?d[typeof a=="string"?"string":"hash"]:d.map}function Fc(o){for(var a=pt(o),d=a.length;d--;){var h=a[d],g=o[h];a[d]=[h,g,nf(g)]}return a}function Kr(o,a){var d=yB(o,a);return Ch(d)?d:n}function aA(o){var a=$e.call(o,$r),d=o[$r];try{o[$r]=n;var h=!0}catch{}var g=Ws.call(o);return h&&(a?o[$r]=d:delete o[$r]),g}var Rc=lc?function(o){return o==null?[]:(o=We(o),_r(lc(o),function(a){return oh.call(o,a)}))}:Qc,Qh=lc?function(o){for(var a=[];o;)Cr(a,Rc(o)),o=qs(o);return a}:Qc,bt=Bt;(cc&&bt(new cc(new ArrayBuffer(1)))!=vi||Io&&bt(new Io)!=vn||dc&&bt(dc.resolve())!=mp||Si&&bt(new Si)!=_n||Lo&&bt(new Lo)!=Do)&&(bt=function(o){var a=Bt(o),d=a==Zn?o.constructor:n,h=d?Yr(d):"";if(h)switch(h){case UB:return vi;case $B:return vn;case WB:return mp;case HB:return _n;case jB:return Do}return a});function lA(o,a,d){for(var h=-1,g=d.length;++h<g;){var _=d[h],x=_.size;switch(_.type){case"drop":o+=x;break;case"dropRight":a-=x;break;case"take":a=wt(a,o+x);break;case"takeRight":o=lt(o,a-x);break}}return{start:o,end:a}}function cA(o){var a=o.match(mT);return a?a[1].split(gT):[]}function ef(o,a,d){a=Sr(a,o);for(var h=-1,g=a.length,_=!1;++h<g;){var x=Dn(a[h]);if(!(_=o!=null&&d(o,x)))break;o=o[x]}return _||++h!=g?_:(g=o==null?0:o.length,!!g&&wa(g)&&qn(x,g)&&(ke(o)||Jr(o)))}function dA(o){var a=o.length,d=new o.constructor(a);return a&&typeof o[0]=="string"&&$e.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function tf(o){return typeof o.constructor=="function"&&!jo(o)?Ti(qs(o)):{}}function uA(o,a,d){var h=o.constructor;switch(a){case Fo:return Bc(o);case Bo:case Vo:return new h(+o);case vi:return qV(o,d);case Fl:case Rl:case Ml:case Il:case Ll:case Ol:case Gl:case zl:case Zl:return Ih(o,d);case vn:return new h;case Ao:case Po:return new h(o);case No:return KV(o);case _n:return new h;case Rs:return YV(o)}}function pA(o,a){var d=a.length;if(!d)return o;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),o.replace(fT,`{
|
|
71
71
|
/* [wrapped with `+a+`] */
|
|
72
|
-
`)}function uP(o){return ke(o)||jr(o)||!!(eh&&o&&o[eh])}function Wn(o,a){var d=typeof o;return a=a??xe,!!a&&(d=="number"||d!="symbol"&&xT.test(o))&&o>-1&&o%1==0&&o<a}function St(o,a,d){if(!Je(d))return!1;var h=typeof a;return(h=="number"?Vt(d)&&Wn(a,d.length):h=="string"&&a in d)?wn(d[a],o):!1}function Nc(o,a){if(ke(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Ut(o)?!0:lT.test(o)||!aT.test(o)||a!=null&&o in $e(a)}function pP(o){var a=typeof o;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?o!=="__proto__":o===null}function Dc(o){var a=aa(o),d=y[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(o===d)return!0;var h=Ac(d);return!!h&&o===h[0]}function hP(o){return!!Yp&&Yp in o}var fP=Is?Hn:Yc;function Wo(o){var a=o&&o.constructor,d=typeof a=="function"&&a.prototype||Ci;return o===d}function Yh(o){return o===o&&!Je(o)}function Jh(o,a){return function(d){return d==null?!1:d[o]===a&&(a!==n||o in $e(d))}}function mP(o){var a=ha(o,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function gP(o,a){var d=o[1],h=a[1],g=d|h,_=g<(N|C|z),x=h==z&&d==Q||h==z&&d==P&&o[7].length<=a[8]||h==(z|P)&&a[7].length<=a[8]&&d==Q;if(!(_||x))return o;h&N&&(o[2]=a[2],g|=d&N?0:I);var E=a[3];if(E){var V=o[3];o[3]=V?Dh(V,E,a[4]):E,o[4]=V?gr(o[3],m):a[4]}return E=a[5],E&&(V=o[5],o[5]=V?Fh(V,E,a[6]):E,o[6]=V?gr(o[5],m):a[6]),E=a[7],E&&(o[7]=E),h&z&&(o[8]=o[8]==null?a[8]:vt(o[8],a[8])),o[9]==null&&(o[9]=a[9]),o[0]=a[0],o[1]=g,o}function yP(o){var a=[];if(o!=null)for(var d in $e(o))a.push(d);return a}function vP(o){return Os.call(o)}function Xh(o,a,d){return a=at(a===n?o.length-1:a,0),function(){for(var h=arguments,g=-1,_=at(h.length-a,0),x=L(_);++g<_;)x[g]=h[a+g];g=-1;for(var E=L(a+1);++g<a;)E[g]=h[g];return E[a]=d(x),zt(o,this,E)}}function Qh(o,a){return a.length<2?o:Ur(o,Qt(a,0,-1))}function _P(o,a){for(var d=o.length,h=vt(a.length,d),g=Pt(o);h--;){var _=a[h];o[h]=Wn(_,d)?g[_]:n}return o}function Fc(o,a){if(!(a==="constructor"&&typeof o[a]=="function")&&a!="__proto__")return o[a]}var ef=nf(xh),Ho=FB||function(o,a){return pt.setTimeout(o,a)},Rc=nf(ZA);function tf(o,a,d){var h=a+"";return Rc(o,dP(h,CP(aP(h),d)))}function nf(o){var a=0,d=0;return function(){var h=LB(),g=W-(h-d);if(d=h,g>0){if(++a>=ue)return arguments[0]}else a=0;return o.apply(n,arguments)}}function ca(o,a){var d=-1,h=o.length,g=h-1;for(a=a===n?h:a;++d<a;){var _=yc(d,g),x=o[_];o[_]=o[d],o[d]=x}return o.length=a,o}var rf=mP(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(cT,function(d,h,g,_){a.push(g?_.replace(yT,"$1"):h||d)}),a});function Vn(o){if(typeof o=="string"||Ut(o))return o;var a=o+"";return a=="0"&&1/o==-ve?"-0":a}function Hr(o){if(o!=null){try{return Ls.call(o)}catch{}try{return o+""}catch{}}return""}function CP(o,a){return Kt(So,function(d){var h="_."+d[0];a&d[1]&&!Ds(o,h)&&o.push(h)}),o.sort()}function of(o){if(o instanceof De)return o.clone();var a=new Jt(o.__wrapped__,o.__chain__);return a.__actions__=Pt(o.__actions__),a.__index__=o.__index__,a.__values__=o.__values__,a}function wP(o,a,d){(d?St(o,a,d):a===n)?a=1:a=at(Te(a),0);var h=o==null?0:o.length;if(!h||a<1)return[];for(var g=0,_=0,x=L(Ws(h/a));g<h;)x[_++]=Qt(o,g,g+=a);return x}function bP(o){for(var a=-1,d=o==null?0:o.length,h=0,g=[];++a<d;){var _=o[a];_&&(g[h++]=_)}return g}function xP(){var o=arguments.length;if(!o)return[];for(var a=L(o-1),d=arguments[0],h=o;h--;)a[h-1]=arguments[h];return mr(ke(d)?Pt(d):[d],ht(a,1))}var kP=Ve(function(o,a){return tt(o)?Go(o,ht(a,1,tt,!0)):[]}),SP=Ve(function(o,a){var d=en(a);return tt(d)&&(d=n),tt(o)?Go(o,ht(a,1,tt,!0),pe(d,2)):[]}),EP=Ve(function(o,a){var d=en(a);return tt(d)&&(d=n),tt(o)?Go(o,ht(a,1,tt,!0),n,d):[]});function TP(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),Qt(o,a<0?0:a,h)):[]}function BP(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,Qt(o,0,a<0?0:a)):[]}function AP(o,a){return o&&o.length?ta(o,pe(a,3),!0,!0):[]}function PP(o,a){return o&&o.length?ta(o,pe(a,3),!0):[]}function VP(o,a,d,h){var g=o==null?0:o.length;return g?(d&&typeof d!="number"&&St(o,a,d)&&(d=0,h=g),xA(o,a,d,h)):[]}function sf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=at(h+g,0)),Fs(o,pe(a,3),g)}function af(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h-1;return d!==n&&(g=Te(d),g=d<0?at(h+g,0):vt(g,h-1)),Fs(o,pe(a,3),g,!0)}function lf(o){var a=o==null?0:o.length;return a?ht(o,1):[]}function NP(o){var a=o==null?0:o.length;return a?ht(o,ve):[]}function DP(o,a){var d=o==null?0:o.length;return d?(a=a===n?1:Te(a),ht(o,a)):[]}function FP(o){for(var a=-1,d=o==null?0:o.length,h={};++a<d;){var g=o[a];h[g[0]]=g[1]}return h}function cf(o){return o&&o.length?o[0]:n}function RP(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=at(h+g,0)),gi(o,a,g)}function MP(o){var a=o==null?0:o.length;return a?Qt(o,0,-1):[]}var IP=Ve(function(o){var a=qe(o,bc);return a.length&&a[0]===o[0]?pc(a):[]}),LP=Ve(function(o){var a=en(o),d=qe(o,bc);return a===en(d)?a=n:d.pop(),d.length&&d[0]===o[0]?pc(d,pe(a,2)):[]}),OP=Ve(function(o){var a=en(o),d=qe(o,bc);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===o[0]?pc(d,n,a):[]});function GP(o,a){return o==null?"":MB.call(o,a)}function en(o){var a=o==null?0:o.length;return a?o[a-1]:n}function zP(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h;return d!==n&&(g=Te(d),g=g<0?at(h+g,0):vt(g,h-1)),a===a?CB(o,a,g):Fs(o,Zp,g,!0)}function ZP(o,a){return o&&o.length?_h(o,Te(a)):n}var $P=Ve(df);function df(o,a){return o&&o.length&&a&&a.length?gc(o,a):o}function UP(o,a,d){return o&&o.length&&a&&a.length?gc(o,a,pe(d,2)):o}function WP(o,a,d){return o&&o.length&&a&&a.length?gc(o,a,n,d):o}var HP=Un(function(o,a){var d=o==null?0:o.length,h=lc(o,a);return bh(o,qe(a,function(g){return Wn(g,d)?+g:g}).sort(Nh)),h});function jP(o,a){var d=[];if(!(o&&o.length))return d;var h=-1,g=[],_=o.length;for(a=pe(a,3);++h<_;){var x=o[h];a(x,h,o)&&(d.push(x),g.push(h))}return bh(o,g),d}function Mc(o){return o==null?o:GB.call(o)}function qP(o,a,d){var h=o==null?0:o.length;return h?(d&&typeof d!="number"&&St(o,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),Qt(o,a,d)):[]}function KP(o,a){return ea(o,a)}function YP(o,a,d){return _c(o,a,pe(d,2))}function JP(o,a){var d=o==null?0:o.length;if(d){var h=ea(o,a);if(h<d&&wn(o[h],a))return h}return-1}function XP(o,a){return ea(o,a,!0)}function QP(o,a,d){return _c(o,a,pe(d,2),!0)}function eV(o,a){var d=o==null?0:o.length;if(d){var h=ea(o,a,!0)-1;if(wn(o[h],a))return h}return-1}function tV(o){return o&&o.length?kh(o):[]}function nV(o,a){return o&&o.length?kh(o,pe(a,2)):[]}function rV(o){var a=o==null?0:o.length;return a?Qt(o,1,a):[]}function iV(o,a,d){return o&&o.length?(a=d||a===n?1:Te(a),Qt(o,0,a<0?0:a)):[]}function oV(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,Qt(o,a<0?0:a,h)):[]}function sV(o,a){return o&&o.length?ta(o,pe(a,3),!1,!0):[]}function aV(o,a){return o&&o.length?ta(o,pe(a,3)):[]}var lV=Ve(function(o){return _r(ht(o,1,tt,!0))}),cV=Ve(function(o){var a=en(o);return tt(a)&&(a=n),_r(ht(o,1,tt,!0),pe(a,2))}),dV=Ve(function(o){var a=en(o);return a=typeof a=="function"?a:n,_r(ht(o,1,tt,!0),n,a)});function uV(o){return o&&o.length?_r(o):[]}function pV(o,a){return o&&o.length?_r(o,pe(a,2)):[]}function hV(o,a){return a=typeof a=="function"?a:n,o&&o.length?_r(o,n,a):[]}function Ic(o){if(!(o&&o.length))return[];var a=0;return o=fr(o,function(d){if(tt(d))return a=at(d.length,a),!0}),ec(a,function(d){return qe(o,Jl(d))})}function uf(o,a){if(!(o&&o.length))return[];var d=Ic(o);return a==null?d:qe(d,function(h){return zt(a,n,h)})}var fV=Ve(function(o,a){return tt(o)?Go(o,a):[]}),mV=Ve(function(o){return wc(fr(o,tt))}),gV=Ve(function(o){var a=en(o);return tt(a)&&(a=n),wc(fr(o,tt),pe(a,2))}),yV=Ve(function(o){var a=en(o);return a=typeof a=="function"?a:n,wc(fr(o,tt),n,a)}),vV=Ve(Ic);function _V(o,a){return Bh(o||[],a||[],Oo)}function CV(o,a){return Bh(o||[],a||[],$o)}var wV=Ve(function(o){var a=o.length,d=a>1?o[a-1]:n;return d=typeof d=="function"?(o.pop(),d):n,uf(o,d)});function pf(o){var a=y(o);return a.__chain__=!0,a}function bV(o,a){return a(o),o}function da(o,a){return a(o)}var xV=Un(function(o){var a=o.length,d=a?o[0]:0,h=this.__wrapped__,g=function(_){return lc(_,o)};return a>1||this.__actions__.length||!(h instanceof De)||!Wn(d)?this.thru(g):(h=h.slice(d,+d+(a?1:0)),h.__actions__.push({func:da,args:[g],thisArg:n}),new Jt(h,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function kV(){return pf(this)}function SV(){return new Jt(this.value(),this.__chain__)}function EV(){this.__values__===n&&(this.__values__=Ef(this.value()));var o=this.__index__>=this.__values__.length,a=o?n:this.__values__[this.__index__++];return{done:o,value:a}}function TV(){return this}function BV(o){for(var a,d=this;d instanceof Ks;){var h=of(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=o,a}function AV(){var o=this.__wrapped__;if(o instanceof De){var a=o;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:da,args:[Mc],thisArg:n}),new Jt(a,this.__chain__)}return this.thru(Mc)}function PV(){return Th(this.__wrapped__,this.__actions__)}var VV=na(function(o,a,d){Ze.call(o,d)?++o[d]:Zn(o,d,1)});function NV(o,a,d){var h=ke(o)?Gp:bA;return d&&St(o,a,d)&&(a=n),h(o,pe(a,3))}function DV(o,a){var d=ke(o)?fr:dh;return d(o,pe(a,3))}var FV=Lh(sf),RV=Lh(af);function MV(o,a){return ht(ua(o,a),1)}function IV(o,a){return ht(ua(o,a),ve)}function LV(o,a,d){return d=d===n?1:Te(d),ht(ua(o,a),d)}function hf(o,a){var d=ke(o)?Kt:vr;return d(o,pe(a,3))}function ff(o,a){var d=ke(o)?rB:ch;return d(o,pe(a,3))}var OV=na(function(o,a,d){Ze.call(o,d)?o[d].push(a):Zn(o,d,[a])});function GV(o,a,d,h){o=Vt(o)?o:Bi(o),d=d&&!h?Te(d):0;var g=o.length;return d<0&&(d=at(g+d,0)),ga(o)?d<=g&&o.indexOf(a,d)>-1:!!g&&gi(o,a,d)>-1}var zV=Ve(function(o,a,d){var h=-1,g=typeof a=="function",_=Vt(o)?L(o.length):[];return vr(o,function(x){_[++h]=g?zt(a,x,d):zo(x,a,d)}),_}),ZV=na(function(o,a,d){Zn(o,d,a)});function ua(o,a){var d=ke(o)?qe:gh;return d(o,pe(a,3))}function $V(o,a,d,h){return o==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),Ch(o,a,d))}var UV=na(function(o,a,d){o[d?0:1].push(a)},function(){return[[],[]]});function WV(o,a,d){var h=ke(o)?Kl:Up,g=arguments.length<3;return h(o,pe(a,4),d,g,vr)}function HV(o,a,d){var h=ke(o)?iB:Up,g=arguments.length<3;return h(o,pe(a,4),d,g,ch)}function jV(o,a){var d=ke(o)?fr:dh;return d(o,fa(pe(a,3)))}function qV(o){var a=ke(o)?oh:GA;return a(o)}function KV(o,a,d){(d?St(o,a,d):a===n)?a=1:a=Te(a);var h=ke(o)?yA:zA;return h(o,a)}function YV(o){var a=ke(o)?vA:$A;return a(o)}function JV(o){if(o==null)return 0;if(Vt(o))return ga(o)?vi(o):o.length;var a=_t(o);return a==yn||a==vn?o.size:fc(o).length}function XV(o,a,d){var h=ke(o)?Yl:UA;return d&&St(o,a,d)&&(a=n),h(o,pe(a,3))}var QV=Ve(function(o,a){if(o==null)return[];var d=a.length;return d>1&&St(o,a[0],a[1])?a=[]:d>2&&St(a[0],a[1],a[2])&&(a=[a[0]]),Ch(o,ht(a,1),[])}),pa=DB||function(){return pt.Date.now()};function eN(o,a){if(typeof a!="function")throw new Yt(c);return o=Te(o),function(){if(--o<1)return a.apply(this,arguments)}}function mf(o,a,d){return a=d?n:a,a=o&&a==null?o.length:a,$n(o,z,n,n,n,n,a)}function gf(o,a){var d;if(typeof a!="function")throw new Yt(c);return o=Te(o),function(){return--o>0&&(d=a.apply(this,arguments)),o<=1&&(a=n),d}}var Lc=Ve(function(o,a,d){var h=N;if(d.length){var g=gr(d,Ei(Lc));h|=R}return $n(o,h,a,d,g)}),yf=Ve(function(o,a,d){var h=N|C;if(d.length){var g=gr(d,Ei(yf));h|=R}return $n(a,h,o,d,g)});function vf(o,a,d){a=d?n:a;var h=$n(o,Q,n,n,n,n,n,a);return h.placeholder=vf.placeholder,h}function _f(o,a,d){a=d?n:a;var h=$n(o,M,n,n,n,n,n,a);return h.placeholder=_f.placeholder,h}function Cf(o,a,d){var h,g,_,x,E,V,H=0,j=!1,q=!1,te=!0;if(typeof o!="function")throw new Yt(c);a=tn(a)||0,Je(d)&&(j=!!d.leading,q="maxWait"in d,_=q?at(tn(d.maxWait)||0,a):_,te="trailing"in d?!!d.trailing:te);function le(nt){var bn=h,qn=g;return h=g=n,H=nt,x=o.apply(qn,bn),x}function fe(nt){return H=nt,E=Ho(Ne,a),j?le(nt):x}function Pe(nt){var bn=nt-V,qn=nt-H,Of=a-bn;return q?vt(Of,_-qn):Of}function me(nt){var bn=nt-V,qn=nt-H;return V===n||bn>=a||bn<0||q&&qn>=_}function Ne(){var nt=pa();if(me(nt))return Fe(nt);E=Ho(Ne,Pe(nt))}function Fe(nt){return E=n,te&&h?le(nt):(h=g=n,x)}function Wt(){E!==n&&Ah(E),H=0,h=V=g=E=n}function Et(){return E===n?x:Fe(pa())}function Ht(){var nt=pa(),bn=me(nt);if(h=arguments,g=this,V=nt,bn){if(E===n)return fe(V);if(q)return Ah(E),E=Ho(Ne,a),le(V)}return E===n&&(E=Ho(Ne,a)),x}return Ht.cancel=Wt,Ht.flush=Et,Ht}var tN=Ve(function(o,a){return lh(o,1,a)}),nN=Ve(function(o,a,d){return lh(o,tn(a)||0,d)});function rN(o){return $n(o,Z)}function ha(o,a){if(typeof o!="function"||a!=null&&typeof a!="function")throw new Yt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=d.cache;if(_.has(g))return _.get(g);var x=o.apply(this,h);return d.cache=_.set(g,x)||_,x};return d.cache=new(ha.Cache||zn),d}ha.Cache=zn;function fa(o){if(typeof o!="function")throw new Yt(c);return function(){var a=arguments;switch(a.length){case 0:return!o.call(this);case 1:return!o.call(this,a[0]);case 2:return!o.call(this,a[0],a[1]);case 3:return!o.call(this,a[0],a[1],a[2])}return!o.apply(this,a)}}function iN(o){return gf(2,o)}var oN=WA(function(o,a){a=a.length==1&&ke(a[0])?qe(a[0],Zt(pe())):qe(ht(a,1),Zt(pe()));var d=a.length;return Ve(function(h){for(var g=-1,_=vt(h.length,d);++g<_;)h[g]=a[g].call(this,h[g]);return zt(o,this,h)})}),Oc=Ve(function(o,a){var d=gr(a,Ei(Oc));return $n(o,R,n,a,d)}),wf=Ve(function(o,a){var d=gr(a,Ei(wf));return $n(o,U,n,a,d)}),sN=Un(function(o,a){return $n(o,P,n,n,n,a)});function aN(o,a){if(typeof o!="function")throw new Yt(c);return a=a===n?a:Te(a),Ve(o,a)}function lN(o,a){if(typeof o!="function")throw new Yt(c);return a=a==null?0:at(Te(a),0),Ve(function(d){var h=d[a],g=wr(d,0,a);return h&&mr(g,h),zt(o,this,g)})}function cN(o,a,d){var h=!0,g=!0;if(typeof o!="function")throw new Yt(c);return Je(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),Cf(o,a,{leading:h,maxWait:a,trailing:g})}function dN(o){return mf(o,1)}function uN(o,a){return Oc(xc(a),o)}function pN(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function hN(o){return Xt(o,S)}function fN(o,a){return a=typeof a=="function"?a:n,Xt(o,S,a)}function mN(o){return Xt(o,v|S)}function gN(o,a){return a=typeof a=="function"?a:n,Xt(o,v|S,a)}function yN(o,a){return a==null||ah(o,a,ut(a))}function wn(o,a){return o===a||o!==o&&a!==a}var vN=sa(uc),_N=sa(function(o,a){return o>=a}),jr=hh(function(){return arguments}())?hh:function(o){return Qe(o)&&Ze.call(o,"callee")&&!Qp.call(o,"callee")},ke=L.isArray,CN=Fp?Zt(Fp):BA;function Vt(o){return o!=null&&ma(o.length)&&!Hn(o)}function tt(o){return Qe(o)&&Vt(o)}function wN(o){return o===!0||o===!1||Qe(o)&&kt(o)==Eo}var br=RB||Yc,bN=Rp?Zt(Rp):AA;function xN(o){return Qe(o)&&o.nodeType===1&&!jo(o)}function kN(o){if(o==null)return!0;if(Vt(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||br(o)||Ti(o)||jr(o)))return!o.length;var a=_t(o);if(a==yn||a==vn)return!o.size;if(Wo(o))return!fc(o).length;for(var d in o)if(Ze.call(o,d))return!1;return!0}function SN(o,a){return Zo(o,a)}function EN(o,a,d){d=typeof d=="function"?d:n;var h=d?d(o,a):n;return h===n?Zo(o,a,n,d):!!h}function Gc(o){if(!Qe(o))return!1;var a=kt(o);return a==Ts||a==KE||typeof o.message=="string"&&typeof o.name=="string"&&!jo(o)}function TN(o){return typeof o=="number"&&th(o)}function Hn(o){if(!Je(o))return!1;var a=kt(o);return a==Bs||a==lp||a==qE||a==JE}function bf(o){return typeof o=="number"&&o==Te(o)}function ma(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=xe}function Je(o){var a=typeof o;return o!=null&&(a=="object"||a=="function")}function Qe(o){return o!=null&&typeof o=="object"}var xf=Mp?Zt(Mp):VA;function BN(o,a){return o===a||hc(o,a,Pc(a))}function AN(o,a,d){return d=typeof d=="function"?d:n,hc(o,a,Pc(a),d)}function PN(o){return kf(o)&&o!=+o}function VN(o){if(fP(o))throw new be(l);return fh(o)}function NN(o){return o===null}function DN(o){return o==null}function kf(o){return typeof o=="number"||Qe(o)&&kt(o)==Bo}function jo(o){if(!Qe(o)||kt(o)!=On)return!1;var a=Zs(o);if(a===null)return!0;var d=Ze.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&Ls.call(d)==AB}var zc=Ip?Zt(Ip):NA;function FN(o){return bf(o)&&o>=-xe&&o<=xe}var Sf=Lp?Zt(Lp):DA;function ga(o){return typeof o=="string"||!ke(o)&&Qe(o)&&kt(o)==Po}function Ut(o){return typeof o=="symbol"||Qe(o)&&kt(o)==As}var Ti=Op?Zt(Op):FA;function RN(o){return o===n}function MN(o){return Qe(o)&&_t(o)==Vo}function IN(o){return Qe(o)&&kt(o)==QE}var LN=sa(mc),ON=sa(function(o,a){return o<=a});function Ef(o){if(!o)return[];if(Vt(o))return ga(o)?_n(o):Pt(o);if(Fo&&o[Fo])return yB(o[Fo]());var a=_t(o),d=a==yn?nc:a==vn?Rs:Bi;return d(o)}function jn(o){if(!o)return o===0?o:0;if(o=tn(o),o===ve||o===-ve){var a=o<0?-1:1;return a*Gt}return o===o?o:0}function Te(o){var a=jn(o),d=a%1;return a===a?d?a-d:a:0}function Tf(o){return o?$r(Te(o),0,At):0}function tn(o){if(typeof o=="number")return o;if(Ut(o))return jt;if(Je(o)){var a=typeof o.valueOf=="function"?o.valueOf():o;o=Je(a)?a+"":a}if(typeof o!="string")return o===0?o:+o;o=Wp(o);var d=CT.test(o);return d||bT.test(o)?eB(o.slice(2),d?2:8):_T.test(o)?jt:+o}function Bf(o){return Pn(o,Nt(o))}function GN(o){return o?$r(Te(o),-xe,xe):o===0?o:0}function ze(o){return o==null?"":$t(o)}var zN=ki(function(o,a){if(Wo(a)||Vt(a)){Pn(a,ut(a),o);return}for(var d in a)Ze.call(a,d)&&Oo(o,d,a[d])}),Af=ki(function(o,a){Pn(a,Nt(a),o)}),ya=ki(function(o,a,d,h){Pn(a,Nt(a),o,h)}),ZN=ki(function(o,a,d,h){Pn(a,ut(a),o,h)}),$N=Un(lc);function UN(o,a){var d=xi(o);return a==null?d:sh(d,a)}var WN=Ve(function(o,a){o=$e(o);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&St(a[0],a[1],g)&&(h=1);++d<h;)for(var _=a[d],x=Nt(_),E=-1,V=x.length;++E<V;){var H=x[E],j=o[H];(j===n||wn(j,Ci[H])&&!Ze.call(o,H))&&(o[H]=_[H])}return o}),HN=Ve(function(o){return o.push(n,Wh),zt(Pf,n,o)});function jN(o,a){return zp(o,pe(a,3),An)}function qN(o,a){return zp(o,pe(a,3),dc)}function KN(o,a){return o==null?o:cc(o,pe(a,3),Nt)}function YN(o,a){return o==null?o:uh(o,pe(a,3),Nt)}function JN(o,a){return o&&An(o,pe(a,3))}function XN(o,a){return o&&dc(o,pe(a,3))}function QN(o){return o==null?[]:Xs(o,ut(o))}function eD(o){return o==null?[]:Xs(o,Nt(o))}function Zc(o,a,d){var h=o==null?n:Ur(o,a);return h===n?d:h}function tD(o,a){return o!=null&&qh(o,a,kA)}function $c(o,a){return o!=null&&qh(o,a,SA)}var nD=Gh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Os.call(a)),o[a]=d},Wc(Dt)),rD=Gh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Os.call(a)),Ze.call(o,a)?o[a].push(d):o[a]=[d]},pe),iD=Ve(zo);function ut(o){return Vt(o)?ih(o):fc(o)}function Nt(o){return Vt(o)?ih(o,!0):RA(o)}function oD(o,a){var d={};return a=pe(a,3),An(o,function(h,g,_){Zn(d,a(h,g,_),h)}),d}function sD(o,a){var d={};return a=pe(a,3),An(o,function(h,g,_){Zn(d,g,a(h,g,_))}),d}var aD=ki(function(o,a,d){Qs(o,a,d)}),Pf=ki(function(o,a,d,h){Qs(o,a,d,h)}),lD=Un(function(o,a){var d={};if(o==null)return d;var h=!1;a=qe(a,function(_){return _=Cr(_,o),h||(h=_.length>1),_}),Pn(o,Bc(o),d),h&&(d=Xt(d,v|k|S,nP));for(var g=a.length;g--;)Cc(d,a[g]);return d});function cD(o,a){return Vf(o,fa(pe(a)))}var dD=Un(function(o,a){return o==null?{}:IA(o,a)});function Vf(o,a){if(o==null)return{};var d=qe(Bc(o),function(h){return[h]});return a=pe(a),wh(o,d,function(h,g){return a(h,g[0])})}function uD(o,a,d){a=Cr(a,o);var h=-1,g=a.length;for(g||(g=1,o=n);++h<g;){var _=o==null?n:o[Vn(a[h])];_===n&&(h=g,_=d),o=Hn(_)?_.call(o):_}return o}function pD(o,a,d){return o==null?o:$o(o,a,d)}function hD(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:$o(o,a,d,h)}var Nf=$h(ut),Df=$h(Nt);function fD(o,a,d){var h=ke(o),g=h||br(o)||Ti(o);if(a=pe(a,4),d==null){var _=o&&o.constructor;g?d=h?new _:[]:Je(o)?d=Hn(_)?xi(Zs(o)):{}:d={}}return(g?Kt:An)(o,function(x,E,V){return a(d,x,E,V)}),d}function mD(o,a){return o==null?!0:Cc(o,a)}function gD(o,a,d){return o==null?o:Eh(o,a,xc(d))}function yD(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:Eh(o,a,xc(d),h)}function Bi(o){return o==null?[]:tc(o,ut(o))}function vD(o){return o==null?[]:tc(o,Nt(o))}function _D(o,a,d){return d===n&&(d=a,a=n),d!==n&&(d=tn(d),d=d===d?d:0),a!==n&&(a=tn(a),a=a===a?a:0),$r(tn(o),a,d)}function CD(o,a,d){return a=jn(a),d===n?(d=a,a=0):d=jn(d),o=tn(o),EA(o,a,d)}function wD(o,a,d){if(d&&typeof d!="boolean"&&St(o,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof o=="boolean"&&(d=o,o=n)),o===n&&a===n?(o=0,a=1):(o=jn(o),a===n?(a=o,o=0):a=jn(a)),o>a){var h=o;o=a,a=h}if(d||o%1||a%1){var g=nh();return vt(o+g*(a-o+QT("1e-"+((g+"").length-1))),a)}return yc(o,a)}var bD=Si(function(o,a,d){return a=a.toLowerCase(),o+(d?Ff(a):a)});function Ff(o){return Uc(ze(o).toLowerCase())}function Rf(o){return o=ze(o),o&&o.replace(kT,pB).replace($T,"")}function xD(o,a,d){o=ze(o),a=$t(a);var h=o.length;d=d===n?h:$r(Te(d),0,h);var g=d;return d-=a.length,d>=0&&o.slice(d,g)==a}function kD(o){return o=ze(o),o&&iT.test(o)?o.replace(up,hB):o}function SD(o){return o=ze(o),o&&dT.test(o)?o.replace(Ol,"\\$&"):o}var ED=Si(function(o,a,d){return o+(d?"-":"")+a.toLowerCase()}),TD=Si(function(o,a,d){return o+(d?" ":"")+a.toLowerCase()}),BD=Ih("toLowerCase");function AD(o,a,d){o=ze(o),a=Te(a);var h=a?vi(o):0;if(!a||h>=a)return o;var g=(a-h)/2;return oa(Hs(g),d)+o+oa(Ws(g),d)}function PD(o,a,d){o=ze(o),a=Te(a);var h=a?vi(o):0;return a&&h<a?o+oa(a-h,d):o}function VD(o,a,d){o=ze(o),a=Te(a);var h=a?vi(o):0;return a&&h<a?oa(a-h,d)+o:o}function ND(o,a,d){return d||a==null?a=0:a&&(a=+a),OB(ze(o).replace(Gl,""),a||0)}function DD(o,a,d){return(d?St(o,a,d):a===n)?a=1:a=Te(a),vc(ze(o),a)}function FD(){var o=arguments,a=ze(o[0]);return o.length<3?a:a.replace(o[1],o[2])}var RD=Si(function(o,a,d){return o+(d?"_":"")+a.toLowerCase()});function MD(o,a,d){return d&&typeof d!="number"&&St(o,a,d)&&(a=d=n),d=d===n?At:d>>>0,d?(o=ze(o),o&&(typeof a=="string"||a!=null&&!zc(a))&&(a=$t(a),!a&&yi(o))?wr(_n(o),0,d):o.split(a,d)):[]}var ID=Si(function(o,a,d){return o+(d?" ":"")+Uc(a)});function LD(o,a,d){return o=ze(o),d=d==null?0:$r(Te(d),0,o.length),a=$t(a),o.slice(d,d+a.length)==a}function OD(o,a,d){var h=y.templateSettings;d&&St(o,a,d)&&(a=n),o=ze(o),a=ya({},a,h,Uh);var g=ya({},a.imports,h.imports,Uh),_=ut(g),x=tc(g,_),E,V,H=0,j=a.interpolate||Ps,q="__p += '",te=rc((a.escape||Ps).source+"|"+j.source+"|"+(j===pp?vT:Ps).source+"|"+(a.evaluate||Ps).source+"|$","g"),le="//# sourceURL="+(Ze.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++qT+"]")+`
|
|
73
|
-
`;o.replace(te,function(
|
|
74
|
-
__e(`+
|
|
75
|
-
'`),
|
|
76
|
-
`+
|
|
77
|
-
__p += '`),Fe&&(
|
|
72
|
+
`)}function hA(o){return ke(o)||Jr(o)||!!(sh&&o&&o[sh])}function qn(o,a){var d=typeof o;return a=a??we,!!a&&(d=="number"||d!="symbol"&&ST.test(o))&&o>-1&&o%1==0&&o<a}function Vt(o,a,d){if(!Qe(d))return!1;var h=typeof a;return(h=="number"?Ft(d)&&qn(a,d.length):h=="string"&&a in d)?bn(d[a],o):!1}function Mc(o,a){if(ke(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Ht(o)?!0:dT.test(o)||!cT.test(o)||a!=null&&o in We(a)}function fA(o){var a=typeof o;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?o!=="__proto__":o===null}function Ic(o){var a=ha(o),d=v[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(o===d)return!0;var h=Dc(d);return!!h&&o===h[0]}function mA(o){return!!nh&&nh in o}var gA=Us?Kn:ed;function jo(o){var a=o&&o.constructor,d=typeof a=="function"&&a.prototype||ki;return o===d}function nf(o){return o===o&&!Qe(o)}function rf(o,a){return function(d){return d==null?!1:d[o]===a&&(a!==n||o in We(d))}}function yA(o){var a=_a(o,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function vA(o,a){var d=o[1],h=a[1],g=d|h,_=g<(F|C|T),x=h==T&&d==Q||h==T&&d==k&&o[7].length<=a[8]||h==(T|k)&&a[7].length<=a[8]&&d==Q;if(!(_||x))return o;h&F&&(o[2]=a[2],g|=d&F?0:G);var B=a[3];if(B){var D=o[3];o[3]=D?Oh(D,B,a[4]):B,o[4]=D?wr(o[3],m):a[4]}return B=a[5],B&&(D=o[5],o[5]=D?Gh(D,B,a[6]):B,o[6]=D?wr(o[5],m):a[6]),B=a[7],B&&(o[7]=B),h&T&&(o[8]=o[8]==null?a[8]:wt(o[8],a[8])),o[9]==null&&(o[9]=a[9]),o[0]=a[0],o[1]=g,o}function _A(o){var a=[];if(o!=null)for(var d in We(o))a.push(d);return a}function CA(o){return Ws.call(o)}function of(o,a,d){return a=lt(a===n?o.length-1:a,0),function(){for(var h=arguments,g=-1,_=lt(h.length-a,0),x=z(_);++g<_;)x[g]=h[a+g];g=-1;for(var B=z(a+1);++g<a;)B[g]=h[g];return B[a]=d(x),Ut(o,this,B)}}function sf(o,a){return a.length<2?o:qr(o,en(a,0,-1))}function wA(o,a){for(var d=o.length,h=wt(a.length,d),g=Dt(o);h--;){var _=a[h];o[h]=qn(_,d)?g[_]:n}return o}function Lc(o,a){if(!(a==="constructor"&&typeof o[a]=="function")&&a!="__proto__")return o[a]}var af=cf(Vh),qo=MB||function(o,a){return ft.setTimeout(o,a)},Oc=cf($V);function lf(o,a,d){var h=a+"";return Oc(o,pA(h,bA(cA(h),d)))}function cf(o){var a=0,d=0;return function(){var h=GB(),g=$-(h-d);if(d=h,g>0){if(++a>=se)return arguments[0]}else a=0;return o.apply(n,arguments)}}function ma(o,a){var d=-1,h=o.length,g=h-1;for(a=a===n?h:a;++d<a;){var _=wc(d,g),x=o[_];o[_]=o[d],o[d]=x}return o.length=a,o}var df=yA(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(uT,function(d,h,g,_){a.push(g?_.replace(_T,"$1"):h||d)}),a});function Dn(o){if(typeof o=="string"||Ht(o))return o;var a=o+"";return a=="0"&&1/o==-pe?"-0":a}function Yr(o){if(o!=null){try{return $s.call(o)}catch{}try{return o+""}catch{}}return""}function bA(o,a){return Yt(vr,function(d){var h="_."+d[0];a&d[1]&&!Os(o,h)&&o.push(h)}),o.sort()}function uf(o){if(o instanceof De)return o.clone();var a=new Xt(o.__wrapped__,o.__chain__);return a.__actions__=Dt(o.__actions__),a.__index__=o.__index__,a.__values__=o.__values__,a}function xA(o,a,d){(d?Vt(o,a,d):a===n)?a=1:a=lt(Te(a),0);var h=o==null?0:o.length;if(!h||a<1)return[];for(var g=0,_=0,x=z(Js(h/a));g<h;)x[_++]=en(o,g,g+=a);return x}function kA(o){for(var a=-1,d=o==null?0:o.length,h=0,g=[];++a<d;){var _=o[a];_&&(g[h++]=_)}return g}function SA(){var o=arguments.length;if(!o)return[];for(var a=z(o-1),d=arguments[0],h=o;h--;)a[h-1]=arguments[h];return Cr(ke(d)?Dt(d):[d],mt(a,1))}var EA=Ne(function(o,a){return nt(o)?Zo(o,mt(a,1,nt,!0)):[]}),TA=Ne(function(o,a){var d=tn(a);return nt(d)&&(d=n),nt(o)?Zo(o,mt(a,1,nt,!0),he(d,2)):[]}),BA=Ne(function(o,a){var d=tn(a);return nt(d)&&(d=n),nt(o)?Zo(o,mt(a,1,nt,!0),n,d):[]});function VA(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),en(o,a<0?0:a,h)):[]}function AA(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,en(o,0,a<0?0:a)):[]}function NA(o,a){return o&&o.length?aa(o,he(a,3),!0,!0):[]}function PA(o,a){return o&&o.length?aa(o,he(a,3),!0):[]}function DA(o,a,d,h){var g=o==null?0:o.length;return g?(d&&typeof d!="number"&&Vt(o,a,d)&&(d=0,h=g),SV(o,a,d,h)):[]}function pf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Gs(o,he(a,3),g)}function hf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h-1;return d!==n&&(g=Te(d),g=d<0?lt(h+g,0):wt(g,h-1)),Gs(o,he(a,3),g,!0)}function ff(o){var a=o==null?0:o.length;return a?mt(o,1):[]}function FA(o){var a=o==null?0:o.length;return a?mt(o,pe):[]}function RA(o,a){var d=o==null?0:o.length;return d?(a=a===n?1:Te(a),mt(o,a)):[]}function MA(o){for(var a=-1,d=o==null?0:o.length,h={};++a<d;){var g=o[a];h[g[0]]=g[1]}return h}function mf(o){return o&&o.length?o[0]:n}function IA(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Ci(o,a,g)}function LA(o){var a=o==null?0:o.length;return a?en(o,0,-1):[]}var OA=Ne(function(o){var a=Ye(o,Ec);return a.length&&a[0]===o[0]?gc(a):[]}),GA=Ne(function(o){var a=tn(o),d=Ye(o,Ec);return a===tn(d)?a=n:d.pop(),d.length&&d[0]===o[0]?gc(d,he(a,2)):[]}),zA=Ne(function(o){var a=tn(o),d=Ye(o,Ec);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===o[0]?gc(d,n,a):[]});function ZA(o,a){return o==null?"":LB.call(o,a)}function tn(o){var a=o==null?0:o.length;return a?o[a-1]:n}function UA(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h;return d!==n&&(g=Te(d),g=g<0?lt(h+g,0):wt(g,h-1)),a===a?bB(o,a,g):Gs(o,qp,g,!0)}function $A(o,a){return o&&o.length?Sh(o,Te(a)):n}var WA=Ne(gf);function gf(o,a){return o&&o.length&&a&&a.length?Cc(o,a):o}function HA(o,a,d){return o&&o.length&&a&&a.length?Cc(o,a,he(d,2)):o}function jA(o,a,d){return o&&o.length&&a&&a.length?Cc(o,a,n,d):o}var qA=jn(function(o,a){var d=o==null?0:o.length,h=pc(o,a);return Bh(o,Ye(a,function(g){return qn(g,d)?+g:g}).sort(Lh)),h});function KA(o,a){var d=[];if(!(o&&o.length))return d;var h=-1,g=[],_=o.length;for(a=he(a,3);++h<_;){var x=o[h];a(x,h,o)&&(d.push(x),g.push(h))}return Bh(o,g),d}function Gc(o){return o==null?o:ZB.call(o)}function YA(o,a,d){var h=o==null?0:o.length;return h?(d&&typeof d!="number"&&Vt(o,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),en(o,a,d)):[]}function JA(o,a){return sa(o,a)}function XA(o,a,d){return xc(o,a,he(d,2))}function QA(o,a){var d=o==null?0:o.length;if(d){var h=sa(o,a);if(h<d&&bn(o[h],a))return h}return-1}function eN(o,a){return sa(o,a,!0)}function tN(o,a,d){return xc(o,a,he(d,2),!0)}function nN(o,a){var d=o==null?0:o.length;if(d){var h=sa(o,a,!0)-1;if(bn(o[h],a))return h}return-1}function rN(o){return o&&o.length?Ah(o):[]}function iN(o,a){return o&&o.length?Ah(o,he(a,2)):[]}function oN(o){var a=o==null?0:o.length;return a?en(o,1,a):[]}function sN(o,a,d){return o&&o.length?(a=d||a===n?1:Te(a),en(o,0,a<0?0:a)):[]}function aN(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,en(o,a<0?0:a,h)):[]}function lN(o,a){return o&&o.length?aa(o,he(a,3),!1,!0):[]}function cN(o,a){return o&&o.length?aa(o,he(a,3)):[]}var dN=Ne(function(o){return kr(mt(o,1,nt,!0))}),uN=Ne(function(o){var a=tn(o);return nt(a)&&(a=n),kr(mt(o,1,nt,!0),he(a,2))}),pN=Ne(function(o){var a=tn(o);return a=typeof a=="function"?a:n,kr(mt(o,1,nt,!0),n,a)});function hN(o){return o&&o.length?kr(o):[]}function fN(o,a){return o&&o.length?kr(o,he(a,2)):[]}function mN(o,a){return a=typeof a=="function"?a:n,o&&o.length?kr(o,n,a):[]}function zc(o){if(!(o&&o.length))return[];var a=0;return o=_r(o,function(d){if(nt(d))return a=lt(d.length,a),!0}),ic(a,function(d){return Ye(o,tc(d))})}function yf(o,a){if(!(o&&o.length))return[];var d=zc(o);return a==null?d:Ye(d,function(h){return Ut(a,n,h)})}var gN=Ne(function(o,a){return nt(o)?Zo(o,a):[]}),yN=Ne(function(o){return Sc(_r(o,nt))}),vN=Ne(function(o){var a=tn(o);return nt(a)&&(a=n),Sc(_r(o,nt),he(a,2))}),_N=Ne(function(o){var a=tn(o);return a=typeof a=="function"?a:n,Sc(_r(o,nt),n,a)}),CN=Ne(zc);function wN(o,a){return Fh(o||[],a||[],zo)}function bN(o,a){return Fh(o||[],a||[],Wo)}var xN=Ne(function(o){var a=o.length,d=a>1?o[a-1]:n;return d=typeof d=="function"?(o.pop(),d):n,yf(o,d)});function vf(o){var a=v(o);return a.__chain__=!0,a}function kN(o,a){return a(o),o}function ga(o,a){return a(o)}var SN=jn(function(o){var a=o.length,d=a?o[0]:0,h=this.__wrapped__,g=function(_){return pc(_,o)};return a>1||this.__actions__.length||!(h instanceof De)||!qn(d)?this.thru(g):(h=h.slice(d,+d+(a?1:0)),h.__actions__.push({func:ga,args:[g],thisArg:n}),new Xt(h,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function EN(){return vf(this)}function TN(){return new Xt(this.value(),this.__chain__)}function BN(){this.__values__===n&&(this.__values__=Pf(this.value()));var o=this.__index__>=this.__values__.length,a=o?n:this.__values__[this.__index__++];return{done:o,value:a}}function VN(){return this}function AN(o){for(var a,d=this;d instanceof ta;){var h=uf(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=o,a}function NN(){var o=this.__wrapped__;if(o instanceof De){var a=o;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:ga,args:[Gc],thisArg:n}),new Xt(a,this.__chain__)}return this.thru(Gc)}function PN(){return Dh(this.__wrapped__,this.__actions__)}var DN=la(function(o,a,d){$e.call(o,d)?++o[d]:Wn(o,d,1)});function FN(o,a,d){var h=ke(o)?Hp:kV;return d&&Vt(o,a,d)&&(a=n),h(o,he(a,3))}function RN(o,a){var d=ke(o)?_r:gh;return d(o,he(a,3))}var MN=$h(pf),IN=$h(hf);function LN(o,a){return mt(ya(o,a),1)}function ON(o,a){return mt(ya(o,a),pe)}function GN(o,a,d){return d=d===n?1:Te(d),mt(ya(o,a),d)}function _f(o,a){var d=ke(o)?Yt:xr;return d(o,he(a,3))}function Cf(o,a){var d=ke(o)?oB:mh;return d(o,he(a,3))}var zN=la(function(o,a,d){$e.call(o,d)?o[d].push(a):Wn(o,d,[a])});function ZN(o,a,d,h){o=Ft(o)?o:Pi(o),d=d&&!h?Te(d):0;var g=o.length;return d<0&&(d=lt(g+d,0)),ba(o)?d<=g&&o.indexOf(a,d)>-1:!!g&&Ci(o,a,d)>-1}var UN=Ne(function(o,a,d){var h=-1,g=typeof a=="function",_=Ft(o)?z(o.length):[];return xr(o,function(x){_[++h]=g?Ut(a,x,d):Uo(x,a,d)}),_}),$N=la(function(o,a,d){Wn(o,d,a)});function ya(o,a){var d=ke(o)?Ye:bh;return d(o,he(a,3))}function WN(o,a,d,h){return o==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),Eh(o,a,d))}var HN=la(function(o,a,d){o[d?0:1].push(a)},function(){return[[],[]]});function jN(o,a,d){var h=ke(o)?Ql:Yp,g=arguments.length<3;return h(o,he(a,4),d,g,xr)}function qN(o,a,d){var h=ke(o)?sB:Yp,g=arguments.length<3;return h(o,he(a,4),d,g,mh)}function KN(o,a){var d=ke(o)?_r:gh;return d(o,Ca(he(a,3)))}function YN(o){var a=ke(o)?uh:ZV;return a(o)}function JN(o,a,d){(d?Vt(o,a,d):a===n)?a=1:a=Te(a);var h=ke(o)?_V:UV;return h(o,a)}function XN(o){var a=ke(o)?CV:WV;return a(o)}function QN(o){if(o==null)return 0;if(Ft(o))return ba(o)?bi(o):o.length;var a=bt(o);return a==vn||a==_n?o.size:vc(o).length}function eP(o,a,d){var h=ke(o)?ec:HV;return d&&Vt(o,a,d)&&(a=n),h(o,he(a,3))}var tP=Ne(function(o,a){if(o==null)return[];var d=a.length;return d>1&&Vt(o,a[0],a[1])?a=[]:d>2&&Vt(a[0],a[1],a[2])&&(a=[a[0]]),Eh(o,mt(a,1),[])}),va=RB||function(){return ft.Date.now()};function nP(o,a){if(typeof a!="function")throw new Jt(c);return o=Te(o),function(){if(--o<1)return a.apply(this,arguments)}}function wf(o,a,d){return a=d?n:a,a=o&&a==null?o.length:a,Hn(o,T,n,n,n,n,a)}function bf(o,a){var d;if(typeof a!="function")throw new Jt(c);return o=Te(o),function(){return--o>0&&(d=a.apply(this,arguments)),o<=1&&(a=n),d}}var Zc=Ne(function(o,a,d){var h=F;if(d.length){var g=wr(d,Ai(Zc));h|=L}return Hn(o,h,a,d,g)}),xf=Ne(function(o,a,d){var h=F|C;if(d.length){var g=wr(d,Ai(xf));h|=L}return Hn(a,h,o,d,g)});function kf(o,a,d){a=d?n:a;var h=Hn(o,Q,n,n,n,n,n,a);return h.placeholder=kf.placeholder,h}function Sf(o,a,d){a=d?n:a;var h=Hn(o,I,n,n,n,n,n,a);return h.placeholder=Sf.placeholder,h}function Ef(o,a,d){var h,g,_,x,B,D,H=0,j=!1,K=!1,te=!0;if(typeof o!="function")throw new Jt(c);a=nn(a)||0,Qe(d)&&(j=!!d.leading,K="maxWait"in d,_=K?lt(nn(d.maxWait)||0,a):_,te="trailing"in d?!!d.trailing:te);function ce(rt){var xn=h,Jn=g;return h=g=n,H=rt,x=o.apply(Jn,xn),x}function me(rt){return H=rt,B=qo(Pe,a),j?ce(rt):x}function Ae(rt){var xn=rt-D,Jn=rt-H,Wf=a-xn;return K?wt(Wf,_-Jn):Wf}function ge(rt){var xn=rt-D,Jn=rt-H;return D===n||xn>=a||xn<0||K&&Jn>=_}function Pe(){var rt=va();if(ge(rt))return Fe(rt);B=qo(Pe,Ae(rt))}function Fe(rt){return B=n,te&&h?ce(rt):(h=g=n,x)}function jt(){B!==n&&Rh(B),H=0,h=D=g=B=n}function At(){return B===n?x:Fe(va())}function qt(){var rt=va(),xn=ge(rt);if(h=arguments,g=this,D=rt,xn){if(B===n)return me(D);if(K)return Rh(B),B=qo(Pe,a),ce(D)}return B===n&&(B=qo(Pe,a)),x}return qt.cancel=jt,qt.flush=At,qt}var rP=Ne(function(o,a){return fh(o,1,a)}),iP=Ne(function(o,a,d){return fh(o,nn(a)||0,d)});function oP(o){return Hn(o,O)}function _a(o,a){if(typeof o!="function"||a!=null&&typeof a!="function")throw new Jt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=d.cache;if(_.has(g))return _.get(g);var x=o.apply(this,h);return d.cache=_.set(g,x)||_,x};return d.cache=new(_a.Cache||$n),d}_a.Cache=$n;function Ca(o){if(typeof o!="function")throw new Jt(c);return function(){var a=arguments;switch(a.length){case 0:return!o.call(this);case 1:return!o.call(this,a[0]);case 2:return!o.call(this,a[0],a[1]);case 3:return!o.call(this,a[0],a[1],a[2])}return!o.apply(this,a)}}function sP(o){return bf(2,o)}var aP=jV(function(o,a){a=a.length==1&&ke(a[0])?Ye(a[0],$t(he())):Ye(mt(a,1),$t(he()));var d=a.length;return Ne(function(h){for(var g=-1,_=wt(h.length,d);++g<_;)h[g]=a[g].call(this,h[g]);return Ut(o,this,h)})}),Uc=Ne(function(o,a){var d=wr(a,Ai(Uc));return Hn(o,L,n,a,d)}),Tf=Ne(function(o,a){var d=wr(a,Ai(Tf));return Hn(o,U,n,a,d)}),lP=jn(function(o,a){return Hn(o,k,n,n,n,a)});function cP(o,a){if(typeof o!="function")throw new Jt(c);return a=a===n?a:Te(a),Ne(o,a)}function dP(o,a){if(typeof o!="function")throw new Jt(c);return a=a==null?0:lt(Te(a),0),Ne(function(d){var h=d[a],g=Er(d,0,a);return h&&Cr(g,h),Ut(o,this,g)})}function uP(o,a,d){var h=!0,g=!0;if(typeof o!="function")throw new Jt(c);return Qe(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),Ef(o,a,{leading:h,maxWait:a,trailing:g})}function pP(o){return wf(o,1)}function hP(o,a){return Uc(Tc(a),o)}function fP(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function mP(o){return Qt(o,E)}function gP(o,a){return a=typeof a=="function"?a:n,Qt(o,E,a)}function yP(o){return Qt(o,y|E)}function vP(o,a){return a=typeof a=="function"?a:n,Qt(o,y|E,a)}function _P(o,a){return a==null||hh(o,a,pt(a))}function bn(o,a){return o===a||o!==o&&a!==a}var CP=pa(mc),wP=pa(function(o,a){return o>=a}),Jr=_h(function(){return arguments}())?_h:function(o){return et(o)&&$e.call(o,"callee")&&!oh.call(o,"callee")},ke=z.isArray,bP=Gp?$t(Gp):AV;function Ft(o){return o!=null&&wa(o.length)&&!Kn(o)}function nt(o){return et(o)&&Ft(o)}function xP(o){return o===!0||o===!1||et(o)&&Bt(o)==Bo}var Tr=IB||ed,kP=zp?$t(zp):NV;function SP(o){return et(o)&&o.nodeType===1&&!Ko(o)}function EP(o){if(o==null)return!0;if(Ft(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||Tr(o)||Ni(o)||Jr(o)))return!o.length;var a=bt(o);if(a==vn||a==_n)return!o.size;if(jo(o))return!vc(o).length;for(var d in o)if($e.call(o,d))return!1;return!0}function TP(o,a){return $o(o,a)}function BP(o,a,d){d=typeof d=="function"?d:n;var h=d?d(o,a):n;return h===n?$o(o,a,n,d):!!h}function $c(o){if(!et(o))return!1;var a=Bt(o);return a==Ds||a==JE||typeof o.message=="string"&&typeof o.name=="string"&&!Ko(o)}function VP(o){return typeof o=="number"&&ah(o)}function Kn(o){if(!Qe(o))return!1;var a=Bt(o);return a==Fs||a==fp||a==Ps||a==QE}function Bf(o){return typeof o=="number"&&o==Te(o)}function wa(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=we}function Qe(o){var a=typeof o;return o!=null&&(a=="object"||a=="function")}function et(o){return o!=null&&typeof o=="object"}var Vf=Zp?$t(Zp):DV;function AP(o,a){return o===a||yc(o,a,Fc(a))}function NP(o,a,d){return d=typeof d=="function"?d:n,yc(o,a,Fc(a),d)}function PP(o){return Af(o)&&o!=+o}function DP(o){if(gA(o))throw new xe(l);return Ch(o)}function FP(o){return o===null}function RP(o){return o==null}function Af(o){return typeof o=="number"||et(o)&&Bt(o)==Ao}function Ko(o){if(!et(o)||Bt(o)!=Zn)return!1;var a=qs(o);if(a===null)return!0;var d=$e.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&$s.call(d)==NB}var Wc=Up?$t(Up):FV;function MP(o){return Bf(o)&&o>=-we&&o<=we}var Nf=$p?$t($p):RV;function ba(o){return typeof o=="string"||!ke(o)&&et(o)&&Bt(o)==Po}function Ht(o){return typeof o=="symbol"||et(o)&&Bt(o)==Rs}var Ni=Wp?$t(Wp):MV;function IP(o){return o===n}function LP(o){return et(o)&&bt(o)==Do}function OP(o){return et(o)&&Bt(o)==tT}var GP=pa(_c),zP=pa(function(o,a){return o<=a});function Pf(o){if(!o)return[];if(Ft(o))return ba(o)?Cn(o):Dt(o);if(Mo&&o[Mo])return _B(o[Mo]());var a=bt(o),d=a==vn?sc:a==_n?zs:Pi;return d(o)}function Yn(o){if(!o)return o===0?o:0;if(o=nn(o),o===pe||o===-pe){var a=o<0?-1:1;return a*Ct}return o===o?o:0}function Te(o){var a=Yn(o),d=a%1;return a===a?d?a-d:a:0}function Df(o){return o?jr(Te(o),0,ht):0}function nn(o){if(typeof o=="number")return o;if(Ht(o))return Tt;if(Qe(o)){var a=typeof o.valueOf=="function"?o.valueOf():o;o=Qe(a)?a+"":a}if(typeof o!="string")return o===0?o:+o;o=Jp(o);var d=bT.test(o);return d||kT.test(o)?nB(o.slice(2),d?2:8):wT.test(o)?Tt:+o}function Ff(o){return Pn(o,Rt(o))}function ZP(o){return o?jr(Te(o),-we,we):o===0?o:0}function Ue(o){return o==null?"":Wt(o)}var UP=Bi(function(o,a){if(jo(a)||Ft(a)){Pn(a,pt(a),o);return}for(var d in a)$e.call(a,d)&&zo(o,d,a[d])}),Rf=Bi(function(o,a){Pn(a,Rt(a),o)}),xa=Bi(function(o,a,d,h){Pn(a,Rt(a),o,h)}),$P=Bi(function(o,a,d,h){Pn(a,pt(a),o,h)}),WP=jn(pc);function HP(o,a){var d=Ti(o);return a==null?d:ph(d,a)}var jP=Ne(function(o,a){o=We(o);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&Vt(a[0],a[1],g)&&(h=1);++d<h;)for(var _=a[d],x=Rt(_),B=-1,D=x.length;++B<D;){var H=x[B],j=o[H];(j===n||bn(j,ki[H])&&!$e.call(o,H))&&(o[H]=_[H])}return o}),qP=Ne(function(o){return o.push(n,Jh),Ut(Mf,n,o)});function KP(o,a){return jp(o,he(a,3),Nn)}function YP(o,a){return jp(o,he(a,3),fc)}function JP(o,a){return o==null?o:hc(o,he(a,3),Rt)}function XP(o,a){return o==null?o:yh(o,he(a,3),Rt)}function QP(o,a){return o&&Nn(o,he(a,3))}function eD(o,a){return o&&fc(o,he(a,3))}function tD(o){return o==null?[]:ia(o,pt(o))}function nD(o){return o==null?[]:ia(o,Rt(o))}function Hc(o,a,d){var h=o==null?n:qr(o,a);return h===n?d:h}function rD(o,a){return o!=null&&ef(o,a,EV)}function jc(o,a){return o!=null&&ef(o,a,TV)}var iD=Hh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),o[a]=d},Kc(Mt)),oD=Hh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),$e.call(o,a)?o[a].push(d):o[a]=[d]},he),sD=Ne(Uo);function pt(o){return Ft(o)?dh(o):vc(o)}function Rt(o){return Ft(o)?dh(o,!0):IV(o)}function aD(o,a){var d={};return a=he(a,3),Nn(o,function(h,g,_){Wn(d,a(h,g,_),h)}),d}function lD(o,a){var d={};return a=he(a,3),Nn(o,function(h,g,_){Wn(d,g,a(h,g,_))}),d}var cD=Bi(function(o,a,d){oa(o,a,d)}),Mf=Bi(function(o,a,d,h){oa(o,a,d,h)}),dD=jn(function(o,a){var d={};if(o==null)return d;var h=!1;a=Ye(a,function(_){return _=Sr(_,o),h||(h=_.length>1),_}),Pn(o,Pc(o),d),h&&(d=Qt(d,y|S|E,iA));for(var g=a.length;g--;)kc(d,a[g]);return d});function uD(o,a){return If(o,Ca(he(a)))}var pD=jn(function(o,a){return o==null?{}:OV(o,a)});function If(o,a){if(o==null)return{};var d=Ye(Pc(o),function(h){return[h]});return a=he(a),Th(o,d,function(h,g){return a(h,g[0])})}function hD(o,a,d){a=Sr(a,o);var h=-1,g=a.length;for(g||(g=1,o=n);++h<g;){var _=o==null?n:o[Dn(a[h])];_===n&&(h=g,_=d),o=Kn(_)?_.call(o):_}return o}function fD(o,a,d){return o==null?o:Wo(o,a,d)}function mD(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:Wo(o,a,d,h)}var Lf=Kh(pt),Of=Kh(Rt);function gD(o,a,d){var h=ke(o),g=h||Tr(o)||Ni(o);if(a=he(a,4),d==null){var _=o&&o.constructor;g?d=h?new _:[]:Qe(o)?d=Kn(_)?Ti(qs(o)):{}:d={}}return(g?Yt:Nn)(o,function(x,B,D){return a(d,x,B,D)}),d}function yD(o,a){return o==null?!0:kc(o,a)}function vD(o,a,d){return o==null?o:Ph(o,a,Tc(d))}function _D(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:Ph(o,a,Tc(d),h)}function Pi(o){return o==null?[]:oc(o,pt(o))}function CD(o){return o==null?[]:oc(o,Rt(o))}function wD(o,a,d){return d===n&&(d=a,a=n),d!==n&&(d=nn(d),d=d===d?d:0),a!==n&&(a=nn(a),a=a===a?a:0),jr(nn(o),a,d)}function bD(o,a,d){return a=Yn(a),d===n?(d=a,a=0):d=Yn(d),o=nn(o),BV(o,a,d)}function xD(o,a,d){if(d&&typeof d!="boolean"&&Vt(o,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof o=="boolean"&&(d=o,o=n)),o===n&&a===n?(o=0,a=1):(o=Yn(o),a===n?(a=o,o=0):a=Yn(a)),o>a){var h=o;o=a,a=h}if(d||o%1||a%1){var g=lh();return wt(o+g*(a-o+tB("1e-"+((g+"").length-1))),a)}return wc(o,a)}var kD=Vi(function(o,a,d){return a=a.toLowerCase(),o+(d?Gf(a):a)});function Gf(o){return qc(Ue(o).toLowerCase())}function zf(o){return o=Ue(o),o&&o.replace(ET,fB).replace(WT,"")}function SD(o,a,d){o=Ue(o),a=Wt(a);var h=o.length;d=d===n?h:jr(Te(d),0,h);var g=d;return d-=a.length,d>=0&&o.slice(d,g)==a}function ED(o){return o=Ue(o),o&&sT.test(o)?o.replace(yp,mB):o}function TD(o){return o=Ue(o),o&&pT.test(o)?o.replace(Ul,"\\$&"):o}var BD=Vi(function(o,a,d){return o+(d?"-":"")+a.toLowerCase()}),VD=Vi(function(o,a,d){return o+(d?" ":"")+a.toLowerCase()}),AD=Uh("toLowerCase");function ND(o,a,d){o=Ue(o),a=Te(a);var h=a?bi(o):0;if(!a||h>=a)return o;var g=(a-h)/2;return ua(Xs(g),d)+o+ua(Js(g),d)}function PD(o,a,d){o=Ue(o),a=Te(a);var h=a?bi(o):0;return a&&h<a?o+ua(a-h,d):o}function DD(o,a,d){o=Ue(o),a=Te(a);var h=a?bi(o):0;return a&&h<a?ua(a-h,d)+o:o}function FD(o,a,d){return d||a==null?a=0:a&&(a=+a),zB(Ue(o).replace($l,""),a||0)}function RD(o,a,d){return(d?Vt(o,a,d):a===n)?a=1:a=Te(a),bc(Ue(o),a)}function MD(){var o=arguments,a=Ue(o[0]);return o.length<3?a:a.replace(o[1],o[2])}var ID=Vi(function(o,a,d){return o+(d?"_":"")+a.toLowerCase()});function LD(o,a,d){return d&&typeof d!="number"&&Vt(o,a,d)&&(a=d=n),d=d===n?ht:d>>>0,d?(o=Ue(o),o&&(typeof a=="string"||a!=null&&!Wc(a))&&(a=Wt(a),!a&&wi(o))?Er(Cn(o),0,d):o.split(a,d)):[]}var OD=Vi(function(o,a,d){return o+(d?" ":"")+qc(a)});function GD(o,a,d){return o=Ue(o),d=d==null?0:jr(Te(d),0,o.length),a=Wt(a),o.slice(d,d+a.length)==a}function zD(o,a,d){var h=v.templateSettings;d&&Vt(o,a,d)&&(a=n),o=Ue(o),a=xa({},a,h,Yh);var g=xa({},a.imports,h.imports,Yh),_=pt(g),x=oc(g,_),B,D,H=0,j=a.interpolate||Ms,K="__p += '",te=ac((a.escape||Ms).source+"|"+j.source+"|"+(j===vp?CT:Ms).source+"|"+(a.evaluate||Ms).source+"|$","g"),ce="//# sourceURL="+($e.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++YT+"]")+`
|
|
73
|
+
`;o.replace(te,function(ge,Pe,Fe,jt,At,qt){return Fe||(Fe=jt),K+=o.slice(H,qt).replace(TT,gB),Pe&&(B=!0,K+=`' +
|
|
74
|
+
__e(`+Pe+`) +
|
|
75
|
+
'`),At&&(D=!0,K+=`';
|
|
76
|
+
`+At+`;
|
|
77
|
+
__p += '`),Fe&&(K+=`' +
|
|
78
78
|
((__t = (`+Fe+`)) == null ? '' : __t) +
|
|
79
|
-
'`),H=
|
|
80
|
-
`;var
|
|
81
|
-
`+
|
|
79
|
+
'`),H=qt+ge.length,ge}),K+=`';
|
|
80
|
+
`;var me=$e.call(a,"variable")&&a.variable;if(!me)K=`with (obj) {
|
|
81
|
+
`+K+`
|
|
82
82
|
}
|
|
83
|
-
`;else if(
|
|
84
|
-
`+(
|
|
85
|
-
`)+"var __t, __p = ''"+(
|
|
83
|
+
`;else if(vT.test(me))throw new xe(u);K=(D?K.replace(nT,""):K).replace(rT,"$1").replace(iT,"$1;"),K="function("+(me||"obj")+`) {
|
|
84
|
+
`+(me?"":`obj || (obj = {});
|
|
85
|
+
`)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(D?`, __j = Array.prototype.join;
|
|
86
86
|
function print() { __p += __j.call(arguments, '') }
|
|
87
87
|
`:`;
|
|
88
|
-
`)+
|
|
89
|
-
}`;var Pe=If(function(){return Oe(_,le+"return "+q).apply(n,x)});if(Pe.source=q,Gc(Pe))throw Pe;return Pe}function GD(o){return ze(o).toLowerCase()}function zD(o){return ze(o).toUpperCase()}function ZD(o,a,d){if(o=ze(o),o&&(d||a===n))return Wp(o);if(!o||!(a=$t(a)))return o;var h=_n(o),g=_n(a),_=Hp(h,g),x=jp(h,g)+1;return wr(h,_,x).join("")}function $D(o,a,d){if(o=ze(o),o&&(d||a===n))return o.slice(0,Kp(o)+1);if(!o||!(a=$t(a)))return o;var h=_n(o),g=jp(h,_n(a))+1;return wr(h,0,g).join("")}function UD(o,a,d){if(o=ze(o),o&&(d||a===n))return o.replace(Gl,"");if(!o||!(a=$t(a)))return o;var h=_n(o),g=Hp(h,_n(a));return wr(h,g).join("")}function WD(o,a){var d=O,h=K;if(Je(a)){var g="separator"in a?a.separator:g;d="length"in a?Te(a.length):d,h="omission"in a?$t(a.omission):h}o=ze(o);var _=o.length;if(yi(o)){var x=_n(o);_=x.length}if(d>=_)return o;var E=d-vi(h);if(E<1)return h;var V=x?wr(x,0,E).join(""):o.slice(0,E);if(g===n)return V+h;if(x&&(E+=V.length-E),zc(g)){if(o.slice(E).search(g)){var H,j=V;for(g.global||(g=rc(g.source,ze(hp.exec(g))+"g")),g.lastIndex=0;H=g.exec(j);)var q=H.index;V=V.slice(0,q===n?E:q)}}else if(o.indexOf($t(g),E)!=E){var te=V.lastIndexOf(g);te>-1&&(V=V.slice(0,te))}return V+h}function HD(o){return o=ze(o),o&&rT.test(o)?o.replace(dp,wB):o}var jD=Si(function(o,a,d){return o+(d?" ":"")+a.toUpperCase()}),Uc=Ih("toUpperCase");function Mf(o,a,d){return o=ze(o),a=d?n:a,a===n?gB(o)?kB(o):aB(o):o.match(a)||[]}var If=Ve(function(o,a){try{return zt(o,n,a)}catch(d){return Gc(d)?d:new be(d)}}),qD=Un(function(o,a){return Kt(a,function(d){d=Vn(d),Zn(o,d,Lc(o[d],o))}),o});function KD(o){var a=o==null?0:o.length,d=pe();return o=a?qe(o,function(h){if(typeof h[1]!="function")throw new Yt(c);return[d(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var _=o[g];if(zt(_[0],this,h))return zt(_[1],this,h)}})}function YD(o){return wA(Xt(o,v))}function Wc(o){return function(){return o}}function JD(o,a){return o==null||o!==o?a:o}var XD=Oh(),QD=Oh(!0);function Dt(o){return o}function Hc(o){return mh(typeof o=="function"?o:Xt(o,v))}function eF(o){return yh(Xt(o,v))}function tF(o,a){return vh(o,Xt(a,v))}var nF=Ve(function(o,a){return function(d){return zo(d,o,a)}}),rF=Ve(function(o,a){return function(d){return zo(o,d,a)}});function jc(o,a,d){var h=ut(a),g=Xs(a,h);d==null&&!(Je(a)&&(g.length||!h.length))&&(d=a,a=o,o=this,g=Xs(a,ut(a)));var _=!(Je(d)&&"chain"in d)||!!d.chain,x=Hn(o);return Kt(g,function(E){var V=a[E];o[E]=V,x&&(o.prototype[E]=function(){var H=this.__chain__;if(_||H){var j=o(this.__wrapped__),q=j.__actions__=Pt(this.__actions__);return q.push({func:V,args:arguments,thisArg:o}),j.__chain__=H,j}return V.apply(o,mr([this.value()],arguments))})}),o}function iF(){return pt._===this&&(pt._=PB),this}function qc(){}function oF(o){return o=Te(o),Ve(function(a){return _h(a,o)})}var sF=Sc(qe),aF=Sc(Gp),lF=Sc(Yl);function Lf(o){return Nc(o)?Jl(Vn(o)):LA(o)}function cF(o){return function(a){return o==null?n:Ur(o,a)}}var dF=zh(),uF=zh(!0);function Kc(){return[]}function Yc(){return!1}function pF(){return{}}function hF(){return""}function fF(){return!0}function mF(o,a){if(o=Te(o),o<1||o>xe)return[];var d=At,h=vt(o,At);a=pe(a),o-=At;for(var g=ec(h,a);++d<o;)a(d);return g}function gF(o){return ke(o)?qe(o,Vn):Ut(o)?[o]:Pt(rf(ze(o)))}function yF(o){var a=++BB;return ze(o)+a}var vF=ia(function(o,a){return o+a},0),_F=Ec("ceil"),CF=ia(function(o,a){return o/a},1),wF=Ec("floor");function bF(o){return o&&o.length?Js(o,Dt,uc):n}function xF(o,a){return o&&o.length?Js(o,pe(a,2),uc):n}function kF(o){return $p(o,Dt)}function SF(o,a){return $p(o,pe(a,2))}function EF(o){return o&&o.length?Js(o,Dt,mc):n}function TF(o,a){return o&&o.length?Js(o,pe(a,2),mc):n}var BF=ia(function(o,a){return o*a},1),AF=Ec("round"),PF=ia(function(o,a){return o-a},0);function VF(o){return o&&o.length?Ql(o,Dt):0}function NF(o,a){return o&&o.length?Ql(o,pe(a,2)):0}return y.after=eN,y.ary=mf,y.assign=zN,y.assignIn=Af,y.assignInWith=ya,y.assignWith=ZN,y.at=$N,y.before=gf,y.bind=Lc,y.bindAll=qD,y.bindKey=yf,y.castArray=pN,y.chain=pf,y.chunk=wP,y.compact=bP,y.concat=xP,y.cond=KD,y.conforms=YD,y.constant=Wc,y.countBy=VV,y.create=UN,y.curry=vf,y.curryRight=_f,y.debounce=Cf,y.defaults=WN,y.defaultsDeep=HN,y.defer=tN,y.delay=nN,y.difference=kP,y.differenceBy=SP,y.differenceWith=EP,y.drop=TP,y.dropRight=BP,y.dropRightWhile=AP,y.dropWhile=PP,y.fill=VP,y.filter=DV,y.flatMap=MV,y.flatMapDeep=IV,y.flatMapDepth=LV,y.flatten=lf,y.flattenDeep=NP,y.flattenDepth=DP,y.flip=rN,y.flow=XD,y.flowRight=QD,y.fromPairs=FP,y.functions=QN,y.functionsIn=eD,y.groupBy=OV,y.initial=MP,y.intersection=IP,y.intersectionBy=LP,y.intersectionWith=OP,y.invert=nD,y.invertBy=rD,y.invokeMap=zV,y.iteratee=Hc,y.keyBy=ZV,y.keys=ut,y.keysIn=Nt,y.map=ua,y.mapKeys=oD,y.mapValues=sD,y.matches=eF,y.matchesProperty=tF,y.memoize=ha,y.merge=aD,y.mergeWith=Pf,y.method=nF,y.methodOf=rF,y.mixin=jc,y.negate=fa,y.nthArg=oF,y.omit=lD,y.omitBy=cD,y.once=iN,y.orderBy=$V,y.over=sF,y.overArgs=oN,y.overEvery=aF,y.overSome=lF,y.partial=Oc,y.partialRight=wf,y.partition=UV,y.pick=dD,y.pickBy=Vf,y.property=Lf,y.propertyOf=cF,y.pull=$P,y.pullAll=df,y.pullAllBy=UP,y.pullAllWith=WP,y.pullAt=HP,y.range=dF,y.rangeRight=uF,y.rearg=sN,y.reject=jV,y.remove=jP,y.rest=aN,y.reverse=Mc,y.sampleSize=KV,y.set=pD,y.setWith=hD,y.shuffle=YV,y.slice=qP,y.sortBy=QV,y.sortedUniq=tV,y.sortedUniqBy=nV,y.split=MD,y.spread=lN,y.tail=rV,y.take=iV,y.takeRight=oV,y.takeRightWhile=sV,y.takeWhile=aV,y.tap=bV,y.throttle=cN,y.thru=da,y.toArray=Ef,y.toPairs=Nf,y.toPairsIn=Df,y.toPath=gF,y.toPlainObject=Bf,y.transform=fD,y.unary=dN,y.union=lV,y.unionBy=cV,y.unionWith=dV,y.uniq=uV,y.uniqBy=pV,y.uniqWith=hV,y.unset=mD,y.unzip=Ic,y.unzipWith=uf,y.update=gD,y.updateWith=yD,y.values=Bi,y.valuesIn=vD,y.without=fV,y.words=Mf,y.wrap=uN,y.xor=mV,y.xorBy=gV,y.xorWith=yV,y.zip=vV,y.zipObject=_V,y.zipObjectDeep=CV,y.zipWith=wV,y.entries=Nf,y.entriesIn=Df,y.extend=Af,y.extendWith=ya,jc(y,y),y.add=vF,y.attempt=If,y.camelCase=bD,y.capitalize=Ff,y.ceil=_F,y.clamp=_D,y.clone=hN,y.cloneDeep=mN,y.cloneDeepWith=gN,y.cloneWith=fN,y.conformsTo=yN,y.deburr=Rf,y.defaultTo=JD,y.divide=CF,y.endsWith=xD,y.eq=wn,y.escape=kD,y.escapeRegExp=SD,y.every=NV,y.find=FV,y.findIndex=sf,y.findKey=jN,y.findLast=RV,y.findLastIndex=af,y.findLastKey=qN,y.floor=wF,y.forEach=hf,y.forEachRight=ff,y.forIn=KN,y.forInRight=YN,y.forOwn=JN,y.forOwnRight=XN,y.get=Zc,y.gt=vN,y.gte=_N,y.has=tD,y.hasIn=$c,y.head=cf,y.identity=Dt,y.includes=GV,y.indexOf=RP,y.inRange=CD,y.invoke=iD,y.isArguments=jr,y.isArray=ke,y.isArrayBuffer=CN,y.isArrayLike=Vt,y.isArrayLikeObject=tt,y.isBoolean=wN,y.isBuffer=br,y.isDate=bN,y.isElement=xN,y.isEmpty=kN,y.isEqual=SN,y.isEqualWith=EN,y.isError=Gc,y.isFinite=TN,y.isFunction=Hn,y.isInteger=bf,y.isLength=ma,y.isMap=xf,y.isMatch=BN,y.isMatchWith=AN,y.isNaN=PN,y.isNative=VN,y.isNil=DN,y.isNull=NN,y.isNumber=kf,y.isObject=Je,y.isObjectLike=Qe,y.isPlainObject=jo,y.isRegExp=zc,y.isSafeInteger=FN,y.isSet=Sf,y.isString=ga,y.isSymbol=Ut,y.isTypedArray=Ti,y.isUndefined=RN,y.isWeakMap=MN,y.isWeakSet=IN,y.join=GP,y.kebabCase=ED,y.last=en,y.lastIndexOf=zP,y.lowerCase=TD,y.lowerFirst=BD,y.lt=LN,y.lte=ON,y.max=bF,y.maxBy=xF,y.mean=kF,y.meanBy=SF,y.min=EF,y.minBy=TF,y.stubArray=Kc,y.stubFalse=Yc,y.stubObject=pF,y.stubString=hF,y.stubTrue=fF,y.multiply=BF,y.nth=ZP,y.noConflict=iF,y.noop=qc,y.now=pa,y.pad=AD,y.padEnd=PD,y.padStart=VD,y.parseInt=ND,y.random=wD,y.reduce=WV,y.reduceRight=HV,y.repeat=DD,y.replace=FD,y.result=uD,y.round=AF,y.runInContext=B,y.sample=qV,y.size=JV,y.snakeCase=RD,y.some=XV,y.sortedIndex=KP,y.sortedIndexBy=YP,y.sortedIndexOf=JP,y.sortedLastIndex=XP,y.sortedLastIndexBy=QP,y.sortedLastIndexOf=eV,y.startCase=ID,y.startsWith=LD,y.subtract=PF,y.sum=VF,y.sumBy=NF,y.template=OD,y.times=mF,y.toFinite=jn,y.toInteger=Te,y.toLength=Tf,y.toLower=GD,y.toNumber=tn,y.toSafeInteger=GN,y.toString=ze,y.toUpper=zD,y.trim=ZD,y.trimEnd=$D,y.trimStart=UD,y.truncate=WD,y.unescape=HD,y.uniqueId=yF,y.upperCase=jD,y.upperFirst=Uc,y.each=hf,y.eachRight=ff,y.first=cf,jc(y,function(){var o={};return An(y,function(a,d){Ze.call(y.prototype,d)||(o[d]=a)}),o}(),{chain:!1}),y.VERSION=i,Kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){y[o].placeholder=y}),Kt(["drop","take"],function(o,a){De.prototype[o]=function(d){d=d===n?1:at(Te(d),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=vt(d,h.__takeCount__):h.__views__.push({size:vt(d,At),type:o+(h.__dir__<0?"Right":"")}),h},De.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Kt(["filter","map","takeWhile"],function(o,a){var d=a+1,h=d==A||d==Y;De.prototype[o]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:pe(g,3),type:d}),_.__filtered__=_.__filtered__||h,_}}),Kt(["head","last"],function(o,a){var d="take"+(a?"Right":"");De.prototype[o]=function(){return this[d](1).value()[0]}}),Kt(["initial","tail"],function(o,a){var d="drop"+(a?"":"Right");De.prototype[o]=function(){return this.__filtered__?new De(this):this[d](1)}}),De.prototype.compact=function(){return this.filter(Dt)},De.prototype.find=function(o){return this.filter(o).head()},De.prototype.findLast=function(o){return this.reverse().find(o)},De.prototype.invokeMap=Ve(function(o,a){return typeof o=="function"?new De(this):this.map(function(d){return zo(d,o,a)})}),De.prototype.reject=function(o){return this.filter(fa(pe(o)))},De.prototype.slice=function(o,a){o=Te(o);var d=this;return d.__filtered__&&(o>0||a<0)?new De(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-o)),d)},De.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},De.prototype.toArray=function(){return this.take(At)},An(De.prototype,function(o,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=y[h?"take"+(a=="last"?"Right":""):a],_=h||/^find/.test(a);g&&(y.prototype[a]=function(){var x=this.__wrapped__,E=h?[1]:arguments,V=x instanceof De,H=E[0],j=V||ke(x),q=function(Ne){var Fe=g.apply(y,mr([Ne],E));return h&&te?Fe[0]:Fe};j&&d&&typeof H=="function"&&H.length!=1&&(V=j=!1);var te=this.__chain__,le=!!this.__actions__.length,fe=_&&!te,Pe=V&&!le;if(!_&&j){x=Pe?x:new De(this);var me=o.apply(x,E);return me.__actions__.push({func:da,args:[q],thisArg:n}),new Jt(me,te)}return fe&&Pe?o.apply(this,E):(me=this.thru(q),fe?h?me.value()[0]:me.value():me)})}),Kt(["pop","push","shift","sort","splice","unshift"],function(o){var a=Ms[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);y.prototype[o]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[d](function(x){return a.apply(ke(x)?x:[],g)})}}),An(De.prototype,function(o,a){var d=y[a];if(d){var h=d.name+"";Ze.call(bi,h)||(bi[h]=[]),bi[h].push({name:a,func:d})}}),bi[ra(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=HB,De.prototype.reverse=jB,De.prototype.value=qB,y.prototype.at=xV,y.prototype.chain=kV,y.prototype.commit=SV,y.prototype.next=EV,y.prototype.plant=BV,y.prototype.reverse=AV,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=PV,y.prototype.first=y.prototype.head,Fo&&(y.prototype[Fo]=TV),y},_i=SB();Or?((Or.exports=_i)._=_i,Hl._=_i):pt._=_i}).call(Ai)}(bs,bs.exports);var Xe=bs.exports;const gE={class:"grid-overlay-container"},qu=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",gE,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),yE={},vE={class:"grid-overlay-container"};function _E(t,e){return r.openBlock(),r.createElementBlock("div",vE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Ku=kl(yE,[["render",_E]]);async function CE(t,e){throw Error("not implemented")}function wE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function bE(t,e){const n=[];for(const i of e)if(t[i].type==="column"){const s=wE(t[i].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=wd(l),u=t.findIndex(p=>Xe.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",i,c,t),Error("axis not found");n.push({columnIdx:i,axisIdx:u})}}return n}const Yu=(t,e)=>(t+e).toString();function xE(t,e,n,i,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let u=-1,p=-1;for(let v=0;v<l.length;++v)l[v]===c.axisIdx&&(u=v),l[v]===c.columnIdx&&(p=v);const f=(()=>{const k=i[u].data.filter(S=>S!==null);return Array.from(new Set(k))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=kE(s,i,u,p,f,e.rows);for(let v=0;v<f.length;++v){const k=f[v],S=k+"@"+v;n.push({colId:S,field:Yu(i.length,v),headerName:k,valueFormatter:Ju})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function kE(t,e,n,i,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let T=0;T<e.length;++T){if(T===n||T===i)continue;const N=t[T].toString();m[N]=e[T].data[f]}let v;const k=Pi(Object.values(m))??"";c.has(k)?v=c.get(k):(c.set(k,m),v=m,v.id=u.toString(),u++);const S=s.indexOf(e[n].data[f]);if(S===-1)throw Error("index not found");const F=Yu(e.length,S);v[F]=e[i].data[f]}return Array.from(c.values())}function SE(t){return Pi({type:t.type,id:t.id})}function EE(t){return JSON.parse(t)}const Ju=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function TE(t,e,n){var s,l,c;const i=SE(e);return{colId:i,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(i))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:Ju,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function Xu(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function Qu(t){const e=[];return os(t,n=>(e.push(n),n)),e}async function BE(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Xe.uniqWith(n.map(s=>Ma(s.spec.axesSpec).map(Xe.cloneDeep)).flat(),Xe.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function AE(t,e,n){const i=Qu(n),l=(await BE(t,e,i)).filter(c=>!Xe.find(i,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function PE(t,e,n,i){const s=n.filter(m=>m.type!=="Bytes"),l=Qu(i),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const v=Ma(l[m].spec.axesSpec);for(let k=0;k<v.length;++k){const S=Xe.findIndex(s,F=>Xe.isEqual(F,v[k]));S===-1||u[S]||(v.length===1&&l[m].spec.name==="pl7.app/label"?(c[S]=[[m,k]],u[S]=l[m].columnId):c[S].push([m,k]))}}for(let m=s.length-1;m>=0;--m)c[m].length||(u.splice(m,1),c.splice(m,1),s.splice(m,1));const p=100,f=s.map(m=>new Set);e:for(let m=s.length-1;m>=0;--m){for(const[v,k]of c[m]){const S=await t.getUniqueValues(e,{columnId:l[v].columnId,...!u[m]&&{axis:Xe.cloneDeep(s[m])},filters:[],limit:p});if(S.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const F=S.values.type;for(const T of S.values.data)if(!(Cd(T,F)||T===null)&&(f[m].add(Xu(T,F)),f[m].size===p)){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}return s.map((m,v)=>{const k=[...f[v]].map(F=>({value:F,text:F.toString()})),S=k[0].value;return{axis:Xe.cloneDeep(m),...u[v]&&{column:u[v]},options:k,defaultValue:S}})}function VE(t,e,n,i){const s=e.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(i++).toString();for(const m of n)u.push(e[m].data[c]);const f={key:u,id:p};for(let m=0;m<s;++m){const v=t[m].toString(),k=e[m].data[c],S=e[m].type;dg(e[m].absent,c)?f[v]=void 0:Cd(k,S)||k===null?f[v]=null:f[v]=Xu(k,S)}l.push(f)}return l}const NE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function DE(t,e,n,i){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(C=>!Xe.find(n,I=>Xe.isEqual(I.axis,s[C].id)||Xe.isEqual(I.column,s[C].id))).sort((C,I)=>{var R,U;if(s[C].type!==s[I].type)return s[C].type==="axis"?-1:1;const Q=(R=s[C].spec.annotations)==null?void 0:R["pl7.app/table/orderPriority"],M=(U=s[I].spec.annotations)==null?void 0:U["pl7.app/table/orderPriority"];return Q===void 0?M===void 0?0:1:M===void 0?-1:Number(M)-Number(Q)}),u=Xe.cloneDeep(c),p=bE(s,c);for(let C=c.length-1;C>=0;--C){const I=c[C];if(!NE(s[I]))continue;const Q=Ma(s[I].spec.axesSpec)[0],M=Xe.findIndex(c,R=>Xe.isEqual(s[R].id,Q));if(M!==-1){c[M]=I;for(const R of p)R.axisIdx===I&&(R.axisIdx=M);c.splice(C,1),u.splice(C,1)}}const f=[...c],m=new Map;for(let C=0;C<l;++C)m.set(C,-1);for(let C=0;C<f.length;++C){const I=f[C];m.has(I)&&m.set(I,C)}for(const[C,I]of m)I===-1&&(m.set(C,f.length),f.push(C));const v=[];for(let C=0;C<l;++C){const I=m.get(C);if(I===void 0||I===-1)throw new Error("assertion exception");v.push(I)}const k=await t.getShape(e),S=k.rows,F=u.map(C=>TE(C,s[C],i));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return xE(p,k,F,await t.getData(e,c),u,c);let T;return{rowModelType:"serverSide",columnDefs:F,serverSideDatasource:{getRows:async C=>{try{if(S==0){C.success({rowData:[],rowCount:S}),C.api.showNoRowsOverlay(),C.api.setGridOption("loading",!1);return}if(T&&!Xe.isEqual(T.request.sortModel,C.request.sortModel)){T=void 0,C.fail(),C.api.setGridOption("loading",!0);return}T=C;let I=0,Q=[];if(S>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(I=Math.min(S,C.request.endRow)-C.request.startRow,I>0)){const M=await t.getData(e,f,{offset:C.request.startRow,length:I});Q=VE(u,M,v,C.request.startRow)}C.success({rowData:Q,rowCount:S}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch{C.fail(),C.api.setGridOption("loading",!0)}}}}}const FE={class:"ap-ag-data-table-container"},RE={key:0,class:"ap-ag-data-table-sheets"},ME=kl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked"],["update:modelValue"]),setup(t,{emit:e}){b.ModuleRegistry.registerModules([Ko.ClientSideRowModelModule,rd.ClipboardModule,nd.ServerSideRowModelModule,id.RangeSelectionModule,Ga,$d]);const n=e,i=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s);r.watch(()=>l.value,async(M,R)=>{if(M.sourceType!=="pframe"||!M.pFrame||!M.join||R&&R.sourceType==="pframe"&&Xe.isEqual(M.pFrame,R.pFrame)&&Xe.isEqual(M.join,R.join))return;const U=window.platforma;if(!U)throw Error("platforma not set");const z=U.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const P=await AE(z,M.pFrame,M.join),Z=i.value;Z.pTableParams||(Z.pTableParams={sorting:[],filters:[]}),Z.pTableParams.join=P,i.value=Z});const c=ep(()=>l.value.sourceType,async M=>{var U;const R=l.value.sourceType;switch(R){case"pframe":{const z=window.platforma;if(!z)throw Error("platforma not set");const P=z.pFrameDriver;if(!P)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const Z=l.value.pFrame,O=(U=i.value.pTableParams)==null?void 0:U.join;return O?await PE(P,Z,l.value.sheetAxes,O):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${R}`)}});function u(M){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(M==null?void 0:M.sortModel.map(R=>({column:EE(R.colId),ascending:R.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const p=r.computed({get:()=>{const M=i.value;return{columnOrder:M.gridState.columnOrder,sort:M.gridState.sort,columnVisibility:M.gridState.columnVisibility}},set:M=>{const R=i.value,U=S.value.rowModelType==="clientSide"?void 0:u(M.sort);R.gridState={...R.gridState,...M},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(R.pTableParams||(R.pTableParams={sorting:[],filters:[]}),R.pTableParams.sorting=U),i.value=R}}),f=M=>Pi(M);function m(M){var R;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((R=c.value)==null?void 0:R.map(U=>({type:"bySingleColumn",column:U.column?{type:"column",id:U.column}:{type:"axis",id:U.axis},predicate:{operator:"Equal",reference:M[f(U.axis)]}})))??[]}const v=r.computed({get:()=>i.value.gridState.sheets??{},set:M=>{const R=m(M),U=i.value;U.gridState.sheets=M,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(U.pTableParams||(U.pTableParams={sorting:[],filters:[]}),U.pTableParams.filters=R),i.value=U}});r.watch(()=>[l.value,c.value],(M,R)=>{const[U,z]=M;if(!z)return;if(R){const[Z,O]=R;if((U.sourceType==="ptable"||U.sourceType==="pframe")&&U.sourceType===(Z==null?void 0:Z.sourceType)&&Xe.isEqual(z,O))return}if(U.sourceType!=="ptable"&&U.sourceType!=="pframe"){v.value={};return}const P=v.value;for(const Z of z){const O=f(Z.axis);P[O]||(P[O]=Z.defaultValue??Z.options[0].value)}v.value=P},{immediate:!0});const k=r.shallowRef(),S=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:M=>{M.api.autoSizeAllColumns()},onRowDoubleClicked:M=>{M.data&&n("onRowDoubleClicked",M.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:M=>M.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:qu,noRowsOverlayComponent:Ku,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),F=M=>{const R=M.api;k.value=new Proxy(R,{get(U,z,P){switch(z){case"setGridOption":return(Z,O)=>{const K=S.value;K[Z]=O,S.value=K,R.updateGridOptions(K)};case"updateGridOptions":return Z=>{S.value={...S.value,...Z},R.updateGridOptions(Z)};default:return Reflect.get(U,z,P)}}})},T=M=>({columnOrder:M.columnOrder,sort:M.sort,columnVisibility:M.columnVisibility??(M.columnOrder?{hiddenColIds:[]}:void 0)}),N=M=>{S.value.initialState=p.value=T(M.state),M.api.autoSizeAllColumns()},C=()=>{S.value.initialState=p.value=T(k.value.getState()),k.value=void 0},I=r.ref(0);r.watch(()=>[k.value,p.value],(M,R)=>{if(Xe.isEqual(M,R))return;const[U,z]=M;if(!U)return;const P=T(U.getState());Xe.isEqual(z,P)||(S.value.initialState=z,++I.value)}),r.watch(()=>S.value,(M,R)=>{R&&M.rowModelType!=R.rowModelType&&++I.value});const Q=(M,R)=>{var z;const U=v.value;U[M]!==R&&(U[M]=R,v.value=U,(z=k.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[k.value,l.value,c.value],async(M,R)=>{var K,ue;if(Xe.isEqual(M,R))return;const[U,z,P]=M;if(!U)return;const Z=window.platforma;if(!Z)throw Error("platforma not set");const O=z.sourceType;switch(O){case"pframe":case"ptable":{const W=Z.pFrameDriver;if(!W)throw Error("platforma.pFrameDriver not set");const A=z.pTable;if(!A||!P)return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const G=(ue=(K=p.value)==null?void 0:K.columnVisibility)==null?void 0:ue.hiddenColIds,Y=await DE(W,A,P,G);return U.updateGridOptions({loading:Y.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Y})}case"xsv":{const W=Z.blobDriver;if(!W)throw Error("platforma.blobDriver not set");const A=z.xsvFile;if(!(A!=null&&A.ok)||!A.value)return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const G=await CE(W,A.value);return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...G})}default:throw Error(`unsupported source type: ${O}`)}}),(M,R)=>(r.openBlock(),r.createElementBlock("div",FE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(c).value&&r.unref(c).value.length>0?(r.openBlock(),r.createElementBlock("div",RE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c).value,(U,z)=>(r.openBlock(),r.createBlock(r.unref(Eu),{key:z,"model-value":v.value[f(U.axis)],options:U.options,"onUpdate:modelValue":P=>Q(f(U.axis),P)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(Kf.AgGridVue),{key:I.value,theme:r.unref(Wd),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:F,onStateUpdated:N,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-ba75cb02"]]),IE={key:1,class:"alert-error"},LE={key:2},OE=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),i=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&i.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",IE,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",LE,"Unresolved")):r.createCommentVNode("",!0)]))}}),GE={style:{height:"100%"}},zE=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),i=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(i.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",GE,[r.createVNode(r.unref($u),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":i.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),xs=new Map;function ZE(t,e){const n=r.getCurrentScope()??r.effectScope(),i=n.run(()=>(r.onScopeDispose(()=>{xs.delete(t)}),r.reactive(e())));return i[Symbol.dispose]=()=>{n.stop()},i}function $E(t){const e=Symbol();return()=>(xs.has(e)||xs.set(e,ZE(e,t)),xs.get(e))}function UE(t){return r.computed(()=>{try{return sd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function ep(t,e,n){const i=r.ref(0),s=r.reactive({loading:r.computed(()=>i.value>0),loadingRef:i,value:void 0,error:void 0}),l=Xf(e);return r.watch(t,async c=>{s.error=void 0,i.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{i.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const li=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tp=new Set,Sl=typeof process=="object"&&process?process:{},np=(t,e,n,i)=>{typeof Sl.emitWarning=="function"?Sl.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)};let ks=globalThis.AbortController,rp=globalThis.AbortSignal;if(typeof ks>"u"){rp=class{constructor(){Ge(this,"onabort");Ge(this,"_onabort",[]);Ge(this,"reason");Ge(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},ks=class{constructor(){Ge(this,"signal",new rp);e()}abort(i){var s,l;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const c of this.signal._onabort)c(i);(l=(s=this.signal).onabort)==null||l.call(s,i)}}};let t=((op=Sl.env)==null?void 0:op.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,np("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const WE=t=>!tp.has(t),pr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ip=t=>pr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ss:null:null;class Ss extends Array{constructor(e){super(e),this.fill(0)}}const Fr=class Fr{constructor(e,n){Ge(this,"heap");Ge(this,"length");if(!w(Fr,ci))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=ip(e);if(!n)return[];he(Fr,ci,!0);const i=new Fr(e,n);return he(Fr,ci,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ci=new WeakMap,Le(Fr,ci,!1);let El=Fr;const Al=class Al{constructor(e){Le(this,ee);Le(this,cn);Le(this,Mt);Le(this,dn);Le(this,un);Le(this,di);Le(this,ui);Ge(this,"ttl");Ge(this,"ttlResolution");Ge(this,"ttlAutopurge");Ge(this,"updateAgeOnGet");Ge(this,"updateAgeOnHas");Ge(this,"allowStale");Ge(this,"noDisposeOnSet");Ge(this,"noUpdateTTL");Ge(this,"maxEntrySize");Ge(this,"sizeCalculation");Ge(this,"noDeleteOnFetchRejection");Ge(this,"noDeleteOnStaleGet");Ge(this,"allowStaleOnFetchAbort");Ge(this,"allowStaleOnFetchRejection");Ge(this,"ignoreFetchAbort");Le(this,ot);Le(this,pn);Le(this,rt);Le(this,We);Le(this,we);Le(this,bt);Le(this,It);Le(this,yt);Le(this,ct);Le(this,hn);Le(this,dt);Le(this,fn);Le(this,mn);Le(this,Lt);Le(this,gn);Le(this,hr);Le(this,xt);Le(this,Rr,()=>{});Le(this,Ln,()=>{});Le(this,bo,()=>{});Le(this,Ot,()=>!1);Le(this,Mr,e=>{});Le(this,pi,(e,n,i)=>{});Le(this,xo,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ge(this,sp,"LRUCache");const{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:v,noUpdateTTL:k,maxSize:S=0,maxEntrySize:F=0,sizeCalculation:T,fetchMethod:N,memoMethod:C,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:Q,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:R,ignoreFetchAbort:U}=e;if(n!==0&&!pr(n))throw new TypeError("max option must be a nonnegative integer");const z=n?ip(n):Array;if(!z)throw new Error("invalid max value: "+n);if(he(this,cn,n),he(this,Mt,S),this.maxEntrySize=F||w(this,Mt),this.sizeCalculation=T,this.sizeCalculation){if(!w(this,Mt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(he(this,ui,C),N!==void 0&&typeof N!="function")throw new TypeError("fetchMethod must be a function if specified");if(he(this,di,N),he(this,hr,!!N),he(this,rt,new Map),he(this,We,new Array(n).fill(void 0)),he(this,we,new Array(n).fill(void 0)),he(this,bt,new z(n)),he(this,It,new z(n)),he(this,yt,0),he(this,ct,0),he(this,hn,El.create(n)),he(this,ot,0),he(this,pn,0),typeof f=="function"&&he(this,dn,f),typeof m=="function"?(he(this,un,m),he(this,dt,[])):(he(this,un,void 0),he(this,dt,void 0)),he(this,gn,!!w(this,dn)),he(this,xt,!!w(this,un)),this.noDisposeOnSet=!!v,this.noUpdateTTL=!!k,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(w(this,Mt)!==0&&!pr(w(this,Mt)))throw new TypeError("maxSize must be a positive integer if specified");if(!pr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ae(this,ee,Zf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=pr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!pr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ae(this,ee,Xc).call(this)}if(w(this,cn)===0&&this.ttl===0&&w(this,Mt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,cn)&&!w(this,Mt)){const P="LRU_CACHE_UNBOUNDED";WE(P)&&(tp.add(P),np("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,Al))}}static unsafeExposeInternals(e){return{starts:w(e,mn),ttls:w(e,Lt),sizes:w(e,fn),keyMap:w(e,rt),keyList:w(e,We),valList:w(e,we),next:w(e,bt),prev:w(e,It),get head(){return w(e,yt)},get tail(){return w(e,ct)},free:w(e,hn),isBackgroundFetch:n=>{var i;return ae(i=e,ee,je).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return ae(c=e,ee,Ca).call(c,n,i,s,l)},moveToTail:n=>{var i;return ae(i=e,ee,qo).call(i,n)},indexes:n=>{var i;return ae(i=e,ee,xr).call(i,n)},rindexes:n=>{var i;return ae(i=e,ee,kr).call(i,n)},isStale:n=>{var i;return w(i=e,Ot).call(i,n)}}}get max(){return w(this,cn)}get maxSize(){return w(this,Mt)}get calculatedSize(){return w(this,pn)}get size(){return w(this,ot)}get fetchMethod(){return w(this,di)}get memoMethod(){return w(this,ui)}get dispose(){return w(this,dn)}get disposeAfter(){return w(this,un)}getRemainingTTL(e){return w(this,rt).has(e)?1/0:0}*entries(){for(const e of ae(this,ee,xr).call(this))w(this,we)[e]!==void 0&&w(this,We)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield[w(this,We)[e],w(this,we)[e]])}*rentries(){for(const e of ae(this,ee,kr).call(this))w(this,we)[e]!==void 0&&w(this,We)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield[w(this,We)[e],w(this,we)[e]])}*keys(){for(const e of ae(this,ee,xr).call(this)){const n=w(this,We)[e];n!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield n)}}*rkeys(){for(const e of ae(this,ee,kr).call(this)){const n=w(this,We)[e];n!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield n)}}*values(){for(const e of ae(this,ee,xr).call(this))w(this,we)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield w(this,we)[e])}*rvalues(){for(const e of ae(this,ee,kr).call(this))w(this,we)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield w(this,we)[e])}[(ap=Symbol.iterator,sp=Symbol.toStringTag,ap)](){return this.entries()}find(e,n={}){for(const i of ae(this,ee,xr).call(this)){const s=w(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,We)[i],this))return this.get(w(this,We)[i],n)}}forEach(e,n=this){for(const i of ae(this,ee,xr).call(this)){const s=w(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,We)[i],this)}}rforEach(e,n=this){for(const i of ae(this,ee,kr).call(this)){const s=w(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,We)[i],this)}}purgeStale(){let e=!1;for(const n of ae(this,ee,kr).call(this,{allowStale:!0}))w(this,Ot).call(this,n)&&(ae(this,ee,Sr).call(this,w(this,We)[n],"expire"),e=!0);return e}info(e){const n=w(this,rt).get(e);if(n===void 0)return;const i=w(this,we)[n],s=ae(this,ee,je).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;const l={value:s};if(w(this,Lt)&&w(this,mn)){const c=w(this,Lt)[n],u=w(this,mn)[n];if(c&&u){const p=c-(li.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,fn)&&(l.size=w(this,fn)[n]),l}dump(){const e=[];for(const n of ae(this,ee,xr).call(this,{allowStale:!0})){const i=w(this,We)[n],s=w(this,we)[n],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;const c={value:l};if(w(this,Lt)&&w(this,mn)){c.ttl=w(this,Lt)[n];const u=li.now()-w(this,mn)[n];c.start=Math.floor(Date.now()-u)}w(this,fn)&&(c.size=w(this,fn)[n]),e.unshift([i,c])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const s=Date.now()-i.start;i.start=li.now()-s}this.set(n,i.value,i)}}set(e,n,i={}){var k,S,F,T,N;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const m=w(this,xo).call(this,e,n,i.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ae(this,ee,Sr).call(this,e,"set"),this;let v=w(this,ot)===0?void 0:w(this,rt).get(e);if(v===void 0)v=w(this,ot)===0?w(this,ct):w(this,hn).length!==0?w(this,hn).pop():w(this,ot)===w(this,cn)?ae(this,ee,_a).call(this,!1):w(this,ot),w(this,We)[v]=e,w(this,we)[v]=n,w(this,rt).set(e,v),w(this,bt)[w(this,ct)]=v,w(this,It)[v]=w(this,ct),he(this,ct,v),va(this,ot)._++,w(this,pi).call(this,v,m,p),p&&(p.set="add"),f=!1;else{ae(this,ee,qo).call(this,v);const C=w(this,we)[v];if(n!==C){if(w(this,hr)&&ae(this,ee,je).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:I}=C;I!==void 0&&!c&&(w(this,gn)&&((k=w(this,dn))==null||k.call(this,I,e,"set")),w(this,xt)&&((S=w(this,dt))==null||S.push([I,e,"set"])))}else c||(w(this,gn)&&((F=w(this,dn))==null||F.call(this,C,e,"set")),w(this,xt)&&((T=w(this,dt))==null||T.push([C,e,"set"])));if(w(this,Mr).call(this,v),w(this,pi).call(this,v,m,p),w(this,we)[v]=n,p){p.set="replace";const I=C&&ae(this,ee,je).call(this,C)?C.__staleWhileFetching:C;I!==void 0&&(p.oldValue=I)}}else p&&(p.set="update")}if(s!==0&&!w(this,Lt)&&ae(this,ee,Xc).call(this),w(this,Lt)&&(f||w(this,bo).call(this,v,s,l),p&&w(this,Ln).call(this,p,v)),!c&&w(this,xt)&&w(this,dt)){const C=w(this,dt);let I;for(;I=C==null?void 0:C.shift();)(N=w(this,un))==null||N.call(this,...I)}return this}pop(){var e;try{for(;w(this,ot);){const n=w(this,we)[w(this,yt)];if(ae(this,ee,_a).call(this,!0),ae(this,ee,je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,xt)&&w(this,dt)){const n=w(this,dt);let i;for(;i=n==null?void 0:n.shift();)(e=w(this,un))==null||e.call(this,...i)}}}has(e,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=w(this,rt).get(e);if(l!==void 0){const c=w(this,we)[l];if(ae(this,ee,je).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(w(this,Ot).call(this,l))s&&(s.has="stale",w(this,Ln).call(this,s,l));else return i&&w(this,Rr).call(this,l),s&&(s.has="hit",w(this,Ln).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:i=this.allowStale}=n,s=w(this,rt).get(e);if(s===void 0||!i&&w(this,Ot).call(this,s))return;const l=w(this,we)[s];return ae(this,ee,je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:k=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:T,forceRefresh:N=!1,status:C,signal:I}=n;if(!w(this,hr))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const Q={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:F,ignoreFetchAbort:S,status:C,signal:I};let M=w(this,rt).get(e);if(M===void 0){C&&(C.fetch="miss");const R=ae(this,ee,Ca).call(this,e,M,Q,T);return R.__returned=R}else{const R=w(this,we)[M];if(ae(this,ee,je).call(this,R)){const O=i&&R.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",O&&(C.returnedStale=!0)),O?R.__staleWhileFetching:R.__returned=R}const U=w(this,Ot).call(this,M);if(!N&&!U)return C&&(C.fetch="hit"),ae(this,ee,qo).call(this,M),s&&w(this,Rr).call(this,M),C&&w(this,Ln).call(this,C,M),R;const z=ae(this,ee,Ca).call(this,e,M,Q,T),Z=z.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=U?"stale":"refresh",Z&&U&&(C.returnedStale=!0)),Z?z.__staleWhileFetching:z.__returned=z}}async forceFetch(e,n={}){const i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){const i=w(this,ui);if(!i)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...c}=n,u=this.get(e,c);if(!l&&u!==void 0)return u;const p=i(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,rt).get(e);if(u!==void 0){const p=w(this,we)[u],f=ae(this,ee,je).call(this,p);return c&&w(this,Ln).call(this,c,u),w(this,Ot).call(this,u)?(c&&(c.get="stale"),f?(c&&i&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),i?p.__staleWhileFetching:void 0):(l||ae(this,ee,Sr).call(this,e,"expire"),c&&i&&(c.returnedStale=!0),i?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(ae(this,ee,qo).call(this,u),s&&w(this,Rr).call(this,u),p))}else c&&(c.get="miss")}delete(e){return ae(this,ee,Sr).call(this,e,"delete")}clear(){return ae(this,ee,td).call(this,"delete")}};cn=new WeakMap,Mt=new WeakMap,dn=new WeakMap,un=new WeakMap,di=new WeakMap,ui=new WeakMap,ot=new WeakMap,pn=new WeakMap,rt=new WeakMap,We=new WeakMap,we=new WeakMap,bt=new WeakMap,It=new WeakMap,yt=new WeakMap,ct=new WeakMap,hn=new WeakMap,dt=new WeakMap,fn=new WeakMap,mn=new WeakMap,Lt=new WeakMap,gn=new WeakMap,hr=new WeakMap,xt=new WeakMap,ee=new WeakSet,Xc=function(){const e=new Ss(w(this,cn)),n=new Ss(w(this,cn));he(this,Lt,e),he(this,mn,n),he(this,bo,(l,c,u=li.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,Ot).call(this,l)&&ae(this,ee,Sr).call(this,w(this,We)[l],"expire")},c+1);p.unref&&p.unref()}}),he(this,Rr,l=>{n[l]=e[l]!==0?li.now():0}),he(this,Ln,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=i||s();const f=l.now-p;l.remainingTTL=u-f}});let i=0;const s=()=>{const l=li.now();if(this.ttlResolution>0){i=l;const c=setTimeout(()=>i=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=w(this,rt).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(i||s())-p;return u-f},he(this,Ot,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(i||s())-c>u})},Rr=new WeakMap,Ln=new WeakMap,bo=new WeakMap,Ot=new WeakMap,Zf=function(){const e=new Ss(w(this,cn));he(this,pn,0),he(this,fn,e),he(this,Mr,n=>{he(this,pn,w(this,pn)-e[n]),e[n]=0}),he(this,xo,(n,i,s,l)=>{if(ae(this,ee,je).call(this,i))return 0;if(!pr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!pr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),he(this,pi,(n,i,s)=>{if(e[n]=i,w(this,Mt)){const l=w(this,Mt)-e[n];for(;w(this,pn)>l;)ae(this,ee,_a).call(this,!0)}he(this,pn,w(this,pn)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=w(this,pn))})},Mr=new WeakMap,pi=new WeakMap,xo=new WeakMap,xr=function*({allowStale:e=this.allowStale}={}){if(w(this,ot))for(let n=w(this,ct);!(!ae(this,ee,Qc).call(this,n)||((e||!w(this,Ot).call(this,n))&&(yield n),n===w(this,yt)));)n=w(this,It)[n]},kr=function*({allowStale:e=this.allowStale}={}){if(w(this,ot))for(let n=w(this,yt);!(!ae(this,ee,Qc).call(this,n)||((e||!w(this,Ot).call(this,n))&&(yield n),n===w(this,ct)));)n=w(this,bt)[n]},Qc=function(e){return e!==void 0&&w(this,rt).get(w(this,We)[e])===e},_a=function(e){var l,c;const n=w(this,yt),i=w(this,We)[n],s=w(this,we)[n];return w(this,hr)&&ae(this,ee,je).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,gn)||w(this,xt))&&(w(this,gn)&&((l=w(this,dn))==null||l.call(this,s,i,"evict")),w(this,xt)&&((c=w(this,dt))==null||c.push([s,i,"evict"]))),w(this,Mr).call(this,n),e&&(w(this,We)[n]=void 0,w(this,we)[n]=void 0,w(this,hn).push(n)),w(this,ot)===1?(he(this,yt,he(this,ct,0)),w(this,hn).length=0):he(this,yt,w(this,bt)[n]),w(this,rt).delete(i),va(this,ot)._--,n},Ca=function(e,n,i,s){const l=n===void 0?void 0:w(this,we)[n];if(ae(this,ee,je).call(this,l))return l;const c=new ks,{signal:u}=i;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:i,context:s},f=(T,N=!1)=>{const{aborted:C}=c.signal,I=i.ignoreFetchAbort&&T!==void 0;if(i.status&&(C&&!N?(i.status.fetchAborted=!0,i.status.fetchError=c.signal.reason,I&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),C&&!I&&!N)return v(c.signal.reason);const Q=S;return w(this,we)[n]===S&&(T===void 0?Q.__staleWhileFetching?w(this,we)[n]=Q.__staleWhileFetching:ae(this,ee,Sr).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,T,p.options))),T},m=T=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=T),v(T)),v=T=>{const{aborted:N}=c.signal,C=N&&i.allowStaleOnFetchAbort,I=C||i.allowStaleOnFetchRejection,Q=I||i.noDeleteOnFetchRejection,M=S;if(w(this,we)[n]===S&&(!Q||M.__staleWhileFetching===void 0?ae(this,ee,Sr).call(this,e,"fetch"):C||(w(this,we)[n]=M.__staleWhileFetching)),I)return i.status&&M.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw T},k=(T,N)=>{var I;const C=(I=w(this,di))==null?void 0:I.call(this,e,l,p);C&&C instanceof Promise&&C.then(Q=>T(Q===void 0?void 0:Q),N),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(T(void 0),i.allowStaleOnFetchAbort&&(T=Q=>f(Q,!0)))})};i.status&&(i.status.fetchDispatched=!0);const S=new Promise(k).then(f,m),F=Object.assign(S,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,F,{...p.options,status:void 0}),n=w(this,rt).get(e)):w(this,we)[n]=F,F},je=function(e){if(!w(this,hr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ks},ed=function(e,n){w(this,It)[n]=e,w(this,bt)[e]=n},qo=function(e){e!==w(this,ct)&&(e===w(this,yt)?he(this,yt,w(this,bt)[e]):ae(this,ee,ed).call(this,w(this,It)[e],w(this,bt)[e]),ae(this,ee,ed).call(this,w(this,ct),e),he(this,ct,e))},Sr=function(e,n){var s,l,c,u;let i=!1;if(w(this,ot)!==0){const p=w(this,rt).get(e);if(p!==void 0)if(i=!0,w(this,ot)===1)ae(this,ee,td).call(this,n);else{w(this,Mr).call(this,p);const f=w(this,we)[p];if(ae(this,ee,je).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,gn)||w(this,xt))&&(w(this,gn)&&((s=w(this,dn))==null||s.call(this,f,e,n)),w(this,xt)&&((l=w(this,dt))==null||l.push([f,e,n]))),w(this,rt).delete(e),w(this,We)[p]=void 0,w(this,we)[p]=void 0,p===w(this,ct))he(this,ct,w(this,It)[p]);else if(p===w(this,yt))he(this,yt,w(this,bt)[p]);else{const m=w(this,It)[p];w(this,bt)[m]=w(this,bt)[p];const v=w(this,bt)[p];w(this,It)[v]=w(this,It)[p]}va(this,ot)._--,w(this,hn).push(p)}}if(w(this,xt)&&((c=w(this,dt))!=null&&c.length)){const p=w(this,dt);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,un))==null||u.call(this,...f)}return i},td=function(e){var n,i,s;for(const l of ae(this,ee,kr).call(this,{allowStale:!0})){const c=w(this,we)[l];if(ae(this,ee,je).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=w(this,We)[l];w(this,gn)&&((n=w(this,dn))==null||n.call(this,c,u,e)),w(this,xt)&&((i=w(this,dt))==null||i.push([c,u,e]))}}if(w(this,rt).clear(),w(this,we).fill(void 0),w(this,We).fill(void 0),w(this,Lt)&&w(this,mn)&&(w(this,Lt).fill(0),w(this,mn).fill(0)),w(this,fn)&&w(this,fn).fill(0),he(this,yt,0),he(this,ct,0),w(this,hn).length=0,he(this,pn,0),he(this,ot,0),w(this,xt)&&w(this,dt)){const l=w(this,dt);let c;for(;c=l==null?void 0:l.shift();)(s=w(this,un))==null||s.call(this,...c)}};let Tl=Al;const HE={cacheSize:15e6};class jE{constructor(e){Ge(this,"_str");Ge(this,"_rawJson");Ge(this,"_zodSchema");Ge(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Ir=class Ir{constructor(e){Ge(this,"fileDataCache");Ge(this,"fileDataRefs",new Map);const n={...HE,...e??{}};this.fileDataCache=new Tl({maxSize:n.cacheSize,fetchMethod:async i=>new jE(await hg().blobDriver.getContent(i)),sizeCalculation:i=>i.bytes.length,dispose:(i,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const i=r.shallowRef();return this.fileDataRefs.set(e,i),(async()=>{try{const s=await this.fileDataCache.fetch(e);i.value=s}catch(s){console.error(s)}})(),i}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n.value)==null?void 0:i.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n==null?void 0:n.value)==null?void 0:i.str})}getContentJson(e,n){if(e===void 0)return;const i=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=i==null?void 0:i.value)==null?void 0:s.rawJson:(l=i==null?void 0:i.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Ir.globalInstance.getContentBytes(e)}static getContentString(e){return Ir.globalInstance.getContentString(e)}static getContentJson(e,n){return Ir.globalInstance.getContentJson(e,n)}};Ge(Ir,"globalInstance",new Ir);let Bl=Ir;D.AgGridTheme=Wd,D.BlockLayout=mE,D.ContextProvider=Qx,D.DataTable=B_,D.DemoData=tE,D.DropdownListItem=no,D.LongText=pl,D.MultiError=xa,D.PlAgCellFile=zE,D.PlAgDataTable=ME,D.PlAgOverlayLoading=qu,D.PlAgOverlayNoRows=Ku,D.PlAlert=oC,D.PlBlockPage=W_,D.PlBtnAccent=dC,D.PlBtnDanger=pC,D.PlBtnGhost=sl,D.PlBtnGroup=FC,D.PlBtnLink=gC,D.PlBtnPrimary=il,D.PlBtnSecondary=ol,D.PlCheckbox=Fw,D.PlCheckboxGroup=Lw,D.PlChip=fl,D.PlContainer=j_,D.PlCopyData=Wu,D.PlDialogModal=gl,D.PlDropdown=hl,D.PlDropdownLegacy=ow,D.PlDropdownLine=Eu,D.PlDropdownMulti=Nw,D.PlDropdownRef=F0,D.PlFileDialog=Bu,D.PlFileInput=$u,D.PlGrid=Q_,D.PlIcon16=us,D.PlIcon24=wu,D.PlLogView=hb,D.PlMaskIcon16=Xi,D.PlMaskIcon24=Mn,D.PlNotificationAlert=Uu,D.PlNumberField=yw,D.PlProgressBar=dw,D.PlRow=K_,D.PlSlideModal=Xw,D.PlSpacer=fu,D.PlTabs=wb,D.PlTextArea=u0,D.PlTextField=bu,D.PlToggleSwitch=tb,D.PlTooltip=Tt,D.ReactiveFileContent=Bl,D.Scrollable=Uk,D.Slider=dk,D.SliderRange=Gk,D.SliderRangeTriple=Bk,D.ThemeSwitcher=L_,D.UnresolvedError=ba,D.ValueOrErrorsComponent=OE,D.activateAgGrid=Ud,D.animate=lu,D.animateInfinite=D_,D.call=ru,D.computedResult=UE,D.createModel=Aa,D.debounce=cu,D.defineApp=rv,D.defineStore=$E,D.delay=iu,D.detectOutside=p0,D.ensureError=Ea,D.eventListener=dl,D.formatZodError=Ba,D.getElementScrollPosition=ku,D.identity=Sa,D.isDefined=rm,D.isElementVisible=xu,D.isJsonEqual=ka,D.isZodError=Ta,D.listToOptions=F_,D.makeEaseInOut=N_,D.makeEaseOut=au,D.maskIcons16=Q1,D.maskIcons24=eE,D.normalizeListOptions=Pr,D.notEmpty=Qa,D.randomInt=su,D.randomString=V_,D.requestTick=el,D.scrollIntoView=to,D.showContextMenu=Ya,D.throttle=du,D.timeout=ou,D.unwrapOptionalResult=nm,D.unwrapValueOrErrors=od,D.useClickOutside=ds,D.useDraggable=yk,D.useEventListener=et,D.useFormState=mk,D.useHover=tu,D.useInterval=fk,D.useLabelNotch=Rn,D.useLocalStorage=uu,D.useMouse=eu,D.useMouseCapture=rr,D.usePosition=Qi,D.useQuery=gk,D.useResizeObserver=Hu,D.useScroll=uk,D.useSdkPlugin=Ha,D.useSortable=hk,D.useTheme=hu,D.useWatchFetch=ep,D.wrapOptionalResult=sd,D.wrapValueOrErrors=tm,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
|
88
|
+
`)+K+`return __p
|
|
89
|
+
}`;var Ae=Uf(function(){return ze(_,ce+"return "+K).apply(n,x)});if(Ae.source=K,$c(Ae))throw Ae;return Ae}function ZD(o){return Ue(o).toLowerCase()}function UD(o){return Ue(o).toUpperCase()}function $D(o,a,d){if(o=Ue(o),o&&(d||a===n))return Jp(o);if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Cn(a),_=Xp(h,g),x=Qp(h,g)+1;return Er(h,_,x).join("")}function WD(o,a,d){if(o=Ue(o),o&&(d||a===n))return o.slice(0,th(o)+1);if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Qp(h,Cn(a))+1;return Er(h,0,g).join("")}function HD(o,a,d){if(o=Ue(o),o&&(d||a===n))return o.replace($l,"");if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Xp(h,Cn(a));return Er(h,g).join("")}function jD(o,a){var d=A,h=q;if(Qe(a)){var g="separator"in a?a.separator:g;d="length"in a?Te(a.length):d,h="omission"in a?Wt(a.omission):h}o=Ue(o);var _=o.length;if(wi(o)){var x=Cn(o);_=x.length}if(d>=_)return o;var B=d-bi(h);if(B<1)return h;var D=x?Er(x,0,B).join(""):o.slice(0,B);if(g===n)return D+h;if(x&&(B+=D.length-B),Wc(g)){if(o.slice(B).search(g)){var H,j=D;for(g.global||(g=ac(g.source,Ue(_p.exec(g))+"g")),g.lastIndex=0;H=g.exec(j);)var K=H.index;D=D.slice(0,K===n?B:K)}}else if(o.indexOf(Wt(g),B)!=B){var te=D.lastIndexOf(g);te>-1&&(D=D.slice(0,te))}return D+h}function qD(o){return o=Ue(o),o&&oT.test(o)?o.replace(gp,xB):o}var KD=Vi(function(o,a,d){return o+(d?" ":"")+a.toUpperCase()}),qc=Uh("toUpperCase");function Zf(o,a,d){return o=Ue(o),a=d?n:a,a===n?vB(o)?EB(o):cB(o):o.match(a)||[]}var Uf=Ne(function(o,a){try{return Ut(o,n,a)}catch(d){return $c(d)?d:new xe(d)}}),YD=jn(function(o,a){return Yt(a,function(d){d=Dn(d),Wn(o,d,Zc(o[d],o))}),o});function JD(o){var a=o==null?0:o.length,d=he();return o=a?Ye(o,function(h){if(typeof h[1]!="function")throw new Jt(c);return[d(h[0]),h[1]]}):[],Ne(function(h){for(var g=-1;++g<a;){var _=o[g];if(Ut(_[0],this,h))return Ut(_[1],this,h)}})}function XD(o){return xV(Qt(o,y))}function Kc(o){return function(){return o}}function QD(o,a){return o==null||o!==o?a:o}var eF=Wh(),tF=Wh(!0);function Mt(o){return o}function Yc(o){return wh(typeof o=="function"?o:Qt(o,y))}function nF(o){return xh(Qt(o,y))}function rF(o,a){return kh(o,Qt(a,y))}var iF=Ne(function(o,a){return function(d){return Uo(d,o,a)}}),oF=Ne(function(o,a){return function(d){return Uo(o,d,a)}});function Jc(o,a,d){var h=pt(a),g=ia(a,h);d==null&&!(Qe(a)&&(g.length||!h.length))&&(d=a,a=o,o=this,g=ia(a,pt(a)));var _=!(Qe(d)&&"chain"in d)||!!d.chain,x=Kn(o);return Yt(g,function(B){var D=a[B];o[B]=D,x&&(o.prototype[B]=function(){var H=this.__chain__;if(_||H){var j=o(this.__wrapped__),K=j.__actions__=Dt(this.__actions__);return K.push({func:D,args:arguments,thisArg:o}),j.__chain__=H,j}return D.apply(o,Cr([this.value()],arguments))})}),o}function sF(){return ft._===this&&(ft._=PB),this}function Xc(){}function aF(o){return o=Te(o),Ne(function(a){return Sh(a,o)})}var lF=Vc(Ye),cF=Vc(Hp),dF=Vc(ec);function $f(o){return Mc(o)?tc(Dn(o)):GV(o)}function uF(o){return function(a){return o==null?n:qr(o,a)}}var pF=jh(),hF=jh(!0);function Qc(){return[]}function ed(){return!1}function fF(){return{}}function mF(){return""}function gF(){return!0}function yF(o,a){if(o=Te(o),o<1||o>we)return[];var d=ht,h=wt(o,ht);a=he(a),o-=ht;for(var g=ic(h,a);++d<o;)a(d);return g}function vF(o){return ke(o)?Ye(o,Dn):Ht(o)?[o]:Dt(df(Ue(o)))}function _F(o){var a=++AB;return Ue(o)+a}var CF=da(function(o,a){return o+a},0),wF=Ac("ceil"),bF=da(function(o,a){return o/a},1),xF=Ac("floor");function kF(o){return o&&o.length?ra(o,Mt,mc):n}function SF(o,a){return o&&o.length?ra(o,he(a,2),mc):n}function EF(o){return Kp(o,Mt)}function TF(o,a){return Kp(o,he(a,2))}function BF(o){return o&&o.length?ra(o,Mt,_c):n}function VF(o,a){return o&&o.length?ra(o,he(a,2),_c):n}var AF=da(function(o,a){return o*a},1),NF=Ac("round"),PF=da(function(o,a){return o-a},0);function DF(o){return o&&o.length?rc(o,Mt):0}function FF(o,a){return o&&o.length?rc(o,he(a,2)):0}return v.after=nP,v.ary=wf,v.assign=UP,v.assignIn=Rf,v.assignInWith=xa,v.assignWith=$P,v.at=WP,v.before=bf,v.bind=Zc,v.bindAll=YD,v.bindKey=xf,v.castArray=fP,v.chain=vf,v.chunk=xA,v.compact=kA,v.concat=SA,v.cond=JD,v.conforms=XD,v.constant=Kc,v.countBy=DN,v.create=HP,v.curry=kf,v.curryRight=Sf,v.debounce=Ef,v.defaults=jP,v.defaultsDeep=qP,v.defer=rP,v.delay=iP,v.difference=EA,v.differenceBy=TA,v.differenceWith=BA,v.drop=VA,v.dropRight=AA,v.dropRightWhile=NA,v.dropWhile=PA,v.fill=DA,v.filter=RN,v.flatMap=LN,v.flatMapDeep=ON,v.flatMapDepth=GN,v.flatten=ff,v.flattenDeep=FA,v.flattenDepth=RA,v.flip=oP,v.flow=eF,v.flowRight=tF,v.fromPairs=MA,v.functions=tD,v.functionsIn=nD,v.groupBy=zN,v.initial=LA,v.intersection=OA,v.intersectionBy=GA,v.intersectionWith=zA,v.invert=iD,v.invertBy=oD,v.invokeMap=UN,v.iteratee=Yc,v.keyBy=$N,v.keys=pt,v.keysIn=Rt,v.map=ya,v.mapKeys=aD,v.mapValues=lD,v.matches=nF,v.matchesProperty=rF,v.memoize=_a,v.merge=cD,v.mergeWith=Mf,v.method=iF,v.methodOf=oF,v.mixin=Jc,v.negate=Ca,v.nthArg=aF,v.omit=dD,v.omitBy=uD,v.once=sP,v.orderBy=WN,v.over=lF,v.overArgs=aP,v.overEvery=cF,v.overSome=dF,v.partial=Uc,v.partialRight=Tf,v.partition=HN,v.pick=pD,v.pickBy=If,v.property=$f,v.propertyOf=uF,v.pull=WA,v.pullAll=gf,v.pullAllBy=HA,v.pullAllWith=jA,v.pullAt=qA,v.range=pF,v.rangeRight=hF,v.rearg=lP,v.reject=KN,v.remove=KA,v.rest=cP,v.reverse=Gc,v.sampleSize=JN,v.set=fD,v.setWith=mD,v.shuffle=XN,v.slice=YA,v.sortBy=tP,v.sortedUniq=rN,v.sortedUniqBy=iN,v.split=LD,v.spread=dP,v.tail=oN,v.take=sN,v.takeRight=aN,v.takeRightWhile=lN,v.takeWhile=cN,v.tap=kN,v.throttle=uP,v.thru=ga,v.toArray=Pf,v.toPairs=Lf,v.toPairsIn=Of,v.toPath=vF,v.toPlainObject=Ff,v.transform=gD,v.unary=pP,v.union=dN,v.unionBy=uN,v.unionWith=pN,v.uniq=hN,v.uniqBy=fN,v.uniqWith=mN,v.unset=yD,v.unzip=zc,v.unzipWith=yf,v.update=vD,v.updateWith=_D,v.values=Pi,v.valuesIn=CD,v.without=gN,v.words=Zf,v.wrap=hP,v.xor=yN,v.xorBy=vN,v.xorWith=_N,v.zip=CN,v.zipObject=wN,v.zipObjectDeep=bN,v.zipWith=xN,v.entries=Lf,v.entriesIn=Of,v.extend=Rf,v.extendWith=xa,Jc(v,v),v.add=CF,v.attempt=Uf,v.camelCase=kD,v.capitalize=Gf,v.ceil=wF,v.clamp=wD,v.clone=mP,v.cloneDeep=yP,v.cloneDeepWith=vP,v.cloneWith=gP,v.conformsTo=_P,v.deburr=zf,v.defaultTo=QD,v.divide=bF,v.endsWith=SD,v.eq=bn,v.escape=ED,v.escapeRegExp=TD,v.every=FN,v.find=MN,v.findIndex=pf,v.findKey=KP,v.findLast=IN,v.findLastIndex=hf,v.findLastKey=YP,v.floor=xF,v.forEach=_f,v.forEachRight=Cf,v.forIn=JP,v.forInRight=XP,v.forOwn=QP,v.forOwnRight=eD,v.get=Hc,v.gt=CP,v.gte=wP,v.has=rD,v.hasIn=jc,v.head=mf,v.identity=Mt,v.includes=ZN,v.indexOf=IA,v.inRange=bD,v.invoke=sD,v.isArguments=Jr,v.isArray=ke,v.isArrayBuffer=bP,v.isArrayLike=Ft,v.isArrayLikeObject=nt,v.isBoolean=xP,v.isBuffer=Tr,v.isDate=kP,v.isElement=SP,v.isEmpty=EP,v.isEqual=TP,v.isEqualWith=BP,v.isError=$c,v.isFinite=VP,v.isFunction=Kn,v.isInteger=Bf,v.isLength=wa,v.isMap=Vf,v.isMatch=AP,v.isMatchWith=NP,v.isNaN=PP,v.isNative=DP,v.isNil=RP,v.isNull=FP,v.isNumber=Af,v.isObject=Qe,v.isObjectLike=et,v.isPlainObject=Ko,v.isRegExp=Wc,v.isSafeInteger=MP,v.isSet=Nf,v.isString=ba,v.isSymbol=Ht,v.isTypedArray=Ni,v.isUndefined=IP,v.isWeakMap=LP,v.isWeakSet=OP,v.join=ZA,v.kebabCase=BD,v.last=tn,v.lastIndexOf=UA,v.lowerCase=VD,v.lowerFirst=AD,v.lt=GP,v.lte=zP,v.max=kF,v.maxBy=SF,v.mean=EF,v.meanBy=TF,v.min=BF,v.minBy=VF,v.stubArray=Qc,v.stubFalse=ed,v.stubObject=fF,v.stubString=mF,v.stubTrue=gF,v.multiply=AF,v.nth=$A,v.noConflict=sF,v.noop=Xc,v.now=va,v.pad=ND,v.padEnd=PD,v.padStart=DD,v.parseInt=FD,v.random=xD,v.reduce=jN,v.reduceRight=qN,v.repeat=RD,v.replace=MD,v.result=hD,v.round=NF,v.runInContext=P,v.sample=YN,v.size=QN,v.snakeCase=ID,v.some=eP,v.sortedIndex=JA,v.sortedIndexBy=XA,v.sortedIndexOf=QA,v.sortedLastIndex=eN,v.sortedLastIndexBy=tN,v.sortedLastIndexOf=nN,v.startCase=OD,v.startsWith=GD,v.subtract=PF,v.sum=DF,v.sumBy=FF,v.template=zD,v.times=yF,v.toFinite=Yn,v.toInteger=Te,v.toLength=Df,v.toLower=ZD,v.toNumber=nn,v.toSafeInteger=ZP,v.toString=Ue,v.toUpper=UD,v.trim=$D,v.trimEnd=WD,v.trimStart=HD,v.truncate=jD,v.unescape=qD,v.uniqueId=_F,v.upperCase=KD,v.upperFirst=qc,v.each=_f,v.eachRight=Cf,v.first=mf,Jc(v,function(){var o={};return Nn(v,function(a,d){$e.call(v.prototype,d)||(o[d]=a)}),o}(),{chain:!1}),v.VERSION=i,Yt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){v[o].placeholder=v}),Yt(["drop","take"],function(o,a){De.prototype[o]=function(d){d=d===n?1:lt(Te(d),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=wt(d,h.__takeCount__):h.__views__.push({size:wt(d,ht),type:o+(h.__dir__<0?"Right":"")}),h},De.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Yt(["filter","map","takeWhile"],function(o,a){var d=a+1,h=d==N||d==Y;De.prototype[o]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:he(g,3),type:d}),_.__filtered__=_.__filtered__||h,_}}),Yt(["head","last"],function(o,a){var d="take"+(a?"Right":"");De.prototype[o]=function(){return this[d](1).value()[0]}}),Yt(["initial","tail"],function(o,a){var d="drop"+(a?"":"Right");De.prototype[o]=function(){return this.__filtered__?new De(this):this[d](1)}}),De.prototype.compact=function(){return this.filter(Mt)},De.prototype.find=function(o){return this.filter(o).head()},De.prototype.findLast=function(o){return this.reverse().find(o)},De.prototype.invokeMap=Ne(function(o,a){return typeof o=="function"?new De(this):this.map(function(d){return Uo(d,o,a)})}),De.prototype.reject=function(o){return this.filter(Ca(he(o)))},De.prototype.slice=function(o,a){o=Te(o);var d=this;return d.__filtered__&&(o>0||a<0)?new De(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-o)),d)},De.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},De.prototype.toArray=function(){return this.take(ht)},Nn(De.prototype,function(o,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=v[h?"take"+(a=="last"?"Right":""):a],_=h||/^find/.test(a);g&&(v.prototype[a]=function(){var x=this.__wrapped__,B=h?[1]:arguments,D=x instanceof De,H=B[0],j=D||ke(x),K=function(Pe){var Fe=g.apply(v,Cr([Pe],B));return h&&te?Fe[0]:Fe};j&&d&&typeof H=="function"&&H.length!=1&&(D=j=!1);var te=this.__chain__,ce=!!this.__actions__.length,me=_&&!te,Ae=D&&!ce;if(!_&&j){x=Ae?x:new De(this);var ge=o.apply(x,B);return ge.__actions__.push({func:ga,args:[K],thisArg:n}),new Xt(ge,te)}return me&&Ae?o.apply(this,B):(ge=this.thru(K),me?h?ge.value()[0]:ge.value():ge)})}),Yt(["pop","push","shift","sort","splice","unshift"],function(o){var a=Zs[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);v.prototype[o]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[d](function(x){return a.apply(ke(x)?x:[],g)})}}),Nn(De.prototype,function(o,a){var d=v[a];if(d){var h=d.name+"";$e.call(Ei,h)||(Ei[h]=[]),Ei[h].push({name:a,func:d})}}),Ei[ca(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=qB,De.prototype.reverse=KB,De.prototype.value=YB,v.prototype.at=SN,v.prototype.chain=EN,v.prototype.commit=TN,v.prototype.next=BN,v.prototype.plant=AN,v.prototype.reverse=NN,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=PN,v.prototype.first=v.prototype.head,Mo&&(v.prototype[Mo]=VN),v},xi=TB();Ur?((Ur.exports=xi)._=xi,Yl._=xi):ft._=xi}).call(Di)}(Bs,Bs.exports);var Oe=Bs.exports;const vE={class:"grid-overlay-container"},Qu=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",vE,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),_E={},CE={class:"grid-overlay-container"};function wE(t,e){return r.openBlock(),r.createElementBlock("div",CE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const ep=Ts(_E,[["render",wE]]);async function bE(t,e){throw Error("not implemented")}function xE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function kE(t,e){const n=[];for(const i of e)if(t[i].type==="column"){const s=xE(t[i].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=Sd(l),u=t.findIndex(p=>Oe.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",i,c,t),Error("axis not found");n.push({columnIdx:i,axisIdx:u})}}return n}const tp=(t,e)=>(t+e).toString();function SE(t,e,n,i,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let u=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(u=y),l[y]===c.columnIdx&&(p=y);const f=(()=>{const S=i[u].data.filter(E=>E!==null);return Array.from(new Set(S))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=EE(s,i,u,p,f,e.rows);for(let y=0;y<f.length;++y){const S=f[y],E=S+"@"+y;n.push({colId:E,field:tp(i.length,y),headerName:S,valueFormatter:rp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function EE(t,e,n,i,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let V=0;V<e.length;++V){if(V===n||V===i)continue;const F=t[V].toString();m[F]=e[V].data[f]}let y;const S=Xr(Object.values(m))??"";c.has(S)?y=c.get(S):(c.set(S,m),y=m,y.id=u.toString(),u++);const E=s.indexOf(e[n].data[f]);if(E===-1)throw Error("index not found");const M=tp(e.length,E);y[M]=e[i].data[f]}return Array.from(c.values())}function TE(t){return Xr(t)}function np(t){return JSON.parse(t)}const rp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function BE(t,e,n){var s,l,c;const i=TE(e);return{colId:i,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(i))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:rp,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function ip(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function op(t){const e=[];return as(t,n=>(e.push(n),n)),e}async function VE(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Oe.uniqWith(n.map(s=>Za(s.spec.axesSpec).map(Oe.cloneDeep)).flat(),Oe.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function AE(t,e,n){const i=op(n),l=(await VE(t,e,i)).filter(c=>!Oe.find(i,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function NE(t,e,n,i){const s=n.filter(m=>m.type!=="Bytes"),l=op(i),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=Za(l[m].spec.axesSpec);for(let S=0;S<y.length;++S){const E=Oe.findIndex(s,M=>Oe.isEqual(M,y[S]));E===-1||u[E]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[E]=[[m,S]],u[E]=l[m].columnId):c[E].push([m,S]))}}for(let m=s.length-1;m>=0;--m)c[m].length||(u.splice(m,1),c.splice(m,1),s.splice(m,1));const p=100,f=s.map(m=>new Set);e:for(let m=s.length-1;m>=0;--m){for(const[y,S]of c[m]){const E=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Oe.cloneDeep(s[m])},filters:[],limit:p});if(E.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const M=E.values.type;for(const V of E.values.data)if(!(kd(V,M)||V===null)&&(f[m].add(ip(V,M)),f[m].size===p)){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}return s.map((m,y)=>{const S=[...f[y]].map(M=>({value:M,text:M.toString()})),E=S[0].value;return{axis:Oe.cloneDeep(m),...u[y]&&{column:u[y]},options:S,defaultValue:E}})}function PE(t,e,n,i){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(i++).toString();for(const m of n)u.push(e[m].data[c]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),S=e[m].data[c],E=e[m].type;gg(e[m].absent,c)?f[y]=void 0:kd(S,E)||S===null?f[y]=null:f[y]=ip(S,E)}l.push(f)}return l}const DE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function FE(t,e,n,i){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(C=>!Oe.find(n,G=>Oe.isEqual(G.axis,s[C].id)||Oe.isEqual(G.column,s[C].id))).sort((C,G)=>{var L,U;if(s[C].type!==s[G].type)return s[C].type==="axis"?-1:1;const Q=(L=s[C].spec.annotations)==null?void 0:L["pl7.app/table/orderPriority"],I=(U=s[G].spec.annotations)==null?void 0:U["pl7.app/table/orderPriority"];return Q===void 0?I===void 0?0:1:I===void 0?-1:Number(I)-Number(Q)}),u=Oe.cloneDeep(c),p=kE(s,c);for(let C=c.length-1;C>=0;--C){const G=c[C];if(!DE(s[G]))continue;const Q=Za(s[G].spec.axesSpec)[0],I=Oe.findIndex(c,L=>Oe.isEqual(s[L].id,Q));if(I!==-1){c[I]=G;for(const L of p)L.axisIdx===G&&(L.axisIdx=I);c.splice(C,1),u.splice(C,1)}}const f=await t.getShape(e),m=f.rows,y=u.map(C=>BE(C,s[C],i));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return SE(p,f,y,await t.getData(e,c),u,c);const S=[...c],E=new Map;for(let C=0;C<l;++C)E.set(C,-1);for(let C=0;C<S.length;++C){const G=S[C];E.has(G)&&E.set(G,C)}for(const[C,G]of E)G===-1&&(E.set(C,S.length),S.push(C));const M=[];for(let C=0;C<l;++C){const G=E.get(C);if(G===void 0||G===-1)throw new Error("assertion exception");M.push(G)}let V;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async C=>{try{if(m==0){C.success({rowData:[],rowCount:m}),C.api.showNoRowsOverlay(),C.api.setGridOption("loading",!1);return}if(V&&!Oe.isEqual(V.request.sortModel,C.request.sortModel)){V=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}V=C;let G=0,Q=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(G=Math.min(m,C.request.endRow)-C.request.startRow,G>0)){const I=await t.getData(e,S,{offset:C.request.startRow,length:G});Q=PE(u,I,M,C.request.startRow)}C.success({rowData:Q,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(G){C.api.setGridOption("loading",!0),C.fail(),console.trace(G)}}}}}const RE={class:"ap-ag-data-table-container"},ME={key:0,class:"ap-ag-data-table-sheets"},IE=Ts(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{emit:e}){b.ModuleRegistry.registerModules([Jo.ClientSideRowModelModule,ad.ClipboardModule,sd.ServerSideRowModelModule,ld.RangeSelectionModule,Ha,jd]);const n=r.useModel(t,"modelValue"),i=t,{settings:s}=r.toRefs(i),l=e;r.watch(()=>s.value,async(I,L)=>{if(I.sourceType!=="pframe"||!I.pFrame||!I.join||L&&L.sourceType==="pframe"&&Oe.isEqual(I.pFrame,L.pFrame)&&Oe.isEqual(I.join,L.join))return;const U=window.platforma;if(!U)throw Error("platforma not set");const T=U.pFrameDriver;if(!T)throw Error("platforma.pFrameDriver not set");const k=await AE(T,I.pFrame,I.join),O=n.value;O.pTableParams||(O.pTableParams={sorting:[],filters:[]}),O.pTableParams.join=k,n.value=O});const c=sp(()=>s.value.sourceType,async I=>{var U;const L=s.value.sourceType;switch(L){case"pframe":{const T=window.platforma;if(!T)throw Error("platforma not set");const k=T.pFrameDriver;if(!k)throw Error("platforma.pFrameDriver not set");if(!s.value.pFrame)return[];const O=s.value.pFrame,A=(U=n.value.pTableParams)==null?void 0:U.join;return A?await NE(k,O,s.value.sheetAxes,A):[]}case"ptable":return s.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${L}`)}});function u(I){if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return(I==null?void 0:I.sortModel.map(L=>{const{spec:U,...T}=np(L.colId);return{column:T,ascending:L.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const I=n.value;return{columnOrder:I.gridState.columnOrder,sort:I.gridState.sort,columnVisibility:I.gridState.columnVisibility}},set:I=>{const L=n.value,U=E.value.rowModelType==="clientSide"?void 0:u(I.sort);L.gridState={...L.gridState,...I},(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(L.pTableParams||(L.pTableParams={sorting:[],filters:[]}),L.pTableParams.sorting=U),n.value=L}}),f=I=>Xr(I);function m(I){var L;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((L=c.value)==null?void 0:L.map(U=>({type:"bySingleColumn",column:U.column?{type:"column",id:U.column}:{type:"axis",id:U.axis},predicate:{operator:"Equal",reference:I[f(U.axis)]}})))??[]}const y=r.computed({get:()=>n.value.gridState.sheets??{},set:I=>{const L=m(I),U=n.value;U.gridState.sheets=I,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(U.pTableParams||(U.pTableParams={sorting:[],filters:[]}),U.pTableParams.filters=L),n.value=U}});r.watch(()=>[s.value,c.value],(I,L)=>{const[U,T]=I;if(!T)return;if(L){const[O,A]=L;if((U.sourceType==="ptable"||U.sourceType==="pframe")&&U.sourceType===(O==null?void 0:O.sourceType)&&Oe.isEqual(T,A))return}if(U.sourceType!=="ptable"&&U.sourceType!=="pframe"){y.value={};return}const k=y.value;for(const O of T){const A=f(O.axis);k[A]||(k[A]=O.defaultValue??O.options[0].value)}y.value=k},{immediate:!0});const S=r.shallowRef(),E=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:I=>{I.api.autoSizeAllColumns()},onRowDoubleClicked:I=>{I.data&&l("onRowDoubleClicked",I.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:I=>I.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Qu,noRowsOverlayComponent:ep,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),M=I=>{const L=I.api;S.value=new Proxy(L,{get(U,T,k){switch(T){case"setGridOption":return(O,A)=>{const q=E.value;q[O]=A,E.value=q,L.updateGridOptions(q)};case"updateGridOptions":return O=>{E.value={...E.value,...O},L.updateGridOptions(O)};default:return Reflect.get(U,T,k)}}})},V=I=>({columnOrder:I.columnOrder,sort:I.sort,columnVisibility:I.columnVisibility??(I.columnOrder?{hiddenColIds:[]}:void 0)}),F=I=>{E.value.initialState=p.value=V(I.state),I.api.autoSizeAllColumns()},C=()=>{E.value.initialState=p.value=V(S.value.getState()),S.value=void 0},G=r.ref(0);r.watch(()=>[S.value,p.value],(I,L)=>{if(Oe.isEqual(I,L))return;const[U,T]=I;if(!U)return;const k=V(U.getState());Oe.isEqual(T,k)||(E.value.initialState=T,++G.value)}),r.watch(()=>E.value,(I,L)=>{var U;if(L&&(I.rowModelType!=L.rowModelType&&++G.value,!Oe.isEqual(I.columnDefs,L.columnDefs)&&I.columnDefs)){const T=A=>!("children"in A),k=(U=I.columnDefs)==null?void 0:U.filter(T),O=k==null?void 0:k.map(A=>A.colId).filter(A=>A!==void 0).map(A=>np(A));l("columnsChanged",O??[])}});const Q=(I,L)=>{var T;const U=y.value;U[I]!==L&&(U[I]=L,y.value=U,(T=S.value)==null||T.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[S.value,s.value,c.value],async(I,L)=>{var q,se;if(Oe.isEqual(I,L))return;const[U,T,k]=I;if(!U)return;const O=window.platforma;if(!O)throw Error("platforma not set");const A=T.sourceType;switch(A){case"pframe":case"ptable":{const $=O.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const N=T.pTable;if(!N||!k)return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const Z=(se=(q=p.value)==null?void 0:q.columnVisibility)==null?void 0:se.hiddenColIds,Y=await FE($,N,k,Z);return U.updateGridOptions({loading:Y.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Y})}case"xsv":{const $=O.blobDriver;if(!$)throw Error("platforma.blobDriver not set");const N=T.xsvFile;if(!(N!=null&&N.ok)||!N.value)return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const Z=await bE($,N.value);return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...Z})}default:throw Error(`unsupported source type: ${A}`)}}),(I,L)=>(r.openBlock(),r.createElementBlock("div",RE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(c).value&&r.unref(c).value.length>0?(r.openBlock(),r.createElementBlock("div",ME,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c).value,(U,T)=>(r.openBlock(),r.createBlock(r.unref(Vu),{key:T,"model-value":y.value[f(U.axis)],options:U.options,"onUpdate:modelValue":k=>Q(f(U.axis),k)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(tm.AgGridVue),{key:G.value,theme:r.unref(Kd),class:"ap-ag-data-table-grid","grid-options":E.value,onGridReady:M,onStateUpdated:F,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-278d42fe"]]),LE={key:0,class:"d-flex gap-10 flex-column"},OE=Ts(r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:i,restrictions:s,defaults:l}=r.toRefs(n),c=T=>Xr(T.id),u=r.computed(()=>i.value.filter(T=>{const k=T.type;switch(k){case"axis":return T.spec.type!=="Bytes";case"column":return T.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${k}`)}}).map(T=>({column:T,id:c(T)}))),p=r.computed(()=>{const T=s.value??[],k={};for(const{column:O,id:A}of u.value){const q=Oe.find(T,se=>Oe.isEqual(se.column.id,O.id));q!==void 0&&(k[A]=q.allowedFilterTypes)}return k}),f=r.computed(()=>{const T=l.value??[],k={};for(const{column:O,id:A}of u.value){const q=Oe.find(T,se=>Oe.isEqual(se.column.id,O.id));q!==void 0&&(k[A]=q.default)}return k}),m=T=>T!==void 0?T:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,T=>{Oe.isEqual(y.state,T.state)||(y.state=m(T.state))}),r.watch(()=>u.value,T=>{const k=y.state??{},O={};for(const{id:A}of T)k[A]!==void 0&&(O[A]=k[A]);y.state=O},{immediate:!0});const S=T=>{switch(T){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThen":return"Greater then";case"number_greaterThenOrEqualTo":return"Greater then or equal to";case"number_lessThen":return"Less then";case"number_lessThenOrEqualTo":return"Less then or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${T}`)}},E=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThen","number_greaterThenOrEqualTo","number_lessThen","number_lessThenOrEqualTo","number_between"],M=["isNotNA","isNA","string_equals","string_contains","string_matches","string_containsFuzzyMatch"],V=r.computed(()=>{const T=p.value,k={};for(const{column:O,id:A}of u.value){let se=(O.type==="column"?O.spec.valueType:O.spec.type)==="String"?M:E;const $=T[A];$!==void 0&&(se=se.filter(N=>$.includes(N))),k[A]=se.map(N=>({value:N,text:S(N)}))}return k}),F=T=>{const k=T.type;switch(k){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThen":case"number_greaterThenOrEqualTo":case"number_lessThen":case"number_lessThenOrEqualTo":return T.reference;case"number_between":return T.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return T.reference;default:throw Error(`unsupported filter type: ${k}`)}},C=(T,k)=>{switch(T){case"isNotNA":case"isNA":return{type:T};case"number_equals":case"number_notEquals":case"number_greaterThen":case"number_greaterThenOrEqualTo":case"number_lessThen":case"number_lessThenOrEqualTo":return{type:T,reference:typeof k=="number"?k:0};case"number_between":return{type:T,lowerBound:typeof k=="number"?k:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:T,reference:typeof k=="string"?k:""};case"string_containsFuzzyMatch":return{type:T,reference:typeof k=="string"?k:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${T}`)}},G=(T,k)=>{const O=y.state[T];y.state[T]=C(k,F(O))},Q=(T,k)=>{k?y.state[T]=f.value[T]??C(V.value[T][0].value):delete y.state[T]},I=T=>{const k=Oe.uniq(T);return k.sort(),k.map(O=>({value:O,text:O}))},L=T=>{const k=T.type;switch(k){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:T.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:T.reference}};case"number_greaterThen":return{operator:"Greater",reference:T.reference};case"number_greaterThenOrEqualTo":return{operator:"GreaterOrEqual",reference:T.reference};case"number_lessThen":return{operator:"Less",reference:T.reference};case"number_lessThenOrEqualTo":return{operator:"LessOrEqual",reference:T.reference};case"number_between":return{operator:"And",operands:[{operator:T.includeLowerBound?"GreaterOrEqual":"Greater",reference:T.lowerBound},{operator:T.includeUpperBound?"LessOrEqual":"Less",reference:T.upperBound}]};case"string_contains":return{operator:"StringContains",substring:T.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:T.reference}};case"string_matches":return{operator:"Matches",regex:T.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:T.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:T.reference,maxEdits:T.maxEdits,substitutionsOnly:T.substitutionsOnly,wildcard:T.wildcard};default:throw Error(`unsupported filter type: ${k}`)}},U=T=>u.value.map(({column:k,id:O})=>{if(!(O in T))return;const A=L(T[O]),{spec:q,...se}=k;return{type:"bySingleColumn",column:se,predicate:A}}).filter(k=>k!==void 0);return r.watch(()=>y,T=>{Oe.isEqual(T.state,e.value.state)||(e.value={state:Oe.cloneDeep(T.state),filters:U(T.state)})},{immediate:!0,deep:!0}),(T,k)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:O,id:A},q)=>{var se,$,N,Z,Y,pe,we,Ct,Tt,ht,yr,An,vr,zn;return r.openBlock(),r.createElementBlock("div",{key:A},[V.value[A].length>0?(r.openBlock(),r.createElementBlock("form",LE,[r.createVNode(r.unref(Au),{"model-value":!!y.state[A],"onUpdate:modelValue":Ge=>Q(A,Ge)},{default:r.withCtx(()=>{var Ge,Ps;return[r.createTextVNode(r.toDisplayString(((Ps=(Ge=O.spec.annotations)==null?void 0:Ge["pl7.app/label"])==null?void 0:Ps.trim())??"Unlabeled "+O.type+" "+q.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[A]}])},[y.state[A]?(r.openBlock(),r.createBlock(r.unref(so),{key:0,"model-value":y.state[A].type,options:V.value[A],label:"Predicate","onUpdate:modelValue":Ge=>G(A,Ge)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((se=y.state[A])==null?void 0:se.type)==="number_equals"||(($=y.state[A])==null?void 0:$.type)==="number_notEquals"||((N=y.state[A])==null?void 0:N.type)==="number_lessThen"||((Z=y.state[A])==null?void 0:Z.type)==="number_lessThenOrEqualTo"||((Y=y.state[A])==null?void 0:Y.type)==="number_greaterThen"||((pe=y.state[A])==null?void 0:pe.type)==="number_greaterThenOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,modelValue:y.state[A].reference,"onUpdate:modelValue":Ge=>y.state[A].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((we=y.state[A])==null?void 0:we.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(ms),{modelValue:y.state[A].lowerBound,"onUpdate:modelValue":Ge=>y.state[A].lowerBound=Ge,label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[A].includeLowerBound,"onUpdate:modelValue":Ge=>y.state[A].includeLowerBound=Ge,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ms),{modelValue:y.state[A].upperBound,"onUpdate:modelValue":Ge=>y.state[A].upperBound=Ge,label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[A].includeUpperBound,"onUpdate:modelValue":Ge=>y.state[A].includeUpperBound=Ge,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((Ct=y.state[A])==null?void 0:Ct.type)==="string_equals"||((Tt=y.state[A])==null?void 0:Tt.type)==="string_notEquals"||((ht=y.state[A])==null?void 0:ht.type)==="string_contains"||((yr=y.state[A])==null?void 0:yr.type)==="string_doesNotContain"||((An=y.state[A])==null?void 0:An.type)==="string_matches"||((vr=y.state[A])==null?void 0:vr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(fs),{key:3,modelValue:y.state[A].reference,"onUpdate:modelValue":Ge=>y.state[A].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((zn=y.state[A])==null?void 0:zn.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(fs),{modelValue:y.state[A].reference,"onUpdate:modelValue":Ge=>y.state[A].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Yu),{modelValue:y.state[A].maxEdits,"onUpdate:modelValue":Ge=>y.state[A].maxEdits=Ge,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[A].substitutionsOnly,"onUpdate:modelValue":Ge=>y.state[A].substitutionsOnly=Ge,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(so),{modelValue:y.state[A].wildcard,"onUpdate:modelValue":Ge=>y.state[A].wildcard=Ge,options:I(y.state[A].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128))}}),[["__scopeId","data-v-d44c6092"]]),GE={key:1,class:"alert-error"},zE={key:2},ZE=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),i=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&i.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",GE,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",zE,"Unresolved")):r.createCommentVNode("",!0)]))}}),UE={style:{height:"100%"}},$E=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),i=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(i.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",UE,[r.createVNode(r.unref(ju),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":i.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),Vs=new Map;function WE(t,e){const n=r.getCurrentScope()??r.effectScope(),i=n.run(()=>(r.onScopeDispose(()=>{Vs.delete(t)}),r.reactive(e())));return i[Symbol.dispose]=()=>{n.stop()},i}function HE(t){const e=Symbol();return()=>(Vs.has(e)||Vs.set(e,WE(e,t)),Vs.get(e))}function jE(t){return r.computed(()=>{try{return dd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function sp(t,e,n){const i=r.ref(0),s=r.reactive({loading:r.computed(()=>i.value>0),loadingRef:i,value:void 0,error:void 0}),l=im(e);return r.watch(t,async c=>{s.error=void 0,i.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{i.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const hi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ap=new Set,Vl=typeof process=="object"&&process?process:{},lp=(t,e,n,i)=>{typeof Vl.emitWarning=="function"?Vl.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)};let As=globalThis.AbortController,cp=globalThis.AbortSignal;if(typeof As>"u"){cp=class{constructor(){Ze(this,"onabort");Ze(this,"_onabort",[]);Ze(this,"reason");Ze(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},As=class{constructor(){Ze(this,"signal",new cp);e()}abort(i){var s,l;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const c of this.signal._onabort)c(i);(l=(s=this.signal).onabort)==null||l.call(s,i)}}};let t=((up=Vl.env)==null?void 0:up.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,lp("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const qE=t=>!ap.has(t),mr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),dp=t=>mr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ns:null:null;class Ns extends Array{constructor(e){super(e),this.fill(0)}}const Or=class Or{constructor(e,n){Ze(this,"heap");Ze(this,"length");if(!w(Or,fi))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=dp(e);if(!n)return[];fe(Or,fi,!0);const i=new Or(e,n);return fe(Or,fi,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};fi=new WeakMap,Le(Or,fi,!1);let Al=Or;const Dl=class Dl{constructor(e){Le(this,ee);Le(this,dn);Le(this,Ot);Le(this,un);Le(this,pn);Le(this,mi);Le(this,gi);Ze(this,"ttl");Ze(this,"ttlResolution");Ze(this,"ttlAutopurge");Ze(this,"updateAgeOnGet");Ze(this,"updateAgeOnHas");Ze(this,"allowStale");Ze(this,"noDisposeOnSet");Ze(this,"noUpdateTTL");Ze(this,"maxEntrySize");Ze(this,"sizeCalculation");Ze(this,"noDeleteOnFetchRejection");Ze(this,"noDeleteOnStaleGet");Ze(this,"allowStaleOnFetchAbort");Ze(this,"allowStaleOnFetchRejection");Ze(this,"ignoreFetchAbort");Le(this,st);Le(this,hn);Le(this,it);Le(this,je);Le(this,be);Le(this,St);Le(this,Gt);Le(this,_t);Le(this,dt);Le(this,fn);Le(this,ut);Le(this,mn);Le(this,gn);Le(this,zt);Le(this,yn);Le(this,gr);Le(this,Et);Le(this,Gr,()=>{});Le(this,Gn,()=>{});Le(this,Eo,()=>{});Le(this,Zt,()=>!1);Le(this,zr,e=>{});Le(this,yi,(e,n,i)=>{});Le(this,To,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ze(this,pp,"LRUCache");const{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:S,maxSize:E=0,maxEntrySize:M=0,sizeCalculation:V,fetchMethod:F,memoMethod:C,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:Q,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:L,ignoreFetchAbort:U}=e;if(n!==0&&!mr(n))throw new TypeError("max option must be a nonnegative integer");const T=n?dp(n):Array;if(!T)throw new Error("invalid max value: "+n);if(fe(this,dn,n),fe(this,Ot,E),this.maxEntrySize=M||w(this,Ot),this.sizeCalculation=V,this.sizeCalculation){if(!w(this,Ot)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(fe(this,gi,C),F!==void 0&&typeof F!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,mi,F),fe(this,gr,!!F),fe(this,it,new Map),fe(this,je,new Array(n).fill(void 0)),fe(this,be,new Array(n).fill(void 0)),fe(this,St,new T(n)),fe(this,Gt,new T(n)),fe(this,_t,0),fe(this,dt,0),fe(this,fn,Al.create(n)),fe(this,st,0),fe(this,hn,0),typeof f=="function"&&fe(this,un,f),typeof m=="function"?(fe(this,pn,m),fe(this,ut,[])):(fe(this,pn,void 0),fe(this,ut,void 0)),fe(this,yn,!!w(this,un)),fe(this,Et,!!w(this,pn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(w(this,Ot)!==0&&!mr(w(this,Ot)))throw new TypeError("maxSize must be a positive integer if specified");if(!mr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,ee,qf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=mr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!mr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,ee,nd).call(this)}if(w(this,dn)===0&&this.ttl===0&&w(this,Ot)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,dn)&&!w(this,Ot)){const k="LRU_CACHE_UNBOUNDED";qE(k)&&(ap.add(k),lp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,Dl))}}static unsafeExposeInternals(e){return{starts:w(e,gn),ttls:w(e,zt),sizes:w(e,mn),keyMap:w(e,it),keyList:w(e,je),valList:w(e,be),next:w(e,St),prev:w(e,Gt),get head(){return w(e,_t)},get tail(){return w(e,dt)},free:w(e,fn),isBackgroundFetch:n=>{var i;return le(i=e,ee,Ke).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return le(c=e,ee,Ea).call(c,n,i,s,l)},moveToTail:n=>{var i;return le(i=e,ee,Yo).call(i,n)},indexes:n=>{var i;return le(i=e,ee,Br).call(i,n)},rindexes:n=>{var i;return le(i=e,ee,Vr).call(i,n)},isStale:n=>{var i;return w(i=e,Zt).call(i,n)}}}get max(){return w(this,dn)}get maxSize(){return w(this,Ot)}get calculatedSize(){return w(this,hn)}get size(){return w(this,st)}get fetchMethod(){return w(this,mi)}get memoMethod(){return w(this,gi)}get dispose(){return w(this,un)}get disposeAfter(){return w(this,pn)}getRemainingTTL(e){return w(this,it).has(e)?1/0:0}*entries(){for(const e of le(this,ee,Br).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!le(this,ee,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*rentries(){for(const e of le(this,ee,Vr).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!le(this,ee,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*keys(){for(const e of le(this,ee,Br).call(this)){const n=w(this,je)[e];n!==void 0&&!le(this,ee,Ke).call(this,w(this,be)[e])&&(yield n)}}*rkeys(){for(const e of le(this,ee,Vr).call(this)){const n=w(this,je)[e];n!==void 0&&!le(this,ee,Ke).call(this,w(this,be)[e])&&(yield n)}}*values(){for(const e of le(this,ee,Br).call(this))w(this,be)[e]!==void 0&&!le(this,ee,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}*rvalues(){for(const e of le(this,ee,Vr).call(this))w(this,be)[e]!==void 0&&!le(this,ee,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}[(hp=Symbol.iterator,pp=Symbol.toStringTag,hp)](){return this.entries()}find(e,n={}){for(const i of le(this,ee,Br).call(this)){const s=w(this,be)[i],l=le(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,je)[i],this))return this.get(w(this,je)[i],n)}}forEach(e,n=this){for(const i of le(this,ee,Br).call(this)){const s=w(this,be)[i],l=le(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[i],this)}}rforEach(e,n=this){for(const i of le(this,ee,Vr).call(this)){const s=w(this,be)[i],l=le(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[i],this)}}purgeStale(){let e=!1;for(const n of le(this,ee,Vr).call(this,{allowStale:!0}))w(this,Zt).call(this,n)&&(le(this,ee,Ar).call(this,w(this,je)[n],"expire"),e=!0);return e}info(e){const n=w(this,it).get(e);if(n===void 0)return;const i=w(this,be)[n],s=le(this,ee,Ke).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;const l={value:s};if(w(this,zt)&&w(this,gn)){const c=w(this,zt)[n],u=w(this,gn)[n];if(c&&u){const p=c-(hi.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,mn)&&(l.size=w(this,mn)[n]),l}dump(){const e=[];for(const n of le(this,ee,Br).call(this,{allowStale:!0})){const i=w(this,je)[n],s=w(this,be)[n],l=le(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;const c={value:l};if(w(this,zt)&&w(this,gn)){c.ttl=w(this,zt)[n];const u=hi.now()-w(this,gn)[n];c.start=Math.floor(Date.now()-u)}w(this,mn)&&(c.size=w(this,mn)[n]),e.unshift([i,c])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const s=Date.now()-i.start;i.start=hi.now()-s}this.set(n,i.value,i)}}set(e,n,i={}){var S,E,M,V,F;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const m=w(this,To).call(this,e,n,i.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),le(this,ee,Ar).call(this,e,"set"),this;let y=w(this,st)===0?void 0:w(this,it).get(e);if(y===void 0)y=w(this,st)===0?w(this,dt):w(this,fn).length!==0?w(this,fn).pop():w(this,st)===w(this,dn)?le(this,ee,Sa).call(this,!1):w(this,st),w(this,je)[y]=e,w(this,be)[y]=n,w(this,it).set(e,y),w(this,St)[w(this,dt)]=y,w(this,Gt)[y]=w(this,dt),fe(this,dt,y),ka(this,st)._++,w(this,yi).call(this,y,m,p),p&&(p.set="add"),f=!1;else{le(this,ee,Yo).call(this,y);const C=w(this,be)[y];if(n!==C){if(w(this,gr)&&le(this,ee,Ke).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:G}=C;G!==void 0&&!c&&(w(this,yn)&&((S=w(this,un))==null||S.call(this,G,e,"set")),w(this,Et)&&((E=w(this,ut))==null||E.push([G,e,"set"])))}else c||(w(this,yn)&&((M=w(this,un))==null||M.call(this,C,e,"set")),w(this,Et)&&((V=w(this,ut))==null||V.push([C,e,"set"])));if(w(this,zr).call(this,y),w(this,yi).call(this,y,m,p),w(this,be)[y]=n,p){p.set="replace";const G=C&&le(this,ee,Ke).call(this,C)?C.__staleWhileFetching:C;G!==void 0&&(p.oldValue=G)}}else p&&(p.set="update")}if(s!==0&&!w(this,zt)&&le(this,ee,nd).call(this),w(this,zt)&&(f||w(this,Eo).call(this,y,s,l),p&&w(this,Gn).call(this,p,y)),!c&&w(this,Et)&&w(this,ut)){const C=w(this,ut);let G;for(;G=C==null?void 0:C.shift();)(F=w(this,pn))==null||F.call(this,...G)}return this}pop(){var e;try{for(;w(this,st);){const n=w(this,be)[w(this,_t)];if(le(this,ee,Sa).call(this,!0),le(this,ee,Ke).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,Et)&&w(this,ut)){const n=w(this,ut);let i;for(;i=n==null?void 0:n.shift();)(e=w(this,pn))==null||e.call(this,...i)}}}has(e,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=w(this,it).get(e);if(l!==void 0){const c=w(this,be)[l];if(le(this,ee,Ke).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(w(this,Zt).call(this,l))s&&(s.has="stale",w(this,Gn).call(this,s,l));else return i&&w(this,Gr).call(this,l),s&&(s.has="hit",w(this,Gn).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:i=this.allowStale}=n,s=w(this,it).get(e);if(s===void 0||!i&&w(this,Zt).call(this,s))return;const l=w(this,be)[s];return le(this,ee,Ke).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:M=this.allowStaleOnFetchAbort,context:V,forceRefresh:F=!1,status:C,signal:G}=n;if(!w(this,gr))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const Q={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:M,ignoreFetchAbort:E,status:C,signal:G};let I=w(this,it).get(e);if(I===void 0){C&&(C.fetch="miss");const L=le(this,ee,Ea).call(this,e,I,Q,V);return L.__returned=L}else{const L=w(this,be)[I];if(le(this,ee,Ke).call(this,L)){const A=i&&L.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",A&&(C.returnedStale=!0)),A?L.__staleWhileFetching:L.__returned=L}const U=w(this,Zt).call(this,I);if(!F&&!U)return C&&(C.fetch="hit"),le(this,ee,Yo).call(this,I),s&&w(this,Gr).call(this,I),C&&w(this,Gn).call(this,C,I),L;const T=le(this,ee,Ea).call(this,e,I,Q,V),O=T.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=U?"stale":"refresh",O&&U&&(C.returnedStale=!0)),O?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,n={}){const i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){const i=w(this,gi);if(!i)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...c}=n,u=this.get(e,c);if(!l&&u!==void 0)return u;const p=i(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,it).get(e);if(u!==void 0){const p=w(this,be)[u],f=le(this,ee,Ke).call(this,p);return c&&w(this,Gn).call(this,c,u),w(this,Zt).call(this,u)?(c&&(c.get="stale"),f?(c&&i&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),i?p.__staleWhileFetching:void 0):(l||le(this,ee,Ar).call(this,e,"expire"),c&&i&&(c.returnedStale=!0),i?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(le(this,ee,Yo).call(this,u),s&&w(this,Gr).call(this,u),p))}else c&&(c.get="miss")}delete(e){return le(this,ee,Ar).call(this,e,"delete")}clear(){return le(this,ee,od).call(this,"delete")}};dn=new WeakMap,Ot=new WeakMap,un=new WeakMap,pn=new WeakMap,mi=new WeakMap,gi=new WeakMap,st=new WeakMap,hn=new WeakMap,it=new WeakMap,je=new WeakMap,be=new WeakMap,St=new WeakMap,Gt=new WeakMap,_t=new WeakMap,dt=new WeakMap,fn=new WeakMap,ut=new WeakMap,mn=new WeakMap,gn=new WeakMap,zt=new WeakMap,yn=new WeakMap,gr=new WeakMap,Et=new WeakMap,ee=new WeakSet,nd=function(){const e=new Ns(w(this,dn)),n=new Ns(w(this,dn));fe(this,zt,e),fe(this,gn,n),fe(this,Eo,(l,c,u=hi.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,Zt).call(this,l)&&le(this,ee,Ar).call(this,w(this,je)[l],"expire")},c+1);p.unref&&p.unref()}}),fe(this,Gr,l=>{n[l]=e[l]!==0?hi.now():0}),fe(this,Gn,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=i||s();const f=l.now-p;l.remainingTTL=u-f}});let i=0;const s=()=>{const l=hi.now();if(this.ttlResolution>0){i=l;const c=setTimeout(()=>i=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=w(this,it).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(i||s())-p;return u-f},fe(this,Zt,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(i||s())-c>u})},Gr=new WeakMap,Gn=new WeakMap,Eo=new WeakMap,Zt=new WeakMap,qf=function(){const e=new Ns(w(this,dn));fe(this,hn,0),fe(this,mn,e),fe(this,zr,n=>{fe(this,hn,w(this,hn)-e[n]),e[n]=0}),fe(this,To,(n,i,s,l)=>{if(le(this,ee,Ke).call(this,i))return 0;if(!mr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!mr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),fe(this,yi,(n,i,s)=>{if(e[n]=i,w(this,Ot)){const l=w(this,Ot)-e[n];for(;w(this,hn)>l;)le(this,ee,Sa).call(this,!0)}fe(this,hn,w(this,hn)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=w(this,hn))})},zr=new WeakMap,yi=new WeakMap,To=new WeakMap,Br=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,dt);!(!le(this,ee,rd).call(this,n)||((e||!w(this,Zt).call(this,n))&&(yield n),n===w(this,_t)));)n=w(this,Gt)[n]},Vr=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,_t);!(!le(this,ee,rd).call(this,n)||((e||!w(this,Zt).call(this,n))&&(yield n),n===w(this,dt)));)n=w(this,St)[n]},rd=function(e){return e!==void 0&&w(this,it).get(w(this,je)[e])===e},Sa=function(e){var l,c;const n=w(this,_t),i=w(this,je)[n],s=w(this,be)[n];return w(this,gr)&&le(this,ee,Ke).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,yn)||w(this,Et))&&(w(this,yn)&&((l=w(this,un))==null||l.call(this,s,i,"evict")),w(this,Et)&&((c=w(this,ut))==null||c.push([s,i,"evict"]))),w(this,zr).call(this,n),e&&(w(this,je)[n]=void 0,w(this,be)[n]=void 0,w(this,fn).push(n)),w(this,st)===1?(fe(this,_t,fe(this,dt,0)),w(this,fn).length=0):fe(this,_t,w(this,St)[n]),w(this,it).delete(i),ka(this,st)._--,n},Ea=function(e,n,i,s){const l=n===void 0?void 0:w(this,be)[n];if(le(this,ee,Ke).call(this,l))return l;const c=new As,{signal:u}=i;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:i,context:s},f=(V,F=!1)=>{const{aborted:C}=c.signal,G=i.ignoreFetchAbort&&V!==void 0;if(i.status&&(C&&!F?(i.status.fetchAborted=!0,i.status.fetchError=c.signal.reason,G&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),C&&!G&&!F)return y(c.signal.reason);const Q=E;return w(this,be)[n]===E&&(V===void 0?Q.__staleWhileFetching?w(this,be)[n]=Q.__staleWhileFetching:le(this,ee,Ar).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,V,p.options))),V},m=V=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=V),y(V)),y=V=>{const{aborted:F}=c.signal,C=F&&i.allowStaleOnFetchAbort,G=C||i.allowStaleOnFetchRejection,Q=G||i.noDeleteOnFetchRejection,I=E;if(w(this,be)[n]===E&&(!Q||I.__staleWhileFetching===void 0?le(this,ee,Ar).call(this,e,"fetch"):C||(w(this,be)[n]=I.__staleWhileFetching)),G)return i.status&&I.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw V},S=(V,F)=>{var G;const C=(G=w(this,mi))==null?void 0:G.call(this,e,l,p);C&&C instanceof Promise&&C.then(Q=>V(Q===void 0?void 0:Q),F),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(V(void 0),i.allowStaleOnFetchAbort&&(V=Q=>f(Q,!0)))})};i.status&&(i.status.fetchDispatched=!0);const E=new Promise(S).then(f,m),M=Object.assign(E,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,M,{...p.options,status:void 0}),n=w(this,it).get(e)):w(this,be)[n]=M,M},Ke=function(e){if(!w(this,gr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof As},id=function(e,n){w(this,Gt)[n]=e,w(this,St)[e]=n},Yo=function(e){e!==w(this,dt)&&(e===w(this,_t)?fe(this,_t,w(this,St)[e]):le(this,ee,id).call(this,w(this,Gt)[e],w(this,St)[e]),le(this,ee,id).call(this,w(this,dt),e),fe(this,dt,e))},Ar=function(e,n){var s,l,c,u;let i=!1;if(w(this,st)!==0){const p=w(this,it).get(e);if(p!==void 0)if(i=!0,w(this,st)===1)le(this,ee,od).call(this,n);else{w(this,zr).call(this,p);const f=w(this,be)[p];if(le(this,ee,Ke).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,yn)||w(this,Et))&&(w(this,yn)&&((s=w(this,un))==null||s.call(this,f,e,n)),w(this,Et)&&((l=w(this,ut))==null||l.push([f,e,n]))),w(this,it).delete(e),w(this,je)[p]=void 0,w(this,be)[p]=void 0,p===w(this,dt))fe(this,dt,w(this,Gt)[p]);else if(p===w(this,_t))fe(this,_t,w(this,St)[p]);else{const m=w(this,Gt)[p];w(this,St)[m]=w(this,St)[p];const y=w(this,St)[p];w(this,Gt)[y]=w(this,Gt)[p]}ka(this,st)._--,w(this,fn).push(p)}}if(w(this,Et)&&((c=w(this,ut))!=null&&c.length)){const p=w(this,ut);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,pn))==null||u.call(this,...f)}return i},od=function(e){var n,i,s;for(const l of le(this,ee,Vr).call(this,{allowStale:!0})){const c=w(this,be)[l];if(le(this,ee,Ke).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=w(this,je)[l];w(this,yn)&&((n=w(this,un))==null||n.call(this,c,u,e)),w(this,Et)&&((i=w(this,ut))==null||i.push([c,u,e]))}}if(w(this,it).clear(),w(this,be).fill(void 0),w(this,je).fill(void 0),w(this,zt)&&w(this,gn)&&(w(this,zt).fill(0),w(this,gn).fill(0)),w(this,mn)&&w(this,mn).fill(0),fe(this,_t,0),fe(this,dt,0),w(this,fn).length=0,fe(this,hn,0),fe(this,st,0),w(this,Et)&&w(this,ut)){const l=w(this,ut);let c;for(;c=l==null?void 0:l.shift();)(s=w(this,pn))==null||s.call(this,...c)}};let Nl=Dl;const KE={cacheSize:15e6};class YE{constructor(e){Ze(this,"_str");Ze(this,"_rawJson");Ze(this,"_zodSchema");Ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Zr=class Zr{constructor(e){Ze(this,"fileDataCache");Ze(this,"fileDataRefs",new Map);const n={...KE,...e??{}};this.fileDataCache=new Nl({maxSize:n.cacheSize,fetchMethod:async i=>new YE(await _g().blobDriver.getContent(i)),sizeCalculation:i=>i.bytes.length,dispose:(i,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const i=r.shallowRef();return this.fileDataRefs.set(e,i),(async()=>{try{const s=await this.fileDataCache.fetch(e);i.value=s}catch(s){console.error(s)}})(),i}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n.value)==null?void 0:i.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n==null?void 0:n.value)==null?void 0:i.str})}getContentJson(e,n){if(e===void 0)return;const i=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=i==null?void 0:i.value)==null?void 0:s.rawJson:(l=i==null?void 0:i.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Zr.globalInstance.getContentBytes(e)}static getContentString(e){return Zr.globalInstance.getContentString(e)}static getContentJson(e,n){return Zr.globalInstance.getContentJson(e,n)}};Ze(Zr,"globalInstance",new Zr);let Pl=Zr;R.AgGridTheme=Kd,R.BlockLayout=yE,R.ContextProvider=nk,R.DataTable=F_,R.DemoData=rE,R.DropdownListItem=oo,R.LongText=vl,R.MultiError=Va,R.PlAgCellFile=$E,R.PlAgDataTable=IE,R.PlAgOverlayLoading=Qu,R.PlAgOverlayNoRows=ep,R.PlAlert=uC,R.PlBlockPage=J_,R.PlBtnAccent=gC,R.PlBtnDanger=vC,R.PlBtnGhost=pl,R.PlBtnGroup=GC,R.PlBtnLink=bC,R.PlBtnPrimary=dl,R.PlBtnSecondary=ul,R.PlCheckbox=Au,R.PlCheckboxGroup=Z0,R.PlChip=_l,R.PlContainer=Q_,R.PlCopyData=Ku,R.PlDialogModal=wl,R.PlDropdown=so,R.PlDropdownLegacy=u0,R.PlDropdownLine=Vu,R.PlDropdownMulti=I0,R.PlDropdownRef=Gw,R.PlFileDialog=Pu,R.PlFileInput=ju,R.PlGrid=oC,R.PlIcon16=hs,R.PlIcon24=Su,R.PlLogView=gb,R.PlMaskIcon16=to,R.PlMaskIcon24=Ln,R.PlNotificationAlert=qu,R.PlNumberField=ms,R.PlProgressBar=g0,R.PlRow=tC,R.PlSlideModal=nb,R.PlSpacer=vu,R.PlTableFilters=OE,R.PlTabs=kb,R.PlTextArea=yw,R.PlTextField=fs,R.PlToggleSwitch=gs,R.PlTooltip=Nt,R.ReactiveFileContent=Pl,R.Scrollable=Hk,R.Slider=Yu,R.SliderRange=Zk,R.SliderRangeTriple=Ak,R.ThemeSwitcher=$_,R.UnresolvedError=Ba,R.ValueOrErrorsComponent=ZE,R.activateAgGrid=qd,R.animate=pu,R.animateInfinite=O_,R.call=au,R.computedResult=jE,R.createModel=Ra,R.debounce=hu,R.defineApp=cv,R.defineStore=HE,R.delay=lu,R.detectOutside=vw,R.ensureError=Pa,R.eventListener=gl,R.formatZodError=Fa,R.getElementScrollPosition=Tu,R.identity=Na,R.isDefined=cm,R.isElementVisible=Eu,R.isJsonEqual=Aa,R.isZodError=Da,R.listToOptions=G_,R.makeEaseInOut=L_,R.makeEaseOut=uu,R.maskIcons16=tE,R.maskIcons24=nE,R.normalizeListOptions=Rr,R.notEmpty=ol,R.randomInt=du,R.randomString=I_,R.requestTick=sl,R.scrollIntoView=io,R.showContextMenu=nl,R.throttle=fu,R.timeout=cu,R.unwrapOptionalResult=lm,R.unwrapValueOrErrors=cd,R.useClickOutside=ps,R.useDraggable=_k,R.useEventListener=tt,R.useFormState=yk,R.useHover=ou,R.useInterval=gk,R.useLabelNotch=In,R.useLocalStorage=mu,R.useMouse=iu,R.useMouseCapture=sr,R.usePosition=no,R.useQuery=vk,R.useResizeObserver=Ju,R.useScroll=hk,R.useSdkPlugin=Xa,R.useSortable=mk,R.useTheme=yu,R.useWatchFetch=sp,R.wrapOptionalResult=dd,R.wrapValueOrErrors=am,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|