@platforma-sdk/ui-vue 1.7.3 → 1.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.umd.cjs CHANGED
@@ -1,249 +1,47 @@
1
- (function(W,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(W=typeof globalThis<"u"?globalThis:W||self,l(W.SdkVueLib={},W.Vue))})(this,function(W,l){"use strict";var j5=Object.defineProperty;var gy=W=>{throw TypeError(W)};var Z5=(W,l,ft)=>l in W?j5(W,l,{enumerable:!0,configurable:!0,writable:!0,value:ft}):W[l]=ft;var Ye=(W,l,ft)=>Z5(W,typeof l!="symbol"?l+"":l,ft),dg=(W,l,ft)=>l.has(W)||gy("Cannot "+ft);var P=(W,l,ft)=>(dg(W,l,"read from private field"),ft?ft.call(W):l.get(W)),je=(W,l,ft)=>l.has(W)?gy("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(W):l.set(W,ft),we=(W,l,ft,wo)=>(dg(W,l,"write to private field"),wo?wo.call(W,ft):l.set(W,ft),ft),de=(W,l,ft)=>(dg(W,l,"access private method"),ft);var ld=(W,l,ft,wo)=>({set _(Bi){we(W,l,Bi,ft)},get _(){return P(W,l,wo)}});var Lv,Xo,_v,Ov,Qi,gi,Xi,Ji,Jo,er,St,es,wt,nt,xe,qt,fi,Bt,xt,ts,Pt,is,ss,mi,ns,Sn,Yt,te,pg,so,Ns,Dl,Ci,Fy,no,tr,Tl,kn,In,gg,cd,dd,rt,fg,Jl,Ln,mg;function ft(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function wo(e){return e!==null&&typeof e=="object"}function Bi(e){if(Array.isArray(e)){const t=[];for(let i=0;i<e.length;i++)t[i]=Bi(e[i]);return t}else if(wo(e)){const t={};return Object.keys(e).forEach(i=>{t[i]=Bi(e[i])}),t}else return e}function ud(e,t,i=!0){let s=0,n;return function(...o){n=()=>{e.apply(this,o),s=new Date().getTime()+t,n=null,i&&setTimeout(()=>{n&&n()},t)},new Date().getTime()>s&&n()}}function Ey(e){let t=0n,i;return async function(...s){const n=++t;try{await i}catch{}if(t!==n)return{ok:!1};const o=e(...s);return i=o,{ok:!0,value:await o}}}var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Py=function e(t){if(typeof t=="number"&&isNaN(t))throw new Error("NaN is not allowed");if(typeof t=="number"&&!isFinite(t))throw new Error("Infinity is not allowed");return t===null||typeof t!="object"?JSON.stringify(t):t.toJSON instanceof Function?e(t.toJSON()):Array.isArray(t)?`[${t.reduce((n,o,r)=>`${n}${r===0?"":","}${e(o===void 0||typeof o=="symbol"?null:o)}`,"")}]`:`{${Object.keys(t).sort().reduce((s,n)=>{if(t[n]===void 0||typeof t[n]=="symbol")return s;const o=s.length===0?"":",";return`${s}${o}${e(n)}:${e(t[n])}`},"")}}`};const wr=xy(Py);class hd extends Error{}class pd extends Error{constructor(t){super(),this.errors=t}toString(){return this.errors.join(",")}}function Dy(e){return{ok:!0,value:e}}function Cg(e){if(!e)throw new hd;if(!e.ok)throw Error(e.errors.join(";"));return e.value}function vg(e){return{value:e,errors:void 0}}function Ty(e){if(e.errors)throw new pd(e.errors);if(!e.value)throw new hd;return e.value}function Ay(e){return e!==void 0}function gd(e,t){return wr(e)===wr(t)}const fd=e=>e,md=e=>e instanceof Error?e:Error(String(e)),Cd=e=>e.name==="ZodError",vd=e=>{const{formErrors:t,fieldErrors:i}=e.flatten(),s=Object.entries(i).map(([n,o])=>n+":"+(o==null?void 0:o.join(",")));return t.concat(s).join("; ")};function wd(e){const t=e.validate??fd,{autoSave:i}=e,s=l.ref(),n=l.ref(),o=w=>{n.value={model:Bi(w)}};l.watch(()=>e.get(),w=>o(w),{immediate:!0});const r=()=>{var w;e.onSave(t(Bi((w=n.value)==null?void 0:w.model)))},a=()=>{o(e.get()),s.value=void 0},d=w=>{const S=md(w);Cd(S)?s.value=Error(vd(S)):s.value=S},h=w=>{s.value=void 0;try{t(w),i&&r()}catch(S){d(S)}},p=l.computed({get:()=>{var w;return(w=n.value)==null?void 0:w.model},set(w){o(w),h(w)}});l.watch(n,(w,S)=>{w&&w===S&&h(w.model)},{deep:!0});const f=l.computed(()=>!s.value),m=l.computed(()=>!gd(e.get(),l.unref(n))),v=l.computed(()=>s.value?s.value.message:"");return l.reactive({model:p,valid:f,isChanged:m,error:s,errorString:v,save:r,revert:a,setError:d})}function My(e,t){const i=e.validate??fd,{autoSave:s}=e,n=l.ref(),o=l.ref(),r=S=>{o.value={model:Object.assign(Bi(S),t??{}),stage:Symbol()}};l.watch(()=>e.get(),S=>r(S),{immediate:!0});const a=()=>{var S;e.onSave(i(Bi((S=o.value)==null?void 0:S.model)))},d=()=>{r(e.get()),n.value=void 0},h=S=>{const b=md(S);Cd(b)?n.value=Error(vd(b)):n.value=b},p=S=>{n.value=void 0;try{i(S),s&&a()}catch(b){h(b)}},f=l.computed({get:()=>{var S;return(S=o.value)==null?void 0:S.model},set(){throw Error("Cannot replace base model")}});l.watch([()=>({args:f.value.args,ui:f.value.ui}),()=>{var S;return(S=o.value)==null?void 0:S.stage}],([S,b],[R,x])=>{b===x&&p(S)},{deep:!0});const m=l.computed(()=>!n.value),v=l.computed(()=>!gd(e.get(),l.unref(o))),w=l.computed(()=>n.value?n.value.message:"");return l.reactive({model:f,valid:m,isChanged:v,error:n,errorString:w,save:a,revert:d,setError:h})}const ky=e=>Object.fromEntries(new URL(e,"http://dummy").searchParams);function Iy(e,t){const s=ud(t.setBlockArgs,100),n=ud(t.setBlockUiState,100),o=ud(t.setBlockArgsAndUiState,100),r=l.reactive({args:Object.freeze(e.args),outputs:Object.freeze(e.outputs),ui:Object.freeze(e.ui),navigationState:Object.freeze(e.navigationState)});t.onStateUpdates(async S=>{S.forEach(b=>{b.key==="args"&&(r.args=Object.freeze(b.value)),b.key==="ui"&&(r.ui=Object.freeze(b.value)),b.key==="outputs"&&(r.outputs=Object.freeze(b.value)),b.key==="navigationState"&&(r.navigationState=Object.freeze(b.value))}),await l.nextTick()});const a=()=>Bi(r.args),d=()=>Bi(r.ui),h=()=>Bi(r.navigationState),p={createArgsModel(S={}){return wd({get(){return S.transform?S.transform(r.args):r.args},validate:S.validate,autoSave:!0,onSave(b){s(b)}})},createUiModel(S={},b){return wd({get(){return S.transform?S.transform(r.ui):r.ui??b()},validate:S.validate,autoSave:!0,onSave(R){n(R)}})},useOutputs(...S){const b=l.reactive({errors:void 0,value:void 0});return l.watch(()=>r.outputs,()=>{try{Object.assign(b,{value:this.unwrapOutputs(...S),errors:void 0})}catch(R){Object.assign(b,{value:void 0,errors:[String(R)]})}},{immediate:!0,deep:!0}),b},unwrapOutputs(...S){const b=r.outputs,R=S.map(x=>[x,Cg(b[x])]);return Object.fromEntries(R)},getOutputField(S){return r.outputs[S]},getOutputFieldOkOptional(S){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const b=this.getOutputField(S);if(b&&b.ok)return b.value},getOutputFieldErrorsOptional(S){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const b=this.getOutputField(S);if(b&&!b.ok)return b.errors},updateArgs(S){const b=a();return S(b),t.setBlockArgs(b)},updateUiState(S){const b=d();return t.setBlockUiState(S(b))},updateNavigationState(S){const b=h();return S(b),t.setNavigationState(b)},navigateTo(S){const b=h();return b.href=S,t.setNavigationState(b)}},f=l.computed(()=>{const S=Object.entries(r.outputs).map(([b,R])=>[b,R.ok&&R.value!==void 0?R.value:void 0]);return Object.fromEntries(S)}),m=l.computed(()=>{const S=Object.entries(r.outputs).map(([b,R])=>[b,R&&!R.ok?new pd(R.errors):void 0]);return Object.fromEntries(S)}),v={snapshot:r,queryParams:l.computed(()=>ky(r.navigationState.href)),href:l.computed(()=>r.navigationState.href),hasErrors:l.computed(()=>Object.values(r.outputs).some(S=>!(S!=null&&S.ok))),outputValues:l.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),f.value)),outputErrors:l.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),m.value)),args:l.computed(()=>(console.warn("Change app.args to app.snapshot.args"),r.args)),outputs:l.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),r.outputs)),ui:l.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),r.ui)),navigationState:l.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),r.navigationState))},w=My({get(){return{args:r.args,ui:r.ui}},autoSave:!0,onSave(S){o(S.args,S.ui)}},{outputs:f,outputErrors:m});return l.reactive(Object.assign(w,p,v))}var So=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let n=s.get(e);return!n&&i&&(n=new Set,s.set(e,n)),n}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const s=(a,d)=>a.forEach(h=>{if(!d.has(h))return;const p=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>h(e)):()=>h(e);t?this.dispatchAsync(p):p()}),n=this.getListeners(i,t,!1)??new Set,o=new Set(n);o.size>0&&s(o,n),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const d=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(i,e)):()=>a(i,e);t?this.dispatchAsync(d):d()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}},Rt=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(Rt||{}),wg={};function Sd(e,t){wg[t]||(e(),wg[t]=!0)}function Fi(e,...t){console.log("AG Grid: "+e,...t)}function z(e,...t){Sd(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function We(e,...t){Sd(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function yd(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Ly(e){_y(e,400)}var bd=[],Rd=!1;function Sg(e){bd.push(e),!Rd&&(Rd=!0,window.setTimeout(()=>{const t=bd.slice();bd.length=0,Rd=!1,t.forEach(i=>i())},0))}function _y(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function Wt(e,t){let i;return function(...s){const n=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(n,s)},t)}}function yg(e,t){let i=0;return function(...s){const n=this,o=new Date().getTime();o-i<t||(i=o,e.apply(n,s))}}function Oy(e,t,i=100,s){const n=new Date().getTime();let o=null,r=!1;const a=()=>{const d=new Date().getTime()-n>i;(e()||d)&&(t(),r=!0,o!=null&&(window.clearInterval(o),o=null),d&&s&&z(s))};a(),r||(o=window.setInterval(a,10))}function Vy(...e){return t=>e.reduce((i,s)=>s(i),t)}function Gi(e){return e==null||e===""?null:e}function q(e,t=!1){return e!=null&&(e!==""||t)}function Ve(e){return!q(e)}function Tt(e){return e==null||e.length===0}function ea(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function _n(e){if(e===void 0)return;if(e===null||e==="")return null;if(typeof e=="number")return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Fd(e){if(e!==void 0)return e===null||e===""?!1:Ed(e)}function Ed(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function Sr(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function Ny(e,t,i=!1){const s=e==null,n=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&n)return 0;if(s)return-1;if(n)return 1;function o(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!i)return o(e,t);try{return e.localeCompare(t)}catch{return o(e,t)}}function ta(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}function bg(e,t){return e.get("rowModelType")===t}function st(e){return bg(e,"clientSide")}function xs(e){return bg(e,"serverSide")}function Ft(e,t){return e.get("domLayout")===t}function ia(e){return la(e)!==void 0}function sa(e){return!e.get("suppressAsyncEvents")}function Rg(e){return typeof e.get("getRowHeight")=="function"}function By(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function qs(e,t,i=!1,s){if(s==null&&(s=e.environment.getDefaultRowHeight()),Rg(e)){if(i)return{height:s,estimated:!0};const r={node:t,data:t.data},a=e.getCallback("getRowHeight")(r);if(xd(a))return a===0&&z("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,a),estimated:!1}}if(t.detail&&e.get("masterDetail"))return Gy(e);const n=e.get("rowHeight");return{height:n&&xd(n)?n:s,estimated:!1}}function Gy(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return xd(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function On(e){const{environment:t}=e,i=e.get("rowHeight");if(!i||Ve(i))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(z("row height must be a number if not using standard row model"),t.getDefaultRowHeight())}function xd(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function yr(e,t,i){const s=t[e.getDomDataKey()];return s?s[i]:void 0}function Vn(e,t,i,s){const n=e.getDomDataKey();let o=t[n];Ve(o)&&(o={},t[n]=o),o[i]=s}function lt(e){let t=null;const i=e.get("getDocument");return i&&q(i)?t=i():e.eGridDiv&&(t=e.eGridDiv.ownerDocument),t&&q(t)?t:document}function Fg(e){return lt(e).defaultView||window}function br(e){return e.eGridDiv.getRootNode()}function Je(e){return br(e).activeElement}function Eg(e){const t=lt(e),i=Je(e);return i===null||i===t.body}function yo(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function na(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Ft(e,"print"))}function us(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function Pd(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function xg(e){const t=e.get("grandTotalRow");if(t)return t;if(e.get("groupIncludeTotalFooter"))return"bottom"}function Pg(e){const t=e.get("groupTotalRow");if(typeof t=="function")return e.getCallback("groupTotalRow");if(t)return()=>t;const i=e.get("groupIncludeFooter");if(typeof i=="function"){const s=e.getCallback("groupIncludeFooter");return n=>s(n)?"bottom":void 0}return()=>i?"bottom":void 0}function Dg(e){return e.exists("groupDisplayType")?e.get("groupDisplayType")==="multipleColumns":e.get("groupHideOpenParents")}function oa(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function bo(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(z("The getRowId callback must return a string. The ID ",s," is being cast to a string."),s=String(s)),s}}function Ro(e){return(e==null?void 0:e.checkboxes)??!0}function ra(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function Hy(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function Wy(e){return typeof e.get("rowSelection")!="string"}function Tg(e){return e.get("cellSelection")!==void 0}function Rr(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?(t==null?void 0:t.suppressMultiRanges)??!1:!1:e.get("suppressMultiRangeSelection")}function ei(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function zy(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?((s=t.handle)==null?void 0:s.mode)==="range":!1:e.get("enableRangeHandle")}function Ag(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?((s=t.handle)==null?void 0:s.mode)==="fill":!1:e.get("enableFillHandle")}function Dd(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&((s=t.handle)==null?void 0:s.mode)==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function Mg(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const i=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return i&&s?!1:i?"enableDeselection":s?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function Uy(e){const t=Mg(e);return t===!0||t==="enableSelection"}function Td(e){const t=Mg(e);return t===!0||t==="enableDeselection"}function Ad(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function la(e){const t=e.get("rowSelection");if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}return t==null?void 0:t.mode}function Md(e){return la(e)==="multiRow"}function $y(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function kd(e){const t=e.get("rowSelection");if(typeof t=="string"){const i=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return i&&s?"filteredDescendants":i?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function Nn(e){const t=kd(e);return t==="descendants"||t==="filteredDescendants"}function Id(e){return e.isModuleRegistered("@ag-grid-enterprise/set-filter")&&!e.get("suppressSetFilterByDefault")}function Ky(e){return e!=null&&e.length>0}function he(e){if(!(!e||!e.length))return e[e.length-1]}function hs(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,n)=>i?i(s,t[n]):t[n]===s)}function jy(e,t){return hs(e,t)}function Zy(e){return e.sort((t,i)=>t-i)}function kg(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function kt(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function qy(e,t){for(let i=0;i<t.length;i++)kg(e,t[i])}function Yy(e,t){for(let i=0;i<t.length;i++)kt(e,t[i])}function aa(e,t,i){e.splice(i,0,t)}function Ig(e,t,i){Yy(e,t),t.slice().reverse().forEach(s=>aa(e,s,i))}function Ps(e,t){return e.indexOf(t)>-1}function Qy(e){return(e==null?void 0:e.flatMap(t=>t))??[]}function Lg(e,t){t==null||e==null||t.forEach(i=>e.push(i))}var _g="__ag_Grid_Stop_Propagation",Xy=["touchstart","touchend","touchmove","touchcancel","scroll"],Ld={};function Fo(e){e[_g]=!0}function Ds(e){return e[_g]===!0}var Og=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof Ld[i]=="boolean")return Ld[i];const s=document.createElement(e[i]||"div");return i="on"+i,Ld[i]=i in s}})();function ca(e,t,i){let s=t;for(;s;){const n=yr(e,s,i);if(n)return n;s=s.parentElement}return null}function Jy(e,t){return!t||!e?!1:tb(t).indexOf(e)>=0}function eb(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function tb(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():eb(t)}function ib(e,t,i,s){const o=Ps(Xy,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,o)}var G=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,i){this.localEventService||(this.localEventService=new So),this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService&&this.localEventService.removeEventListener(e,t,i)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const n=t[s];n&&i.push(this._setupListener(e,s,n))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?ib(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(n=>n!==s),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=n=>{if(n.changeSet){if(n.changeSet&&n.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=n.changeSet.id}const o={type:"gridPropertyChanged",changeSet:n.changeSet,source:n.source};t(o)};e.forEach(n=>this.setupGridOptionListener(n,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function zt(e){return e instanceof da}var da=class extends G{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=Bg(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{Xs(t)?e.push(t):zt(t)&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let o=0,r=s.length;o<r;o++){const a=s[o];if(!a.isVisible())continue;const d=a.getColumnGroupShow();d==="open"?(e=!0,i=!0):d==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const n=e&&t&&i;this.expandable!==n&&(this.expandable=n,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{zt(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Vg="ag-Grid-ControlsColumn",sb=class extends G{constructor(){super(...arguments),this.beanName="controlsColService"}createControlsCols(){const e=this.gos.get("rowSelection");if(!e||typeof e=="string")return[];const t=Ro(e),i=ra(e);if(t||i){const s=this.gos.get("selectionColumnDef"),o={maxWidth:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:this.gos.get("enableRtl")?"right":"left",comparator(a,d,h,p){const f=h.isSelected(),m=p.isSelected();return f&&m?0:f?1:-1},editable:!1,suppressFillHandle:!0,...s,colId:`${Vg}`},r=new Hd(o,null,o.colId,!1);return this.createBean(r),[r]}return[]}},ua="ag-Grid-AutoColumn";function _d(e){const t=[],i=s=>{for(let n=0;n<s.length;n++){const o=s[n];Xs(o)?t.push(o):zt(o)&&i(o.getChildren())}};return i(e),t}function Ts(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function Ys(e,t,i){const s={};if(!t)return;As(null,t,o=>{s[o.getInstanceId()]=o}),i&&As(null,i,o=>{s[o.getInstanceId()]=null});const n=Object.values(s).filter(o=>o!=null);e.destroyBeans(n)}function Od(e){return e.getId().startsWith(ua)}function Eo(e){return e.getColId().startsWith(Vg)}function ha(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?z("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):z("colDef.type should be of type 'string' | 'string[]'"),t}var Vd=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}},Nd=new Set(["__proto__","constructor","prototype"]);function Ei(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))t(i,s)}}function Ng(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(Nd.has(i[s]))continue;const n=i[s],o=e[n];t[n]=o}return t}function Bd(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(n=>{if(t&&t.indexOf(n)>=0||Nd.has(n))return;const o=i[n];Gd(o)&&o.constructor===Object?s[n]=Bd(o):s[n]=o}),s}function Qs(e){if(!e)return[];const t=Object;if(typeof t.values=="function")return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function Ut(e,t,i=!0,s=!1){q(t)&&Ei(t,(n,o)=>{if(Nd.has(n))return;let r=e[n];r!==o&&(s&&r==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(r={},e[n]=r),Gd(o)&&Gd(r)&&!Array.isArray(r)?Ut(r,o,i,s):(i||o!==void 0)&&(e[n]=o))})}function Fr(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let n=e;for(let o=0;o<s.length;o++){if(n==null)return;n=n[s[o]]}return n}function Gd(e){return typeof e=="object"&&e!==null}var nb={resizable:!0,sortable:!0},ob=0;function Bg(){return ob++}function Xs(e){return e instanceof Hd}var Hd=class extends G{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=Bg(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new So,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=e.hide,n=e.initialHide;s!==void 0?this.visible=!s:this.visible=!n,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const o=e.flex,r=e.initialFlex;o!==void 0?this.flex=o:r!==void 0&&(this.flex=r)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=q(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=q(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.gos.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=q(this.colDef.tooltipField)||q(this.colDef.tooltipValueGetter)||q(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=_n(e.width),s=_n(e.initialWidth);return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(Ve(this.colDef)||Ve(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}addEventListener(e,t){var s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new Vd(this.frameworkOverrides));const i=((s=this.frameworkEventListenerService)==null?void 0:s.wrap(t))??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){var s;const i=((s=this.frameworkEventListenerService)==null?void 0:s.unwrap(t))??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){if(e.group){if(this.gos.get("treeData")){if(!e.data&&!this.gos.get("enableGroupEdit"))return!1}else if(!this.gos.get("enableGroupEdit"))return!1}return this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){const t=this.gos.get("rowSelection");if(t&&typeof t!="string"){const i=Eo(this)&&Ro(t);return this.isColumnFunc(e,i)}else return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??nb[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setHighlighted(e){this.highlighted!==e&&(this.highlighted=e,this.columnEventService.dispatchEvent(this.createColumnEvent("headerHighlightChanged","uiColumnMoved")))}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return Ve(this.sort)}isSorting(){return q(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&Ut(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(Ve(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(Ve(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}},rb={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},lb=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=ea(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},ab=class extends G{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const n=new lb,{existingCols:o,existingGroups:r,existingColKeys:a}=this.extractExistingTreeData(i);n.addExistingKeys(a);const d=this.recursivelyCreateColumns(e,0,t,o,n,r,s),h=this.findMaxDept(d,0),p=this.balanceColumnTree(d,0,h,n);return As(null,p,(m,v)=>{zt(m)&&m.setupExpandable(),m.setOriginalParent(v)}),{columnTree:p,treeDept:h}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&As(null,e,n=>{if(zt(n)){const o=n;i.push(o)}else{const o=n;s.push(o.getId()),t.push(o)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}balanceTreeForAutoCols(e,t){const i=[],s=this.findDepth(t);return e.forEach(n=>{let o=n;for(let r=s-1;r>=0;r--){const a=new da(null,`FAKE_PATH_${n.getId()}}_${r}`,!0,r);this.createBean(a),a.setChildren([o]),o.setOriginalParent(a),o=a}s===0&&n.setOriginalParent(null),i.push(o)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&zt(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const n=[];for(let o=0;o<e.length;o++){const r=e[o];if(zt(r)){const a=r,d=this.balanceColumnTree(a.getChildren(),t+1,i,s);a.setChildren(d),n.push(a)}else{let a,d;for(let h=i-1;h>=t;h--){const p=s.getUniqueKey(null,null),f=this.createMergedColGroupDef(null),m=new da(f,p,!0,t);this.createBean(m),d&&d.setChildren([m]),d=m,a||(a=d)}if(a&&d)if(n.push(a),e.some(p=>zt(p))){d.setChildren([r]);continue}else{d.setChildren(e);break}n.push(r)}}return n}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const n=e[s];if(zt(n)){const o=n,r=this.findMaxDept(o.getChildren(),t+1);i<r&&(i=r)}}return i}recursivelyCreateColumns(e,t,i,s,n,o,r){if(!e)return[];const a=new Array(e.length);for(let d=0;d<a.length;d++){const h=e[d];this.isColumnGroup(h)?a[d]=this.createColumnGroup(i,h,t,s,n,o,r):a[d]=this.createColumn(i,h,s,n,r)}return a}createColumnGroup(e,t,i,s,n,o,r){const a=this.createMergedColGroupDef(t),d=n.getUniqueKey(a.groupId||null,null),h=new da(a,d,!1,i);this.createBean(h);const p=this.findExistingGroup(t,o);p&&o.splice(p.idx,1);const f=p==null?void 0:p.group;f&&h.setExpanded(f.isExpanded());const m=this.recursivelyCreateColumns(a.children,i+1,e,s,n,o,r);return h.setChildren(m),h}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,n){var a;const o=this.findExistingColumn(t,i);o&&(i==null||i.splice(o.idx,1));let r=o==null?void 0:o.column;if(r){const d=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(d,t,n),this.applyColumnState(r,d,n)}else{const d=s.getUniqueKey(t.colId,t.field),h=this.addColumnDefaultAndTypes(t,d);r=new Hd(h,t,d,e),this.createBean(r)}return(a=this.dataTypeService)==null||a.addColumnListeners(r),r}applyColumnState(e,t,i){const s=_n(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const a=_n(t.width);if(a!=null)e.setActualWidth(a,i);else{const d=e.getActualWidth();e.setActualWidth(d,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const o=_n(t.sortIndex);o!==void 0&&e.setSortIndex(o);const r=Fd(t.hide);r!==void 0&&e.setVisible(!r,i),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let s=0;s<t.length;s++){const n=t[s];if(n.getColGroupDef()&&n.getId()===e.groupId)return{idx:s,group:n}}}addColumnDefaultAndTypes(e,t){var a;const i={},s=this.gos.get("defaultColDef");Ut(i,s,!1,!0);const n=this.updateColDefAndGetColumnType(i,e,t);n&&this.assignColumnTypes(n,i),Ut(i,e,!1,!0);const o=this.gos.get("autoGroupColumnDef"),r=us(this.gos);return e.rowGroup&&o&&r&&Ut(i,{sort:o.sort,initialSort:o.initialSort},!1,!0),(a=this.dataTypeService)==null||a.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){var o;const s=(o=this.dataTypeService)==null?void 0:o.updateColDefAndGetColumnType(e,t,i),n=t.type??s??e.type;return e.type=n,n?ha(n):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},rb),s=this.gos.get("columnTypes")||{};Ei(s,(n,o)=>{n in i?z(`the column type '${n}' is a default column type and cannot be overridden.`):(o.type&&z("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[n]=o)}),e.forEach(n=>{const o=i[n.trim()];o?Ut(t,o,!1,!0):z("colDef.type '"+n+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function As(e,t,i){if(t)for(let s=0;s<t.length;s++){const n=t[s];zt(n)&&As(n,n.getChildren(),i),i(n,e)}}var cb=class extends G{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.ctrlsService=e.ctrlsService,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.controlsColService=e.controlsColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.refreshAll(Bn(t.source))),this.addManagedPropertyListener("rowSelection",t=>{this.onSelectionOptionsChanged(t.currentValue,t.previousValue,Bn(t.source))}),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(Bn(t.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(Bn(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),Bn(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e){var h,p,f;const t=this.colDefs?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire();const i=(h=this.colDefCols)==null?void 0:h.list,s=(p=this.colDefCols)==null?void 0:p.tree,n=this.columnFactory.createColumnTree(this.colDefs,!0,s,e);Ys(this.context,(f=this.colDefCols)==null?void 0:f.tree,n.columnTree);const o=n.columnTree,r=n.treeDept,a=_d(o),d={};a.forEach(m=>d[m.getId()]=m),this.colDefCols={tree:o,treeDepth:r,list:a,map:d},this.funcColsService.extractCols(e,i),this.ready=!0,this.refreshCols(!0),this.visibleColsService.refresh(e),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(e),t&&(this.changeEventsDispatching=!0,t(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(e),e==="gridInitializing"&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(e){var n,o,r;if(!this.colDefCols)return;const t=(n=this.cols)==null?void 0:n.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.createControlsCols(),this.addControlsCols();const i=By(this.gos,this.showingPivotResult);(!e||i)&&this.restoreColOrder(),this.positionLockedCols(),(o=this.showRowGroupColsService)==null||o.refresh(),(r=this.quickFilterService)==null||r.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!hs(t,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=e!=null,e){const{map:t,list:i,tree:s,treeDepth:n}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:n},e.list.some(r=>{var a;return((a=this.cols)==null?void 0:a.map[r.getColId()])!==void 0})||(this.lastPivotOrder=null)}else{const{map:t,list:i,tree:s,treeDepth:n}=this.colDefCols;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:n}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter(s=>{const n=Od(s);if(e){const o=t&&Ps(t,s);return n||o}else return n||s.isVisible()})}addAutoCols(){this.autoCols!=null&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),Gg(this.cols))}createAutoCols(){var w,S;const e=oa(this.gos,this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),n=!(i.length>0||this.gos.get("treeData"))||t||e,o=()=>{this.autoCols&&(Ys(this.context,this.autoCols.tree),this.autoCols=null)};if(n||!this.autoColService){o();return}const r=this.autoColService.createAutoCols(i)??[],a=db(r,((w=this.autoCols)==null?void 0:w.list)||null),d=this.cols.treeDepth,p=(this.autoCols?this.autoCols.treeDepth:-1)==d;if(a&&p)return;o();const[f,m]=this.columnFactory.balanceTreeForAutoCols(r,(S=this.cols)==null?void 0:S.tree);this.autoCols={list:r,tree:f,treeDepth:m,map:{}};const v=b=>{if(!b)return null;const R=b.filter(x=>!Od(x));return[...r,...R]};this.lastOrder=v(this.lastOrder),this.lastPivotOrder=v(this.lastPivotOrder)}createControlsCols(){var n,o,r,a;Ys(this.context,(n=this.controlsCols)==null?void 0:n.tree),this.controlsCols=null;const e=((o=this.controlsColService)==null?void 0:o.createControlsCols())??[],[t,i]=this.columnFactory.balanceTreeForAutoCols(e,this.cols.tree);this.controlsCols={list:e,tree:t,treeDepth:i,map:{}};function s(d,h){const p=Eo(d),f=Eo(h);return p&&!f?-1:!p&&f?1:0}(r=this.lastOrder)==null||r.sort(s),(a=this.lastPivotOrder)==null||a.sort(s)}addControlsCols(){this.controlsCols!=null&&(this.cols.list=this.controlsCols.list.concat(this.cols.list),this.cols.tree=this.controlsCols.tree.concat(this.cols.tree),Gg(this.cols))}refreshAll(e){this.isReady()&&(this.refreshCols(!1),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColsPinned(e,t,i){if(!this.cols||Tt(e))return;if(Ft(this.gos,"print")){z("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;t===!0||t==="left"?s="left":t==="right"?s="right":s=null;const n=[];e.forEach(o=>{if(!o)return;const r=this.getCol(o);r&&r.getPinned()!==s&&(r.setPinned(s),n.push(r))}),n.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(n,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;zt(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){var i;let t=null;return As(null,(i=this.cols)==null?void 0:i.tree,s=>{zt(s)&&s.getId()===e&&(t=s)}),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const s=this.funcColsService.getRowGroupColumns().findIndex(n=>n.getColId()===e.getColId());return t>s}isSuppressAutoCol(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}setAutoHeightActive(){this.autoHeightActive=this.cols.list.some(e=>e.isVisible()&&e.isAutoHeight()),this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,st(this.gos)||xs(this.gos)||z("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map((d,h)=>[d,h]));if(!this.cols.list.some(d=>t.has(d)))return;const s=new Map(this.cols.list.map(d=>[d,!0])),n=e.filter(d=>s.has(d)),o=new Map(n.map(d=>[d,!0])),r=this.cols.list.filter(d=>!o.has(d)),a=n.slice();r.forEach(d=>{let h=d.getOriginalParent();if(!h){a.push(d);return}const p=[];for(;!p.length&&h;)h.getLeafColumns().forEach(w=>{const S=a.indexOf(w)>=0,b=p.indexOf(w)<0;S&&b&&p.push(w)}),h=h.getOriginalParent();if(!p.length){a.push(d);return}const f=p.map(v=>a.indexOf(v)),m=Math.max(...f);aa(a,d,m+1)}),this.cols.list=a}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(n=>{if(i[n])return;const o=this.cols.map[n];o&&(t.push(o),i[n]=!0)});let s=0;if(this.cols.list.forEach(n=>{const o=n.getColId();if(i[o]!=null)return;o.startsWith(ua)?aa(t,n,s++):t.push(n)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){z("Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.cols.list=t}sortColsLikeCols(e){!e||e.length<=1||e.filter(i=>this.cols.list.indexOf(i)<0).length>0||e.sort((i,s)=>{const n=this.cols.list.indexOf(i),o=this.cols.list.indexOf(s);return n-o})}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){var s;Ig((s=this.cols)==null?void 0:s.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=(e=this.cols)==null?void 0:e.list:this.lastOrder=(t=this.cols)==null?void 0:t.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort((s,n)=>this.lastOrder.indexOf(s)-this.lastOrder.indexOf(n)):this.lastOrder&&e.sort((s,n)=>this.cols.list.indexOf(s)-this.cols.list.indexOf(n));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){var e;return((e=this.colDefCols)==null?void 0:e.treeDepth)>0}setColSpanActive(){this.colSpanActive=this.cols.list.some(e=>e.getColDef().colSpan!=null)}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=e,this.ready&&(this.refreshCols(!1),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return e&&this.gos.get("treeData")?(z("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!Tt(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(e))}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e,t,i;Ys(this.context,(e=this.colDefCols)==null?void 0:e.tree),Ys(this.context,(t=this.autoCols)==null?void 0:t.tree),Ys(this.context,(i=this.controlsCols)==null?void 0:i.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){var e;return(e=this.colDefCols)!=null&&e.list?this.colDefCols.list:null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}getAllCols(){var i,s,n;const e=this.pivotResultColsService.getPivotResultCols(),t=e==null?void 0:e.list;return[((i=this.colDefCols)==null?void 0:i.list)??[],((s=this.autoCols)==null?void 0:s.list)??[],((n=this.controlsCols)==null?void 0:n.list)??[],t??[]].flat()}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(t==null)return null;const{map:i,list:s}=t;if(typeof e=="string"&&i[e])return i[e];for(let n=0;n<s.length;n++)if(Hg(s[n],e))return s[n];return this.getAutoCol(e)}getAutoCol(e){var t;return((t=this.autoCols)==null?void 0:t.list.find(i=>Hg(i,e)))??null}getAutoCols(){var e;return((e=this.autoCols)==null?void 0:e.list)??null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&(e.isColumn?this.eventDispatcher.headerHeight(e):this.eventDispatcher.groupHeaderHeight(e))}getGroupRowsHeight(){const e=[],t=this.ctrlsService.getHeaderRowContainerCtrls();for(const i of t){if(!i)continue;const s=i.getGroupRowCount()||0;for(let n=0;n<s;n++){const o=i.getGroupRowCtrlAtIndex(n),r=e[n];if(o){const a=this.getColumnGroupHeaderRowHeight(o);(r==null||a>r)&&(e[n]=a)}}}return e}getColumnGroupHeaderRowHeight(e){const t=this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight();let i=0;const s=e.getHeaderCtrls();for(const n of s){const o=n.getColumn();if(o.isAutoHeaderHeight()){const r=o.getAutoHeaderHeight();r!=null&&r>i&&(i=r)}}return Math.max(t,i)}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),i=this.visibleColsService.getAllCols().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(e,...i)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if((e==null?void 0:e.type)!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)})}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}onSelectionOptionsChanged(e,t,i){if(typeof e=="string"||typeof t=="string")return;const s=t?Ro(t):void 0,n=e?Ro(e):void 0,o=s!==n,r=t?ra(t):void 0,a=e?ra(e):void 0;(o||r!==a)&&this.refreshAll(i)}};function Bn(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function Gg(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function Hg(e,t){const i=e===t,s=e.getColDef()===t,n=e.getColId()==t;return i||s||n}function db(e,t){return hs(e,t,(i,s)=>i.getColId()===s.getColId())}var ub=class extends G{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeCols(e));return}const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:n,source:o="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered()){this.timesDelayed++,setTimeout(()=>this.autoSizeCols(e));return}this.timesDelayed=0;const r=[];let a=-1;const d=i??this.gos.get("skipHeaderOnAutoSize"),h=s??d;for(;a!==0;){a=0;const p=[];t.forEach(f=>{if(!f)return;const m=this.columnModel.getCol(f);if(!m||r.indexOf(m)>=0)return;const v=this.autoWidthCalculator.getPreferredWidthForColumn(m,d);if(v>0){const w=this.normaliseColumnWidth(m,v);m.setActualWidth(w,o),r.push(m),a++}p.push(m)}),p.length&&this.visibleColsService.refresh(o)}h||this.autoSizeColumnGroupsByColumns(t,o,n),this.eventDispatcher.columnResized(r,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.columnModel.getColsForKeys(e).forEach(a=>{let d=a.getParent();for(;d&&d!=i;)d.isPadding()||s.add(d),d=d.getParent()});let o;const r=[];for(const a of s){for(const d of this.ctrlsService.getHeaderRowContainerCtrls())if(o=d.getHeaderCtrlForColumn(a),o)break;o&&o.resizeLeafColumnsToFit(t)}return r}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeAllColumns(e,t));return}const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},hb=class extends G{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>kt(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>kt(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>kt(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return Tt(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,(i,s)=>this.setRowGroupActive(i,s,t),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),!e&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,i=>this.setRowGroupActive(!0,i,t),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,i=>this.setRowGroupActive(!1,i,t),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,i=>i.setPivotActive(!0,t),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,i=>i.setPivotActive(!1,t),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,(i,s)=>this.setValueActive(i,s,t),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,i=>this.setValueActive(!0,i,t),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,i=>this.setValueActive(!1,i,t),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],n=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(n,i)}setColList(e,t,i,s,n,o,r){const a=this.columnModel.getCols();if(Tt(a))return;const d=new Map;t.forEach((p,f)=>d.set(p,f)),t.length=0,q(e)&&e.forEach(p=>{const f=this.columnModel.getColDefCol(p);f&&t.push(f)}),t.forEach((p,f)=>{const m=d.get(p);if(m===void 0){d.set(p,0);return}s&&m!==f||d.delete(p)}),(this.columnModel.getColDefCols()||[]).forEach(p=>{const f=t.indexOf(p)>=0;o(f,p)}),n&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(r),this.eventDispatcher.columnChanged(i,[...d.keys()],r)}updateColList(e,t,i,s,n,o,r){if(!e||Tt(e))return;let a=!1;const d=new Set;e.forEach(h=>{if(!h)return;const p=this.columnModel.getColDefCol(h);if(p){if(d.add(p),i){if(t.indexOf(p)>=0)return;t.push(p)}else{const f=t.indexOf(p);if(f<0)return;for(let m=f+1;m<t.length;m++)d.add(t[m]);kt(t,p)}n(p),a=!0}}),a&&(s&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(r),this.eventDispatcher.genericColumnEvent(o,Array.from(d),r))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,(i,s)=>i.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueCols.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}extractColsCommon(e=[],t=[],i,s,n,o,r){const a=[],d=[];(this.columnModel.getColDefCols()||[]).forEach(m=>{const v=e.indexOf(m)<0,w=m.getColDef(),S=Fd(o(w)),b=Fd(r(w)),R=_n(s(w)),x=_n(n(w));let T;S!==void 0?T=S:R!==void 0?R===null?T=!1:T=R>=0:v?b!==void 0?T=b:x!==void 0?T=x!=null&&x>=0:T=!1:T=t.indexOf(m)>=0,T&&((v?R!=null||x!=null:R!=null)?a.push(m):d.push(m))});const p=m=>{const v=s(m.getColDef()),w=n(m.getColDef());return v??w};a.sort((m,v)=>{const w=p(m),S=p(v);return w===S?0:w<S?-1:1});const f=[].concat(a);return t.forEach(m=>{d.indexOf(m)>=0&&f.push(m)}),d.forEach(m=>{f.indexOf(m)<0&&f.push(m)}),t.forEach(m=>{f.indexOf(m)<0&&i(m,!1)}),f.forEach(m=>{t.indexOf(m)<0&&i(m,!0)}),f}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(n,o,r,a,d,h)=>{const p=this.columnModel.getColDefCols();if(!o.length||!p)return[];const f=Object.keys(n),m=new Set(f),v=new Set(f),w=new Set(o.map(L=>{const A=L.getColId();return v.delete(A),A}).concat(f)),S=[],b={};let R=0;for(let L=0;L<p.length;L++){const A=p[L].getColId();w.has(A)&&(S.push(A),b[A]=R++)}let x=1e3,T=!1,I=0;const V=L=>{const A=b[L];for(let k=I;k<A;k++){const N=S[k];v.has(N)&&(n[N][d]=x++,v.delete(N))}I=A};o.forEach(L=>{const A=L.getColId();if(m.has(A))V(A),n[A][d]=x++;else{const k=L.getColDef();(k[d]===null||k[d]===void 0&&k[h]==null)&&(T||(k[r]||k[r]===void 0&&k[a]?V(A):(v.forEach(U=>{n[U][d]=x+b[U]}),x+=S.length,T=!0)),i[A]||(i[A]={colId:A}),i[A][d]=x++)}})};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},pb=class extends G{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(Tt(i))return!1;if(e&&e.state&&!e.state.forEach)return z("applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),n=(a,d,h)=>{const p=this.compareColumnStatesAndDispatchEvents(t),f=d.slice(),m={},v={},w=[],S=[];let b=0;const R=this.funcColsService.getRowGroupColumns().slice(),x=this.funcColsService.getPivotColumns().slice();a.forEach(L=>{const A=L.colId||"";if(A.startsWith(ua)){w.push(L),S.push(L);return}const N=h(A);N?(this.syncColumnWithStateItem(N,L,e.defaultState,m,v,!1,t,s),kt(f,N)):(S.push(L),b+=1)});const T=L=>this.syncColumnWithStateItem(L,null,e.defaultState,m,v,!1,t,s);f.forEach(T),this.funcColsService.sortRowGroupColumns(Wg.bind(this,m,R)),this.funcColsService.sortPivotColumns(Wg.bind(this,v,x)),this.columnModel.refreshCols(!1);const V=(this.columnModel.getAutoCols()||[]).slice();return w.forEach(L=>{const A=this.columnModel.getAutoCol(L.colId);kt(V,A),this.syncColumnWithStateItem(A,L,e.defaultState,null,null,!0,t,s)}),V.forEach(T),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),p(),{unmatchedAndAutoStates:S,unmatchedCount:b}};this.columnAnimationService.start();let{unmatchedAndAutoStates:o,unmatchedCount:r}=n(e.state||[],i,a=>this.columnModel.getColDefCol(a));if(o.length>0||q(e.defaultState)){const a=this.pivotResultColsService.getPivotResultCols(),d=a==null?void 0:a.list;r=n(o,d||[],h=>this.pivotResultColsService.getPivotResultCol(h)).unmatchedCount}return this.columnAnimationService.finish(),r===0}resetColumnState(e){const t=this.columnModel.getColDefCols();if(Tt(t))return;const i=this.columnModel.getColDefColTree(),s=_d(i),n=[];let o=1e3,r=1e3,a=[];const d=this.columnModel.getAutoCols();d&&(a=a.concat(d)),s&&(a=a.concat(s)),a.forEach(h=>{const p=this.getColumnStateFromColDef(h);Ve(p.rowGroupIndex)&&p.rowGroup&&(p.rowGroupIndex=o++),Ve(p.pivotIndex)&&p.pivot&&(p.pivotIndex=r++),n.push(p)}),this.applyColumnState({state:n,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(w,S)=>w??S??null,i=e.getColDef(),s=t(i.sort,i.initialSort),n=t(i.sortIndex,i.initialSortIndex),o=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),d=t(i.flex,i.initialFlex);let h=t(i.rowGroupIndex,i.initialRowGroupIndex),p=t(i.rowGroup,i.initialRowGroup);h==null&&(p==null||p==!1)&&(h=null,p=null);let f=t(i.pivotIndex,i.initialPivotIndex),m=t(i.pivot,i.initialPivot);f==null&&(m==null||m==!1)&&(f=null,m=null);const v=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:n,hide:o,pinned:r,width:a,flex:d,rowGroup:p,rowGroupIndex:h,pivot:m,pivotIndex:f,aggFunc:v}}syncColumnWithStateItem(e,t,i,s,n,o,r,a){if(!e)return;const d=(I,V)=>{const L={value1:void 0,value2:void 0};let A=!1;return t&&(t[I]!==void 0&&(L.value1=t[I],A=!0),q(V)&&t[V]!==void 0&&(L.value2=t[V],A=!0)),!A&&i&&(i[I]!==void 0&&(L.value1=i[I]),q(V)&&i[V]!==void 0&&(L.value2=i[V])),L},h=d("hide").value1;h!==void 0&&e.setVisible(!h,r);const p=d("pinned").value1;p!==void 0&&e.setPinned(p);const f=e.getColDef().minWidth??this.gos.environment.getDefaultColumnMinWidth(),m=d("flex").value1;if(m!==void 0&&e.setFlex(m),m==null){const I=d("width").value1;I!=null&&f!=null&&I>=f&&e.setActualWidth(I,r)}const v=d("sort").value1;v!==void 0&&(v==="desc"||v==="asc"?e.setSort(v,r):e.setSort(void 0,r));const w=d("sortIndex").value1;if(w!==void 0&&e.setSortIndex(w),o||!e.isPrimary())return;const S=d("aggFunc").value1;S!==void 0&&(typeof S=="string"?(e.setAggFunc(S),e.isValueActive()||(e.setValueActive(!0,r),a.addValueCol(e))):(q(S)&&z("stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,r),a.removeValueCol(e))));const{value1:b,value2:R}=d("rowGroup","rowGroupIndex");(b!==void 0||R!==void 0)&&(typeof R=="number"||b?(e.isRowGroupActive()||(e.setRowGroupActive(!0,r),a.addGroupCol(e)),s&&typeof R=="number"&&(s[e.getId()]=R)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,r),a.removeGroupCol(e)));const{value1:x,value2:T}=d("pivot","pivotIndex");(x!==void 0||T!==void 0)&&(typeof T=="number"||x?(e.isPivotActive()||(e.setPivotActive(!0,r),a.addPivotCol(e)),n&&typeof T=="number"&&(n[e.getId()]=T)):e.isPivotActive()&&(e.setPivotActive(!1,r),a.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach(i=>{i.colId!=null&&t.push(i.colId)}),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach(n=>{s[n.colId]=n}),()=>{const n=this.columnModel.getAllCols(),o=(S,b,R,x)=>{const T=b.map(x),I=R.map(x);if(hs(T,I))return;const L=new Set(b);R.forEach(k=>{L.delete(k)||L.add(k)});const A=[...L];this.eventService.dispatchEvent({type:S,columns:A,column:A.length===1?A[0]:null,source:e})},r=S=>{const b=[];return n.forEach(R=>{const x=s[R.getColId()];x&&S(x,R)&&b.push(R)}),b},a=S=>S.getColId();o("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),a),o("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),a);const h=r((S,b)=>{const R=S.aggFunc!=null,x=R!=b.isValueActive(),T=R&&S.aggFunc!=b.getAggFunc();return x||T});h.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",h,e);const p=(S,b)=>S.width!=b.getActualWidth();this.eventDispatcher.columnResized(r(p),!0,e);const f=(S,b)=>S.pinned!=b.getPinned();this.eventDispatcher.columnPinned(r(f),e);const m=(S,b)=>S.hide==b.isVisible();this.eventDispatcher.columnVisible(r(m),e);const w=r((S,b)=>S.sort!=b.getSort()||S.sortIndex!=b.getSortIndex());w.length>0&&this.sortController.dispatchSortChangedEvents(e,w),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach(d=>s[d.colId]=d);const n={};e.forEach(d=>{s[d.colId]&&(n[d.colId]=!0)});const o=e.filter(d=>n[d.colId]),r=i.filter(d=>n[d.colId]),a=[];r.forEach((d,h)=>{const p=o&&o[h];if(p&&p.colId!==d.colId){const f=this.columnModel.getCol(p.colId);f&&a.push(f)}}),a.length&&this.eventDispatcher.columnMoved({movedColumns:a,source:t,finished:!0})}},Wg=(e,t,i,s)=>{const n=e[i.getId()],o=e[s.getId()],r=n!=null,a=o!=null;if(r&&a)return n-o;if(r)return-1;if(a)return 1;const d=t.indexOf(i),h=t.indexOf(s),p=d>=0,f=h>=0;return p&&f?d-h:p?-1:1},gb=class extends G{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const n=s[e];this.moveColumns([n],t,i)}moveColumns(e,t,i,s=!0){const n=this.columnModel.getCols();if(!n)return;if(t>n.length-e.length){z("tried to insert columns in invalid location, toIndex = ",t),z("remember that you should not count the moving columns when calculating the new index");return}this.columnAnimationService.start();const o=this.columnModel.getColsForKeys(e);this.doesMovePassRules(o,t)&&(this.columnModel.moveInCols(o,t,i),this.eventDispatcher.columnMoved({movedColumns:o,source:i,toIndex:t,finished:s})),this.columnAnimationService.finish()}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const s=this.columnModel.getCols().slice();return Ig(s,e,t),s}doesMovePassLockedPositions(e){const t=o=>o?o==="left"||o===!0?-1:1:0,i=this.gos.get("enableRtl");let s=i?1:-1,n=!0;return e.forEach(o=>{const r=t(o.getColDef().lockPosition);i?r>s&&(n=!1):r<s&&(n=!1),s=r}),n}doesMovePassMarryChildren(e){let t=!0;const i=this.columnModel.getColTree();return As(null,i,s=>{if(!zt(s))return;const n=s,o=n.getColGroupDef();if(!(o&&o.marryChildren))return;const a=[];n.getLeafColumns().forEach(m=>{const v=e.indexOf(m);a.push(v)});const d=Math.max.apply(Math,a),h=Math.min.apply(Math,a),p=d-h,f=n.getLeafColumns().length-1;p>f&&(t=!1)}),t}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(o=>{const r=o.getColDef().lockPosition;r==="right"?s.push(o):r==="left"||r===!0?t.push(o):i.push(o)}),this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},fb=/[&<>"']/g,mb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ps(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(fb,s=>mb[s])}function Cb(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,i=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(i,"$1 $2$3").replace(/\./g," ").split(" ").map(n=>n.substring(0,1).toUpperCase()+(n.length>1?n.substring(1,n.length):"")).join(" ")}function vb(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var wb=class extends G{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,n){const o=e.headerValueGetter;if(o){const r=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:n});return typeof o=="function"?o(r):typeof o=="string"?this.expressionService.evaluate(o,r):(z("headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return Cb(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=q(i);let n=null,o;if(s){const r=this.funcColsService.getValueColumns(),a=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&r.length===1,d=e.getColDef().pivotTotalColumnIds!==void 0;if(a&&!d)return t;n=i?i.getAggFunc():null,o=!0}else{const r=e.isValueActive(),a=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();r&&a?(n=e.getAggFunc(),o=!0):o=!1}if(o){const r=typeof n=="string"?n:"func";return`${this.localeService.getLocaleTextFunc()(r,r)}(${t})`}return t}},Sb=class extends G{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){var e;Ys(this.context,(e=this.pivotResultCols)==null?void 0:e.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach(n=>{const o=n.getColDef().pivotKeys,r=n.getColDef().pivotValueColumn;hs(o,e)&&r===i&&(s=n)}),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){var i,s;if(this.columnModel.isReady()&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const n=this.columnFactory.createColumnTree(e,!1,((i=this.pivotResultCols)==null?void 0:i.tree)||this.previousPivotResultCols||void 0,t);Ys(this.context,(s=this.pivotResultCols)==null?void 0:s.tree,n.columnTree);const o=n.columnTree,r=n.treeDept,a=_d(o),d={};this.pivotResultCols={tree:o,treeDepth:r,list:a,map:d},this.pivotResultCols.list.forEach(p=>this.pivotResultCols.map[p.getId()]=p);const h=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.columnModel.refreshCols(!h)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.columnModel.refreshCols(!1);this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=n=>{n.forEach(o=>{if(q(o.children)){const a=o;i&&i(a),s(a.children)}else t&&t(o)})};e&&s(e)}},yb=class extends G{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const n=[];e.forEach(o=>{const r=this.columnModel.getColDefCol(o.key)||this.columnModel.getCol(o.key);if(!r)return;if(n.push({width:o.newWidth,ratios:[1],columns:[r]}),this.gos.get("colResizeDefault")==="shift"&&(t=!t),t){const d=this.visibleColsService.getColAfter(r);if(!d)return;const h=r.getActualWidth()-o.newWidth,p=d.getActualWidth()+h;n.push({width:p,ratios:[1],columns:[d]})}}),n.length!==0&&this.resizeColumnSets({resizeSets:n,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every(p=>this.checkMinAndMaxWidthsForSet(p)))){if(i){const p=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(p,i,s)}return}const o=[],r=[];t.forEach(p=>{const{width:f,columns:m,ratios:v}=p,w={},S={};m.forEach(x=>r.push(x));let b=!0,R=0;for(;b;){if(R++,R>1e3){We("infinite loop in resizeColumnSets");break}b=!1;const x=[];let T=0,I=f;m.forEach((L,A)=>{if(S[L.getId()])I-=w[L.getId()];else{x.push(L);const N=v[A];T+=N}});const V=1/T;x.forEach((L,A)=>{const k=A===x.length-1;let N;k?N=I:(N=Math.round(v[A]*f*V),I-=N);const $=L.getMinWidth(),U=L.getMaxWidth();N<$?(N=$,S[L.getId()]=!0,b=!0):U>0&&N>U&&(N=U,S[L.getId()]=!0,b=!0),w[L.getId()]=N})}m.forEach(x=>{const T=w[x.getId()];x.getActualWidth()!==T&&(x.setActualWidth(T,s),o.push(x))})});const a=o.length>0;let d=[];a&&(d=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const h=r.concat(d);(a||i)&&this.eventDispatcher.columnResized(h,i,s,d)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,n=0,o=!0;t.forEach(d=>{const h=d.getMinWidth();s+=h||0;const p=d.getMaxWidth();p>0?n+=p:o=!1});const r=i>=s,a=!o||i<=n;return r&&a}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const m=new Set(e.resizingCols);for(let v=i.length-1;v>=0;v--)if(m.has(i[v])){s=v;break}}let n=0,o=[],r=0,a=0;for(let m=0;m<i.length;m++)i[m].getFlex()&&m>s?(o.push(i[m]),a+=i[m].getFlex(),r+=i[m].getMinWidth()):n+=i[m].getActualWidth();if(!o.length)return[];let d=[];n+r>this.flexViewportWidth&&(o.forEach(m=>m.setActualWidth(m.getMinWidth(),t)),d=o,o=[]);const h=[];let p;e:for(;;){p=this.flexViewportWidth-n;const m=p/a;for(let v=0;v<o.length;v++){const w=o[v],S=m*w.getFlex();let b=0;const R=w.getMinWidth(),x=w.getMaxWidth();if(S<R?b=R:S>x&&(b=x),b){w.setActualWidth(b,t),kg(o,w),a-=w.getFlex(),d.push(w),n+=w.getActualWidth();continue e}h[v]=Math.floor(S)}break}let f=p;return o.forEach((m,v)=>{const w=v<o.length-1?Math.min(h[v],f):Math.max(h[v],f);m.setActualWidth(w,t),d.push(m),f-=h[v]}),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(d,!0,t,o),o}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var m;if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,i,s));return}const n={};s&&((m=s==null?void 0:s.columnLimits)==null||m.forEach(({key:v,...w})=>{n[typeof v=="string"?v:v.getColId()]=w}));const o=this.visibleColsService.getAllCols(),r=e===Ts(o);if(e<=0||!o.length||r)return;const a=[],d=[];o.forEach(v=>{v.getColDef().suppressSizeToFit===!0?d.push(v):a.push(v)});const h=a.slice(0);let p=!1;const f=v=>{kt(a,v),d.push(v)};for(a.forEach(v=>{v.resetActualWidth(t);const w=n==null?void 0:n[v.getId()],S=(w==null?void 0:w.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(s==null?void 0:s.defaultMaxWidth),R=v.getActualWidth();typeof S=="number"&&R<S?v.setActualWidth(S,t,!0):typeof b=="number"&&R>b&&v.setActualWidth(b,t,!0)});!p;){p=!0;const v=e-Ts(d);if(v<=0)a.forEach(w=>{var b;const S=((b=n==null?void 0:n[w.getId()])==null?void 0:b.minWidth)??(s==null?void 0:s.defaultMinWidth);if(typeof S=="number"){w.setActualWidth(S,t,!0);return}w.setMinimum(t)});else{const w=v/Ts(a);let S=v;for(let b=a.length-1;b>=0;b--){const R=a[b],x=n==null?void 0:n[R.getId()],T=(x==null?void 0:x.minWidth)??(s==null?void 0:s.defaultMinWidth),I=(x==null?void 0:x.maxWidth)??(s==null?void 0:s.defaultMaxWidth),V=R.getMinWidth(),L=R.getMaxWidth(),A=typeof T=="number"&&T>V?T:V,k=typeof I=="number"&&I<L?I:L;let N=Math.round(R.getActualWidth()*w);N<A?(N=A,f(R),p=!1):N>k?(N=k,f(R),p=!1):b===0&&(N=S),R.setActualWidth(N,t,!0),S-=N}}}h.forEach(v=>{v.fireColumnWidthChangedEvent(t)}),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),!i&&this.eventDispatcher.columnResized(h,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:n}=e,o=i==null?void 0:i.map(({colId:r,minWidth:a,maxWidth:d})=>({key:r,minWidth:a,maxWidth:d}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:n,columnLimits:o})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}};function zg(e,t){return e+"_"+t}function mt(e){return e instanceof Ug}var Ug=class extends G{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return zg(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{mt(e)&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=he(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){var e;return!!((e=this.getColGroupDef())!=null&&e.autoHeaderHeight)}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{Xs(t)?e.push(t):mt(t)&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{Xs(t)?e.push(t):mt(t)&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}this.children.forEach(i=>{if(mt(i)&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},$g=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}},bb=class extends G{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Wd(this.treeLeft),this.columnsCenter=Wd(this.treeCenter),this.columnsRight=Wd(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter(i=>i.isAutoHeight()),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols(e)}updateBodyWidths(){const e=Ts(this.columnsCenter),t=Ts(this.columnsLeft),i=Ts(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i,this.eventService.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventService.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?he(this.columnsRight):null):(t=this.columnsLeft?he(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter(o=>o.getPinned()=="left"),i=e.filter(o=>o.getPinned()=="right"),s=e.filter(o=>o.getPinned()!="left"&&o.getPinned()!="right"),n=new $g;this.treeLeft=this.createGroups({columns:t,idCreator:n,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:n,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:n,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const n of e){const o=n.getPinned();o?o===!0||o==="left"?t.push(n):s.push(n):i.push(n)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return mt(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach(e=>{e.forEach(t=>{mt(t)&&t.checkLeft()})})}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const i=this.columnModel.getCols().slice(0),s=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach(n=>{if(s){let o=Ts(n);n.forEach(r=>{o-=r.getActualWidth(),r.setLeft(o,e)})}else{let o=0;n.forEach(r=>{r.setLeft(o,e),o+=r.getActualWidth()})}qy(i,n)}),i.forEach(n=>{n.setLeft(null,e)})}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const n=[];let o=null;for(let r=0;r<t.length;r++){const a=t[r],d=t.length-r,h=Math.min(a.getColSpan(e),d),p=[a];if(h>1){const m=h-1;for(let v=1;v<=m;v++)p.push(t[r+v]);r+=m}let f;i?(f=!1,p.forEach(m=>{i(m)&&(f=!0)})):f=!0,f&&(n.length===0&&o&&(s&&s(a))&&n.push(o),n.push(a)),o=a}return n}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),n=t==="After"?he(s):s[0],o=`getCol${t}`;for(;;){const r=this[o](n);if(!r)return null;const a=this.getColGroupAtLevel(r,i);if(a!==e)return a}}getColGroupAtLevel(e,t){let i=e.getParent(),s,n;for(;s=i.getProvidedColumnGroup().getLevel(),n=i.getPaddingLevel(),!(s+n<=t);)i=i.getParent();return i}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};Gn(this.treeCenter,!1,e),Gn(this.treeLeft,!1,e),Gn(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllTrees();Gn(e,!1,t=>{mt(t)&&t.calculateDisplayedColumns()})}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?he(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if(mt(e))return e;const i=this.getAllTrees(),s=typeof t=="number";let n=null;return Gn(i,!1,o=>{if(mt(o)){const r=o;let a;s?a=e===r.getGroupId()&&t===r.getPartId():a=e===r.getGroupId(),a&&(n=r)}}),n}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return Ts(this.columnsLeft)}getDisplayedColumnsRightWidth(){return Ts(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s=t==="first";let n;if(mt(e)){const o=e.getDisplayedLeafColumns();if(!o.length)return!1;n=s?o[0]:he(o)}else n=e;return(s?i[0]:he(i))===n}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:n,isStandaloneStructure:o}=e,r=this.mapOldGroupsById(n),a=[];let d=t;for(;d.length;){const h=d;d=[];let p=0;const f=m=>{const v=p;p=m;const w=h[v],b=(mt(w)?w.getProvidedColumnGroup():w).getOriginalParent();if(b==null){for(let x=v;x<m;x++)a.push(h[x]);return}const R=this.createColGroup(b,i,r,s,o);for(let x=v;x<m;x++)R.addChild(h[x]);d.push(R)};for(let m=1;m<h.length;m++){const v=h[m],S=(mt(v)?v.getProvidedColumnGroup():v).getOriginalParent(),b=h[p],x=(mt(b)?b.getProvidedColumnGroup():b).getOriginalParent();S!==x&&f(m)}p<h.length&&f(h.length)}return o||this.setupParentsIntoCols(a,null),a}createColGroup(e,t,i,s,n){const o=e.getGroupId(),r=t.getInstanceIdForKey(o),a=zg(o,r);let d=i[a];return d&&d.getProvidedColumnGroup()!==e&&(d=null),q(d)?d.reset():(d=new Ug(e,o,r,s),n||this.createBean(d)),d}mapOldGroupsById(e){const t={},i=s=>{s.forEach(n=>{if(mt(n)){const o=n;t[n.getUniqueId()]=o,i(o.getChildren())}})};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach(i=>{if(i.setParent(t),mt(i)){const s=i;this.setupParentsIntoCols(s.getChildren(),s)}})}};function Gn(e,t,i){if(e)for(let s=0;s<e.length;s++){const n=e[s];if(mt(n)){const o=t?n.getDisplayedChildren():n.getChildren();Gn(o,t,i)}i(n)}}function Wd(e){const t=[];return Gn(e,!0,i=>{Xs(i)&&t.push(i)}),t}var Kg=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel"],Rb=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","scrollGapChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnGroupHeaderHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged","overlayExclusiveChanged"],Fb=[...Kg,...Rb],Eb={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0,suppressSetFilterByDefault:!0},It=class{};It.STRING_PROPERTIES=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],It.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","theme","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy","cellSelection","selectionColumnDef"],It.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],It.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],It.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault"],It.OTHER_PROPERTIES=["suppressStickyTotalRow","loadThemeGoogleFonts","rowSelection"],It.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],It.ALL_PROPERTIES=[...It.ARRAY_PROPERTIES,...It.OBJECT_PROPERTIES,...It.STRING_PROPERTIES,...It.NUMBER_PROPERTIES,...It.FUNCTION_PROPERTIES,...It.BOOLEAN_PROPERTIES,...It.OTHER_PROPERTIES];var Er=It,xi=class{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}};xi.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",xi.PUBLIC_EVENTS=Kg,xi.EVENT_CALLBACKS=Fb.map(e=>xi.getCallbackForEvent(e)),xi.BOOLEAN_PROPERTIES=Er.BOOLEAN_PROPERTIES,xi.ALL_PROPERTIES=Er.ALL_PROPERTIES,xi.ALL_PROPERTIES_AND_CALLBACKS=[...xi.ALL_PROPERTIES,...xi.EVENT_CALLBACKS],xi.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(xi.ALL_PROPERTIES_AND_CALLBACKS);var Hi=xi;function xb(e,t){typeof e!="object"&&(e={});const i={...e};return Hi.ALL_PROPERTIES_AND_CALLBACKS.forEach(n=>{const o=t[n];typeof o<"u"&&o!==Hi.VUE_OMITTED_PROPERTY&&(i[n]=o)}),i}function zd(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter(r=>Hi.ALL_PROPERTIES_AND_CALLBACKS_SET.has(r)).forEach(r=>{i[r]=e[r],s=!0}),!s)return;const n={type:"gridOptionsChanged",options:i};t.dispatchEvent(n);const o={type:"componentStateChanged"};Ei(i,(r,a)=>{o[r]=a}),t.dispatchEvent(o)}function xr(e,t,i){return i&&e.addDestroyFunc(()=>t.destroyBean(i)),i??e}var Pb=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[e]!==!0&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[e]!==!1&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){s.forEach(n=>this.addOrRemoveCssClass(n,t));return}}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}};function Ms(e,t,i){i==null||typeof i=="string"&&i==""?jg(e,t):Wi(e,t,i)}function Wi(e,t,i){e.setAttribute(Zg(t),i.toString())}function jg(e,t){e.removeAttribute(Zg(t))}function Zg(e){return`aria-${e}`}function ti(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Db(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function Tb(e){return e.getAttribute("aria-label")}function xo(e,t){Ms(e,"label",t)}function Pr(e,t){Ms(e,"labelledby",t)}function qg(e,t){Ms(e,"live",t)}function Ab(e,t){Ms(e,"atomic",t)}function Mb(e,t){Ms(e,"relevant",t)}function kb(e,t){Ms(e,"disabled",t)}function Ud(e,t){Ms(e,"hidden",t)}function Dr(e,t){Wi(e,"expanded",t)}function Ib(e,t){Wi(e,"setsize",t)}function Lb(e,t){Wi(e,"posinset",t)}function _b(e,t){Wi(e,"multiselectable",t)}function Ob(e,t){Wi(e,"rowcount",t)}function Yg(e,t){Wi(e,"rowindex",t)}function Vb(e,t){Wi(e,"colcount",t)}function Qg(e,t){Wi(e,"colindex",t)}function Nb(e,t){Wi(e,"colspan",t)}function Bb(e,t){Wi(e,"sort",t)}function Gb(e){jg(e,"sort")}function pa(e,t){Ms(e,"selected",t)}function Hb(e,t){Ms(e,"controls",t.id),Pr(t,e.id)}function $d(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Kd,ga,jd,Zd,qd,Yd,Qd,Xd,Jd;function gs(){return Kd===void 0&&(Kd=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Kd}function Xg(){if(ga===void 0)if(gs()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(ga=e[1]!=null?parseFloat(e[1]):0)}else ga=0;return ga}function eu(){if(jd===void 0){const e=window;jd=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return jd}function tu(){return Zd===void 0&&(Zd=/(firefox)/i.test(navigator.userAgent)),Zd}function Jg(){return qd===void 0&&(qd=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),qd}function Js(){return Yd===void 0&&(Yd=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Yd}function iu(){return!gs()||Xg()>=15}function su(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!tu())?null:t.toString()}function Wb(){if(Jd!==void 0)return Jd;if(!document.body)return-1;let e=1e6;const t=tu()?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),Jd=e,e}function zb(){var e,t;return((e=document.body)==null?void 0:e.clientWidth)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientWidth)||-1)}function Ub(){var e,t;return((e=document.body)==null?void 0:e.clientHeight)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientHeight)||-1)}function $b(){return Xd==null&&ef(),Xd}function ef(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(Xd=i,Qd=i===0)}function tf(){return Qd==null&&ef(),Qd}var fa,Kb="[tabindex], input, select, button, textarea, [href]",sf="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function nu(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,s=t.call(e,"input, select, button, textarea"),n=t.call(e,sf),o=di(e);return s&&!n&&o}function et(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Ud(e,!t)}function jb(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Ud(e,!t)}function Tr(e,t){const i="disabled",s=t?n=>n.setAttribute(i,""):n=>n.removeAttribute(i);s(e),df(e.querySelectorAll("input"),n=>s(n))}function Po(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function Hn(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:n,borderBottomWidth:o,borderLeftWidth:r,paddingTop:a,paddingRight:d,paddingBottom:h,paddingLeft:p,marginTop:f,marginRight:m,marginBottom:v,marginLeft:w,boxSizing:S}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(n||"0"),borderBottomWidth:parseFloat(o||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(d||"0"),paddingBottom:parseFloat(h||"0"),paddingLeft:parseFloat(p||"0"),marginTop:parseFloat(f||"0"),marginRight:parseFloat(m||"0"),marginBottom:parseFloat(v||"0"),marginLeft:parseFloat(w||"0"),boxSizing:S}}function ma(e){const t=Hn(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function Do(e){const t=Hn(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function nf(e){const{height:t,marginBottom:i,marginTop:s}=Hn(e);return Math.floor(t+i+s)}function Ca(e){const{width:t,marginLeft:i,marginRight:s}=Hn(e);return Math.floor(t+i+s)}function of(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:n,borderBottomWidth:o}=Hn(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(n||0),bottom:t.bottom+(o||0)}}function va(){if(typeof fa=="boolean")return fa;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`<div style="width: 2px">
2
- <span style="display: inline-block; width: 1px"></span>
3
- <span style="display: inline-block; width: 1px"></span>
4
- </div>`,document.body.appendChild(e),e.scrollLeft=1,fa=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),fa}function wa(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),eu()&&!va()&&(i=e.scrollWidth-e.clientWidth-i)),i}function Sa(e,t,i){i&&(va()?t*=-1:(gs()||eu())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function Lt(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function fs(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rf(e){return!!e.offsetParent}function di(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!rf(e)||window.getComputedStyle(e).visibility!=="visible")}function ks(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function lf(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function af(e,t){for(let i=0;i<t.length;i++){const s=t[i],n=e.children[i];n!==s&&e.insertBefore(s,n)}}function Zb(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function cf(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||s==null)continue;const n=vb(i),o=s.toString(),r=o.replace(/\s*!important/g,""),a=r.length!=o.length?"important":void 0;e.style.setProperty(n,r,a)}}function qb(e){return e.clientWidth<e.scrollWidth}function Yb(e){return e.clientHeight<e.scrollHeight}function ya(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):zi(e,t)}function zi(e,t){t=ou(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function Ar(e,t){t=ou(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function ou(e){return typeof e=="number"?`${e}px`:e}function ba(e){return e instanceof Node||e instanceof HTMLElement}function Qb(e){if(e==null)return[];const t=[];return df(e,i=>t.push(i)),t}function Xb(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function Pi(e,t,i){i==null||i===""?e.removeAttribute(t):e.setAttribute(t,i.toString())}function df(e,t){if(e!=null)for(let i=0;i<e.length;i++)t(e[i])}var To=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},Jb=1e3,eR=1e3,uf=100,hf=class Co extends G{constructor(t,i,s,n){super(),this.parentComp=t,this.tooltipShowDelayOverride=i,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=n,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(t){this.popupService=t.popupService,this.userComponentFactory=t.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const t=this.parentComp.getGui();this.tooltipTrigger===0&&this.addManagedListeners(t,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(t,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(t,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(t,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(t){const i=this.gos.get(t);return i<0&&z(`${t} should not be lower than 0`),Math.max(200,i)}getTooltipDelay(t){return t==="show"?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const t=this.gos.get("tooltipTrigger");return!t||t==="hover"?0:1}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!Js()&&(Co.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},uf):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){var o;const i=t.relatedTarget,s=this.parentComp.getGui(),n=(o=this.tooltipComp)==null?void 0:o.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(n!=null&&n.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(this.state!=0||Co.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){const t=new Date().getTime(),i=Co.lastTooltipHideTime;return t-i<Jb}setToDoNothing(t){!t&&this.state===2&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const t={...this.parentComp.getTooltipParams()};if(!q(t.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(i)}hideTooltip(t){!t&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),Co.lastTooltipHideTime=new Date().getTime()),this.eventService.dispatchEvent({type:"tooltipHide",parentGui:this.parentComp.getGui()}),t&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(t,i){if(this.state!==2||this.tooltipInstanceCount!==t){this.destroyBean(i);return}const n=i.getGui();this.tooltipComp=i,n.classList.contains("ag-tooltip")||n.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&n.classList.add("ag-tooltip-animate"),this.interactionEnabled&&n.classList.add("ag-tooltip-interactive");const o=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({eChild:n,ariaLabel:o("ariaLabelTooltip","Tooltip")});if(r&&(this.tooltipPopupDestroyFunc=r.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const a=()=>this.setToDoNothing();[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:a,columnMoved:a})}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(n,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(n,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventService.dispatchEvent({type:"tooltipShow",tooltipGui:n,parentGui:this.parentComp.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){var s;const t=(s=this.tooltipComp)==null?void 0:s.getGui(),i=Je(this.gos);return!!t&&t.contains(i)}onTooltipFocusOut(t){const i=this.parentComp.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,i.contains(t.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...t,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...t,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp,s=this.tooltipTrigger===0?eR:0;window.setTimeout(()=>{t(),this.destroyBean(i)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Co.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},uf)}unlockService(){Co.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};hf.isLocked=!1;var tR=hf,Ao=class extends G{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(e!=null&&e!=""?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var t,i,s,n;if(this.tooltipManager!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new tR(e,(i=(t=this.ctrl).getTooltipShowDelayOverride)==null?void 0:i.call(t),(n=(s=this.ctrl).getTooltipHideDelayOverride)==null?void 0:n.call(s),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){var n,o,r,a,d;const e=this.ctrl,t=(n=e.getColumn)==null?void 0:n.call(e),i=(o=e.getColDef)==null?void 0:o.call(e),s=(r=e.getRowNode)==null?void 0:r.call(e);return{location:e.getLocation(),colDef:i,column:t,rowIndex:(a=e.getRowIndex)==null?void 0:a.call(e),node:s,data:s==null?void 0:s.data,value:this.getTooltipText(),valueFormatted:(d=e.getValueFormatted)==null?void 0:d.call(e),hideTooltipCallback:()=>{var h;return(h=this.tooltipManager)==null?void 0:h.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},iR=new To,ee=null,ke=class fy extends G{constructor(t,i){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=iR.next(),this.cssClassManager=new Pb(()=>this.eGui),this.componentSelectors=new Map((i??[]).map(s=>[s.selector,s])),t&&this.setTemplate(t)}preWireBeans(t){super.preWireBeans(t)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(t,i){t&&this.gos&&(this.applyElementsToComponent(t),this.createChildComponentsFromTags(t,i))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:n,location:o,shouldDisplayTooltip:r}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i);const a=()=>this.tooltipText;i!=null&&(this.tooltipFeature=this.createBean(new Ao({getTooltipValue:a,getGui:()=>this.getGui(),getLocation:()=>o??"UNKNOWN",getColDef:t==null?void 0:t.getColDef,getColumn:t==null?void 0:t.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:n!=null?()=>n:void 0,shouldDisplayTooltip:r})))}getDataRefAttribute(t){return t.getAttribute?t.getAttribute("data-ref"):null}applyElementsToComponent(t,i,s,n=null){if(i===void 0&&(i=this.getDataRefAttribute(t)),i){const o=this[i];if(o===ee)this[i]=n??t;else{const r=s&&s[i];!this.suppressDataRefValidation&&!r&&z(`Issue with data-ref: ${i} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(t,i){Qb(t.childNodes).forEach(n=>{if(!(n instanceof HTMLElement))return;const o=this.createComponentFromElement(n,r=>{r.getGui()&&this.copyAttributesFromNode(n,r.getGui())},i);if(o){if(o.addItems&&n.children.length){this.createChildComponentsFromTags(n,i);const r=Array.prototype.slice.call(n.children);o.addItems(r)}this.swapComponentForNode(o,t,n)}else n.childNodes&&this.createChildComponentsFromTags(n,i)})}createComponentFromElement(t,i,s){const n=t.nodeName,o=this.getDataRefAttribute(t),r=n.indexOf("AG-")===0,a=r?this.componentSelectors.get(n):null;let d=null;if(a){fy.elementGettingCreated=t;const h=s&&o?s[o]:void 0;d=new a.component(h),d.setParentComponent(this),this.createBean(d,null,i)}else r&&z(`Missing selector: ${n}`);return this.applyElementsToComponent(t,o,s,d),d}copyAttributesFromNode(t,i){Xb(t.attributes,(s,n)=>i.setAttribute(s,n))}swapComponentForNode(t,i,s){const n=t.getGui();i.replaceChild(n,s),i.insertBefore(document.createComment(s.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,t))}activateTabIndex(t){const i=this.gos.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i,s){const n=ks(t);this.setTemplateFromElement(n,i,s)}setTemplateFromElement(t,i,s,n=!1){if(this.eGui=t,this.suppressDataRefValidation=n,i)for(let o=0;o<i.length;o++){const r=i[o];this.componentSelectors.set(r.selector,r)}this.wireTemplate(t,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(t){this.parentComponent=t}getParentComponent(){return this.parentComponent}setGui(t){this.eGui=t}queryForHtmlElement(t){return this.eGui.querySelector(t)}getContainerAndElement(t,i){let s=i;return t==null?null:(s||(s=this.eGui),ba(t)?{element:t,parent:s}:{element:t.getGui(),parent:s})}prependChild(t,i){const{element:s,parent:n}=this.getContainerAndElement(t,i)||{};!s||!n||n.insertAdjacentElement("afterbegin",s)}appendChild(t,i){const{element:s,parent:n}=this.getContainerAndElement(t,i)||{};!s||!n||n.appendChild(s)}isDisplayed(){return this.displayed}setVisible(t,i={}){if(t!==this.visible){this.visible=t;const{skipAriaHidden:s}=i;jb(this.eGui,t,{skipAriaHidden:s})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;et(this.eGui,t,{skipAriaHidden:s});const n={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(n)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(t,i,s){this.eGui.addEventListener(t,i,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}},pf={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"},sR=(()=>{const e=new Set(Object.values(pf));return e.add("eye"),e})();function nR(e,t,i){const s=_t(e,t,i);if(s){const{className:o}=s;if(typeof o=="string"&&o.indexOf("ag-icon")>-1||typeof o=="object"&&o["ag-icon"])return s}const n=document.createElement("span");return n.appendChild(s),n}function _t(e,t,i,s){let n=null;const o=i&&i.getColDef().icons;if(o&&(n=o[e]),t&&!n){const r=t.get("icons");r&&(n=r[e])}if(n){let r;if(typeof n=="function")r=n();else if(typeof n=="string")r=n;else throw new Error("icon from grid options needs to be a string or a function");if(typeof r=="string")return ks(r);if(ba(r))return r;z("iconRenderer should return back a string or a dom object")}else{const r=document.createElement("span");let a=pf[e]??(sR.has(e)?e:void 0);return a||(z(`Did not find icon ${e}`),a=""),r.setAttribute("class",`ag-icon ag-icon-${a}`),r.setAttribute("unselectable","on"),ti(r,"presentation"),r}}var oR=class extends ke{constructor(){super(...arguments),this.dragSource=null,this.eIcon=ee,this.eLabel=ee}postConstruct(){const e=t=>nR(t,this.gos,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(`<div class="ag-dnd-ghost ag-unselectable">
5
- <span data-ref="eIcon" class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
6
- <div data-ref="eLabel" class="ag-dnd-ghost-label"></div>
7
- </div>`)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t=!1){var s,n;Lt(this.eIcon);let i=null;e||(e=(s=this.dragSource)!=null&&s.getDefaultIconName?(n=this.dragSource)==null?void 0:n.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns"))&&i&&this.eIcon.appendChild(i)}setLabel(e){this.eLabel.textContent=ps(e)}};function gf(e,t,i){if(i===0)return!1;const s=Math.abs(e.clientX-t.clientX),n=Math.abs(e.clientY-t.clientY);return Math.max(s,n)<=i}var en=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new So,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",n,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",n,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const s={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!gf(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const i={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}};function Mr(e,t){return`<span data-ref="eSort${e}" class="ag-sort-indicator-icon ag-sort-${t} ag-hidden" aria-hidden="true"></span>`}var rR=`<span class="ag-sort-indicator-container">
8
- ${Mr("Order","order")}
9
- ${Mr("Asc","ascending-icon")}
10
- ${Mr("Desc","descending-icon")}
11
- ${Mr("Mixed","mixed-icon")}
12
- ${Mr("None","none-icon")}
13
- </span>`,ru=class extends ke{constructor(e){super(),this.eSortOrder=ee,this.eSortAsc=ee,this.eSortDesc=ee,this.eSortMixed=ee,this.eSortNone=ee,e||this.setTemplate(rR)}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,i,s,n){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=n}setupSort(e,t=!1){if(this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),!this.column.isSortable()&&!this.column.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e);const i=this.updateIcons.bind(this),s=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:s,columnRowGroupChanged:s}),this.onSortChanged()}addInIcon(e,t,i){if(t==null)return;const s=_t(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t=e==="asc";et(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";et(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=e==null;et(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;us(this.gos)&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";et(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,i=e.some(n=>this.sortController.getDisplaySortIndexForColumn(n)??!1),s=t>=0&&i;et(this.eSortOrder,s,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():Lt(this.eSortOrder)}},lR={selector:"AG-SORT-INDICATOR",component:ru},aR=`<div class="ag-cell-label-container" role="presentation">
14
- <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
15
- <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>
16
- <div data-ref="eLabel" class="ag-header-cell-label" role="presentation">
17
- <span data-ref="eText" class="ag-header-cell-text"></span>
18
- <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
19
- <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>
20
- </div>
21
- </div>`,lu=class extends ke{constructor(){super(...arguments),this.eFilter=ee,this.eFilterButton=ee,this.eSortIndicator=ee,this.eMenu=ee,this.eLabel=ee,this.eText=ee,this.eSortOrder=ee,this.eSortAsc=ee,this.eSortDesc=ee,this.eSortMixed=ee,this.eSortNone=ee,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon?!1:(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.params.template??aR;return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[lR]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=ps(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(t==null)return;const s=_t(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new en(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&q(this.eMenu),n=s?new en(this.eMenu,!0):t;if(this.params.enableMenu){const o=s?"tap":"longTap",r=a=>this.params.showColumnMenuAfterMouseClick(a.touchStart);this.addManagedListeners(n,{[o]:r})}if(this.params.enableSorting){const o=r=>{var d,h;const a=r.touchStart.target;i&&((d=this.eMenu)!=null&&d.contains(a)||(h=this.eFilterButton)!=null&&h.contains(a))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:o})}if(this.params.enableFilterButton){const o=new en(this.eFilterButton,!0);this.addManagedListeners(o,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc(()=>o.destroy())}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>n.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){fs(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,i=this.menuService.isLegacyMenuEnabled();if(e&&!i){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new ru(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=new Date().getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:t=>{const i=this.params.column.isMoving(),n=new Date().getTime()-this.lastMovingChanged<50;if(!(i||n)){const a=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(a)}}});const e=()=>{const t=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",t==="asc"),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",t==="desc"),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!t),this.params.column.getColDef().showRowGroup){const i=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),n=!(i==null?void 0:i.every(o=>this.params.column.getSort()==o.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",n)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return fs(t),!1;const s=this.params.column;return this.addInIcon("filter",t,s),this.addManagedListeners(s,{filterChanged:i}),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();et(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},cR=class extends ke{constructor(){super(`<div class="ag-header-group-cell-label" role="presentation">
22
- <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span>
23
- <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
24
- <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
25
- </div>`),this.agOpened=ee,this.agClosed=ee,this.agLabel=ee}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&z("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=n=>{if(Ds(n))return;const o=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),o,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=n=>{Fo(n)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup(),s=this.updateIconVisibility.bind(this);this.addManagedListeners(i,{expandedChanged:s,expandableChanged:s})}addTouchAndClickListeners(e,t){const i=new en(e,!0);this.addManagedListeners(i,{tap:t}),this.addDestroyFunc(()=>i.destroy()),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();et(this.agOpened,t),et(this.agClosed,!t)}else et(this.agOpened,!1),et(this.agClosed,!1)}addInIcon(e,t){const i=_t(e,this.gos,null);i&&t.appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){et(this.agOpened,!1),et(this.agClosed,!1);return}}setupLabel(){var i;const{displayName:e,columnGroup:t}=this.params;if(q(e)){const s=ps(e,!0);this.agLabel.textContent=s}this.addOrRemoveCssClass("ag-sticky-label",!((i=t.getColGroupDef())!=null&&i.suppressStickyLabel))}},dR="↑",uR="↓",hR=class extends ke{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),n=q(s)?s:i,o=t>=0;o?this.eDelta.textContent=dR+n:this.eDelta.textContent=uR+n,this.eDelta.classList.toggle("ag-value-change-delta-up",o),this.eDelta.classList.toggle("ag-value-change-delta-down",!o)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Lt(this.eDelta)}refresh(e,t=!1){var s;const i=e.value;if(i===this.lastValue||(q(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:q(e.value)?this.eValue.textContent=i:Lt(this.eValue),(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof i=="number"&&typeof this.lastValue=="number"){const n=i-this.lastValue;this.showDelta(e,n)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}},pR=class extends ke{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let i=e.value;return Ve(i)&&(i=""),i===this.lastValue||(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()?!1:(t||this.addSlideAnimation(),this.lastValue=i,q(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:q(e.value)?this.eCurrent.textContent=i:Lt(this.eCurrent),!0)}},B=class{};B.BACKSPACE="Backspace",B.TAB="Tab",B.ENTER="Enter",B.ESCAPE="Escape",B.SPACE=" ",B.LEFT="ArrowLeft",B.UP="ArrowUp",B.RIGHT="ArrowRight",B.DOWN="ArrowDown",B.DELETE="Delete",B.F2="F2",B.PAGE_UP="PageUp",B.PAGE_DOWN="PageDown",B.PAGE_HOME="Home",B.PAGE_END="End",B.A="KeyA",B.C="KeyC",B.D="KeyD",B.V="KeyV",B.X="KeyX",B.Y="KeyY",B.Z="KeyZ";var gR=class extends ke{constructor(e,t,i){super(t,i),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:n}=this.config;n!=null&&this.setDisabled(n),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),i!=null&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){Lt(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(et(this.eLabel,!1),ti(this.eLabel,"presentation")):(et(this.eLabel,!0),ti(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const i=this.getGui().classList;return i.toggle("ag-label-align-left",e==="left"),i.toggle("ag-label-align-right",e==="right"),i.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(ya(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Tr(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},ff=class extends gR{constructor(e,t,i,s){super(e,t,i),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),i!=null&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),i=this.getLabel();i==null||i==""||Tb(e)!==null?Pr(e,""):Pr(e,t??"")}setAriaLabel(e){return xo(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return zi(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}},Wn=class extends ff{constructor(e,t,i="text",s="input"){super(e,(e==null?void 0:e.template)??`
26
- <div role="presentation">
27
- <div data-ref="eLabel" class="ag-input-field-label"></div>
28
- <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
29
- <${s} data-ref="eInput" class="ag-input-field-input"></${s}>
30
- </div>
31
- </div>`,[],t),this.inputType=i,this.displayFieldTag=s,this.eLabel=ee,this.eWrapper=ee,this.eInput=ee}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;e!=null&&this.setInputName(e),t!=null&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return ya(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Pi(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return xo(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Tr(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Pi(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";Pi(this.eInput,"autocomplete",t)}return this}},au=class extends Wn{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:i});const s=this.getInputElement();this.eventService.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",e===!0),this.eWrapper.classList.toggle("ag-indeterminate",e==null)}},cu={selector:"AG-CHECKBOX",component:au},fR=class extends ke{constructor(){super(`
32
- <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
33
- <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
34
- </div>`,[cu]),this.eCheckbox=ee}init(e){this.refresh(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),qg(t,"polite"),this.addManagedListeners(t,{click:i=>{if(Fo(i),this.eCheckbox.isDisabled())return;const s=this.eCheckbox.getValue();this.onCheckboxChanged(s)},dblclick:i=>{Fo(i)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:i=>{if(i.key===B.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===Je(this.gos)&&this.eCheckbox.toggle();const s=this.eCheckbox.getValue();this.onCheckboxChanged(s),i.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var a;let t,i=!0;if(e.node.group&&e.column)if(typeof e.value=="boolean")t=e.value;else{const d=e.column.getColId();d.startsWith(ua)?t=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[d]!==void 0?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(t);const s=e.disabled!=null?e.disabled:!((a=e.column)!=null&&a.isCellEditable(e.node));this.eCheckbox.setDisabled(s);const n=this.localeService.getLocaleTextFunc(),o=$d(n,t),r=s?o:`${n("ariaToggleCellValue","Press SPACE to toggle cell value")} (${o})`;this.eCheckbox.setInputAriaLabel(r)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params;this.eventService.dispatchEvent({type:"cellEditingStarted",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s});const n=this.params.node.setDataValue(this.params.column,e,"edit");this.eventService.dispatchEvent({type:"cellEditingStopped",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:n}),n||this.updateCheckbox(this.params)}},mR=class extends ke{constructor(){super(`<div class="ag-loading">
35
- <span class="ag-loading-icon" data-ref="eLoadingIcon"></span>
36
- <span class="ag-loading-text" data-ref="eLoadingText"></span>
37
- </div>`),this.eLoadingIcon=ee,this.eLoadingText=ee}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=_t("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},CR=class extends ke{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>Pr(e.eParentOfValue)),Pr(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");xo(this.getGui(),t)}setupLoading(e){const i=lt(this.gos).createElement("div");i.classList.add("ag-skeleton-effect");const s=e.node.rowIndex;if(s!=null){const r=75+25*(s%2===0?Math.sin(s):Math.cos(s));i.style.width=`${r}%`}this.getGui().appendChild(i);const o=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");xo(this.getGui(),o)}refresh(e){return!1}destroy(){super.destroy()}},mf=class extends ke{constructor(){super()}destroy(){super.destroy()}},vR=class extends mf{init(){var t;const e=Gi((t=this.gos.get("overlayLoadingTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}},wR=class extends mf{init(){var t;const e=Gi((t=this.gos.get("overlayNoRowsTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}},Mo=class extends ke{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},SR=class extends Mo{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=ps(t,!0)}};function yR(e,t,i){const s={},n=e.filter(o=>!t.some(r=>r===o));return n.length>0&&n.forEach(o=>s[o]=Cf(o,i).values),s}function Cf(e,t,i,s){let n=t.map((a,d)=>({value:a,relevance:bR(e.toLowerCase(),a.toLocaleLowerCase()),idx:d}));if(n.sort((a,d)=>d.relevance-a.relevance),i&&(n=n.filter(a=>a.relevance!==0)),n.length>0&&s&&s>0){const d=n[0].relevance*s;n=n.filter(h=>d-h.relevance<0)}const o=[],r=[];for(const a of n)o.push(a.value),r.push(a.idx);return{values:o,indices:r}}function bR(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let n=0,o=-1;for(let r=0;r<i.length;r++){const a=s.indexOf(i[r],o+1);a!==-1&&(o=a,n+=100-o*100/1e4*100)}return n}var RR=class extends G{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agDragAndDropImage:oR,agColumnHeader:lu,agColumnGroupHeader:cR,agSortIndicator:ru,agAnimateShowChangeCellRenderer:hR,agAnimateSlideCellRenderer:pR,agLoadingCellRenderer:mR,agSkeletonCellRenderer:CR,agCheckboxCellRenderer:fR,agLoadingOverlay:vR,agNoRowsOverlay:wR,agTooltipComponent:SR},this.agGridDefaultParams={},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");e!=null&&Ei(e,(t,i)=>this.registerJsComponent(t,i))}registerDefaultComponent(e,t,i){this.agGridDefaults[e]=t,i&&(this.agGridDefaultParams[e]=i)}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(a,d,h)=>({componentFromFramework:d,component:a,params:h}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(s!=null)return i(s,!0);const n=this.jsComps[t];if(n){const a=this.getFrameworkOverrides().isFrameworkComponent(n);return i(n,a)}const o=this.agGridDefaults[t];if(o)return i(o,!1,this.agGridDefaultParams[t]);const r=this.enterpriseAgDefaultCompsModule[t];return r?this.gos.assertModuleRegistered(r,`AG Grid '${e}' component: ${t}`):Sd(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(n=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(n)),...Object.keys(this.jsComps)],s=Cf(t,i,!0,.8).values;z(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&z(` Did you mean: [${s.slice(0,3)}]?`),z(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},ui=class Xl{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return t.length?new Xl(i=>{let s=t.length;const n=new Array(s);t.forEach((o,r)=>{o.then(a=>{n[r]=a,s--,s===0&&i(n)})})}):Xl.resolve()}static resolve(t=null){return new Xl(i=>i(t))}then(t){return new Xl(i=>{this.status===1?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){}},FR={propertyName:"dateComponent",cellRenderer:!1},ER={propertyName:"dragAndDropImageComponent",cellRenderer:!1},xR={propertyName:"headerComponent",cellRenderer:!1},PR={propertyName:"headerGroupComponent",cellRenderer:!1},vf={propertyName:"cellRenderer",cellRenderer:!0},DR={propertyName:"cellRenderer",cellRenderer:!1},TR={propertyName:"loadingCellRenderer",cellRenderer:!0},AR={propertyName:"cellEditor",cellRenderer:!1},wf={propertyName:"innerRenderer",cellRenderer:!0},MR={propertyName:"loadingOverlayComponent",cellRenderer:!1},kR={propertyName:"noRowsOverlayComponent",cellRenderer:!1},IR={propertyName:"tooltipComponent",cellRenderer:!1},du={propertyName:"filter",cellRenderer:!1},LR={propertyName:"floatingFilterComponent",cellRenderer:!1},_R={propertyName:"toolPanel",cellRenderer:!1},OR={propertyName:"statusPanel",cellRenderer:!1},VR={propertyName:"fullWidthCellRenderer",cellRenderer:!0},NR={propertyName:"loadingCellRenderer",cellRenderer:!0},BR={propertyName:"groupRowRenderer",cellRenderer:!0},GR={propertyName:"detailCellRenderer",cellRenderer:!0},HR={propertyName:"menuItem",cellRenderer:!1},Sf=class my extends G{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(t){this.agComponentUtils=t.agComponentUtils,this.componentMetadataProvider=t.componentMetadataProvider,this.userComponentRegistry=t.userComponentRegistry,this.frameworkComponentWrapper=t.frameworkComponentWrapper,this.gridOptions=t.gridOptions}getDragAndDropImageCompDetails(t){return this.getCompDetails(this.gridOptions,ER,"agDragAndDropImage",t,!0)}getHeaderCompDetails(t,i){return this.getCompDetails(t,xR,"agColumnHeader",i)}getHeaderGroupCompDetails(t){const i=t.columnGroup.getColGroupDef();return this.getCompDetails(i,PR,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,VR,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,NR,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,BR,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,GR,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,i){return this.getCompDetails(t,wf,null,i)}getFullWidthGroupRowInnerCellRenderer(t,i){return this.getCompDetails(t,wf,null,i)}getCellRendererDetails(t,i){return this.getCompDetails(t,vf,null,i)}getEditorRendererDetails(t,i){return this.getCompDetails(t,DR,null,i)}getLoadingCellRendererDetails(t,i){return this.getCompDetails(t,TR,"agSkeletonCellRenderer",i,!0)}getCellEditorDetails(t,i){return this.getCompDetails(t,AR,"agCellEditor",i,!0)}getFilterDetails(t,i,s){return this.getCompDetails(t,du,s,i,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,FR,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,MR,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,kR,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,IR,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,i){return this.getCompDetails(t,vf,null,i)}getFloatingFilterCompDetails(t,i,s){return this.getCompDetails(t,LR,s,i)}getToolPanelCompDetails(t,i){return this.getCompDetails(t,_R,null,i,!0)}getStatusPanelCompDetails(t,i){return this.getCompDetails(t,OR,null,i,!0)}getMenuItemCompDetails(t,i){return this.getCompDetails(t,HR,"agMenuItem",i,!0)}getCompDetails(t,i,s,n,o=!1){const{propertyName:r,cellRenderer:a}=i;let{compName:d,jsComp:h,fwComp:p,paramsFromSelector:f,popupFromSelector:m,popupPositionFromSelector:v}=my.getCompKeys(this.frameworkOverrides,t,i,n),w;const S=T=>{const I=this.userComponentRegistry.retrieve(r,T);I&&(h=I.componentFromFramework?void 0:I.component,p=I.componentFromFramework?I.component:void 0,w=I.params)};if(d!=null&&S(d),h==null&&p==null&&s!=null&&S(s),h&&a&&!this.agComponentUtils.doesImplementIComponent(h)&&(h=this.agComponentUtils.adaptFunction(r,h)),!h&&!p){o&&We(`Could not find component ${d}, did you forget to configure this component?`);return}const b=this.mergeParamsWithApplicationProvidedParams(t,i,n,f,w),R=h==null,x=h||p;return{componentFromFramework:R,componentClass:x,params:b,type:i,popupFromSelector:m,popupPositionFromSelector:v,newAgStackInstance:()=>this.newAgStackInstance(x,R,b,i)}}static getCompKeys(t,i,s,n){const{propertyName:o}=s;let r,a,d,h,p,f;if(i){const m=i,v=m[o+"Selector"],w=v?v(n):null,S=b=>{typeof b=="string"?r=b:b!=null&&b!==!0&&(t.isFrameworkComponent(b)?d=b:a=b)};w?(S(w.component),h=w.params,p=w.popup,f=w.popupPosition):S(m[o])}return{compName:r,jsComp:a,fwComp:d,paramsFromSelector:h,popupFromSelector:p,popupPositionFromSelector:f}}newAgStackInstance(t,i,s,n){const o=n.propertyName,r=!i;let a;if(r)a=new t;else{const h=this.componentMetadataProvider.retrieve(o);a=this.frameworkComponentWrapper.wrap(t,h.mandatoryMethodList,h.optionalMethodList,n)}const d=this.initComponent(a,s);return d==null?ui.resolve(a):d.then(()=>a)}mergeParamsWithApplicationProvidedParams(t,i,s,n=null,o){const r=this.gos.getGridCommonParams();Ut(r,s),o&&Ut(r,o);const a=t,d=a&&a[i.propertyName+"Params"];if(typeof d=="function"){const h=d(s);Ut(r,h)}else typeof d=="object"&&Ut(r,d);return Ut(r,n),r}initComponent(t,i){if(this.createBean(t),t.init!=null)return t.init(i)}};function kr(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var Ra=class Ze{static register(t){Ze.__register(t,!0,void 0)}static registerModules(t){Ze.__registerModules(t,!0,void 0)}static __register(t,i,s){Ze.runVersionChecks(t),s!==void 0?(Ze.areGridScopedModules=!0,Ze.gridModulesMap[s]===void 0&&(Ze.gridModulesMap[s]={}),Ze.gridModulesMap[s][t.moduleName]=t):Ze.globalModulesMap[t.moduleName]=t,Ze.setModuleBased(i)}static __unRegisterGridModules(t){delete Ze.gridModulesMap[t]}static __registerModules(t,i,s){Ze.setModuleBased(i),t&&t.forEach(n=>Ze.__register(n,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[n,o]=Ze.currentModuleVersion.split(".")||[];return i===n&&s===o}static runVersionChecks(t){Ze.currentModuleVersion||(Ze.currentModuleVersion=t.version);const i=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;if(t.version?Ze.isValidModuleVersion(t)||We(i(`'${t.moduleName}' is version ${t.version} but the other modules are version ${Ze.currentModuleVersion}.`)):We(i(`'${t.moduleName}' is incompatible.`)),t.validate){const s=t.validate();s.isValid||We(`${s.message}`)}}static setModuleBased(t){Ze.moduleBased===void 0?Ze.moduleBased=t:Ze.moduleBased!==t&&(We("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),We("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){Ze.isBundled=!0}static __assertRegistered(t,i,s){var o;if(this.__isRegistered(t,s))return!0;let n;if(Ze.isBundled)n=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:
38
-
39
- <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>
40
-
41
- For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(Ze.moduleBased||Ze.moduleBased===void 0){const r=(o=Object.entries(Rt).find(([a,d])=>d===t))==null?void 0:o[0];n=`AG Grid: unable to use ${i} as the ${r} is not registered${Ze.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:
42
-
43
- import { ModuleRegistry } from '@ag-grid-community/core';
44
- import { ${r} } from '${t}';
45
-
46
- ModuleRegistry.registerModules([ ${r} ]);
47
-
48
- For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
49
-
50
- import 'ag-grid-enterprise';`;return We(n),!1}static __isRegistered(t,i){var s;return!!Ze.globalModulesMap[t]||!!((s=Ze.gridModulesMap[i])!=null&&s[t])}static __getRegisteredModules(t){return[...ta(Ze.globalModulesMap),...ta(Ze.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){return ta(Ze.gridModulesMap[t]??{})||[]}static __isPackageBased(){return!Ze.moduleBased}};Ra.globalModulesMap={},Ra.gridModulesMap={},Ra.areGridScopedModules=!1;var Is=Ra,WR=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,!(!e||!e.beanClasses)&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){var t;Object.entries(e.providedBeanInstances).forEach(([i,s])=>{this.beans[i]=s}),e.beanClasses.forEach(i=>{const s=new i;s.beanName?this.beans[s.beanName]=s:console.error(`Bean ${i.name} is missing beanName`),this.createdBeans.push(s)}),(t=e.derivedBeans)==null||t.forEach(i=>{const{beanName:s,bean:n}=i(this);this.beans[s]=n,this.createdBeans.push(n)}),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach(i=>{var s,n;(s=i.preWireBeans)==null||s.call(i,this.beans),(n=i.wireBeans)==null||n.call(i,this.beans)}),e.forEach(i=>{var s;return(s=i.preConstruct)==null?void 0:s.call(i)}),t&&e.forEach(t),e.forEach(i=>{var s;return(s=i.postConstruct)==null?void 0:s.call(i)})}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){var t;(t=e==null?void 0:e.destroy)==null||t.call(e)}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},zR=class extends WR{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),Is.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},yf=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(yf||{}),UR=class extends G{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment,this.userComponentFactory=e.userComponentFactory}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}getDragAndDropImageComponent(){const{dragAndDropImageComp:e}=this;return!e||!e.comp?null:e.comp}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),kt(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){var i,s;this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),(s=(i=this.dragSource).onDragStarted)==null||s.call(i),this.createDragAndDropImageComponent()}onDragStop(e){var t,i,s;if((i=(t=this.dragSource)==null?void 0:t.onDragStopped)==null||i.call(t),(s=this.lastDropTarget)!=null&&s.onDragStop){const n=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(n)}this.clearDragAndDropProperties()}onDragCancel(){var e,t,i;(t=(e=this.dragSource)==null?void 0:e.onDragCancelled)==null||t.call(e),(i=this.lastDropTarget)!=null&&i.onDragCancel&&this.lastDropTarget.onDragCancel(this.createDropTargetEvent(this.lastDropTarget,this.eventLastTime,null,null,!1)),this.clearDragAndDropProperties()}clearDragAndDropProperties(){this.eventLastTime=null,this.dragging=!1,this.lastDropTarget=void 0,this.dragItem=null,this.dragSource=null,this.removeDragAndDropImageComponent()}onDragging(e,t=!1){var r,a,d,h;const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionDragAndDropImageComp(e);const n=this.dropTargets.filter(p=>this.isMouseOnDropTarget(e,p)),o=this.findCurrentDropTarget(e,n);if(o!==this.lastDropTarget){if(this.leaveLastTargetIfExists(e,i,s,t),this.lastDropTarget!==null&&o===null&&((a=(r=this.dragSource)==null?void 0:r.onGridExit)==null||a.call(r,this.dragItem)),this.lastDropTarget===null&&o!==null&&((h=(d=this.dragSource)==null?void 0:d.onGridEnter)==null||h.call(d,this.dragItem)),this.enterDragTargetIfExists(o,e,i,s,t),o&&this.dragAndDropImageComp){const{comp:p,promise:f}=this.dragAndDropImageComp;p?p.setIcon(o.getIconName?o.getIconName():null):f.then(m=>{m&&m.setIcon(o.getIconName?o.getIconName():null)})}this.lastDropTarget=o}else if(o&&o.onDragging){const p=this.createDropTargetEvent(o,e,i,s,t);o.onDragging(p)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const{width:s,height:n,left:o,right:r,top:a,bottom:d}=i.getBoundingClientRect();if(s===0||n===0)return!1;const h=e.clientX>=o&&e.clientX<r,p=e.clientY>=a&&e.clientY<d;if(!h||!p)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const r of i)if(this.allContainersIntersect(e,r)){s=!0;break}const{eElement:n,type:o}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(n)?!1:s&&t.isInterestedIn(o,n)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const n=br(this.gos).elementsFromPoint(e.clientX,e.clientY);for(const o of n)for(const r of t)if(Qy(this.getAllContainersFromDropTarget(r)).indexOf(o)!==-1)return r;return null}enterDragTargetIfExists(e,t,i,s,n){if(e&&e.onDragEnter){const o=this.createDropTargetEvent(e,t,i,s,n);e.onDragEnter(o)}}leaveLastTargetIfExists(e,t,i,s){if(!this.lastDropTarget)return;if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}const n=this.getDragAndDropImageComponent();n&&n.setIcon(null)}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return i.contains(s)}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,n){const o=e.getContainer(),r=o.getBoundingClientRect(),{dragItem:a,dragSource:d}=this,h=t.clientX-r.left,p=t.clientY-r.top;return this.gos.addGridCommonParams({event:t,x:h,y:p,vDirection:s,hDirection:i,dragSource:d,fromNudge:n,dragItem:a,dropZoneTarget:o})}positionDragAndDropImageComp(e){const t=this.getDragAndDropImageComponent();if(!t)return;const i=t.getGui(),n=i.getBoundingClientRect().height,o=zb()-2,r=Ub()-2;if(!i.offsetParent)return;const d=of(i.offsetParent),{clientY:h,clientX:p}=e;let f=h-d.top-n/2,m=p-d.left-10;const v=lt(this.gos),w=v.defaultView||window,S=w.pageYOffset||v.documentElement.scrollTop,b=w.pageXOffset||v.documentElement.scrollLeft;o>0&&m+i.clientWidth>o+b&&(m=o+b-i.clientWidth),m<0&&(m=0),r>0&&f+i.clientHeight>r+S&&(f=r+S-i.clientHeight),f<0&&(f=0),i.style.left=`${m}px`,i.style.top=`${f}px`}removeDragAndDropImageComponent(){if(this.dragAndDropImageComp){const{comp:e}=this.dragAndDropImageComp;if(e){const t=e.getGui();this.dragAndDropImageParent&&this.dragAndDropImageParent.removeChild(t),this.destroyBean(e)}}this.dragAndDropImageComp=null}createDragAndDropImageComponent(){const{dragSource:e}=this;if(!e)return;const i=this.userComponentFactory.getDragAndDropImageCompDetails({dragSource:e}).newAgStackInstance();this.dragAndDropImageComp={promise:i},i.then(s=>{!s||!this.isAlive()||(this.processDragAndDropImageComponent(s),this.dragAndDropImageComp.comp=s)})}processDragAndDropImageComponent(e){const{dragSource:t,mouseEventService:i,environment:s}=this;if(!t)return;const n=e.getGui();n.style.setProperty("position","absolute"),n.style.setProperty("z-index","9999"),i.stampTopLevelGridCompWithGridInstance(n),s.applyThemeClasses(n),e.setIcon(null);let{dragItemName:o}=t;yd(o)&&(o=o()),e.setLabel(o||""),n.style.top="20px",n.style.left="20px";const r=lt(this.gos);let a=null,d=null;try{a=r.fullscreenElement}catch{}finally{a||(a=br(this.gos));const h=a.querySelector("body");h?d=h:a instanceof ShadowRoot?d=a:a instanceof Document?d=a==null?void 0:a.documentElement:d=a}this.dragAndDropImageParent=d,d?d.appendChild(n):z("Could not find document body, it is needed for drag and drop.")}},bf=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.indexOf("x")!==-1,this.scrollVertically=e.scrollAxis.indexOf("y")!==-1,this.scrollByTick=e.scrollByTick!=null?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),n=this.scrollByTick;this.tickLeft=e.clientX<s.left+n,this.tickRight=e.clientX>s.right-n,this.tickUp=e.clientY<s.top+n&&!i,this.tickDown=e.clientY>s.bottom-n&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Fa=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(Fa||{}),$R=class extends G{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){st(this.gos)&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(this,e=>{const t=e.gridBodyCtrl;this.autoScrollService=new bf({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:i=>t.getScrollFeature().setVerticalScrollPosition(i),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){var s;return!!(this.funcColsService.getRowGroupColumns().length||((s=this.filterManager)==null?void 0:s.isAnyFilterPresent())||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=[...this.selectionService.getSelectedNodes()].sort((n,o)=>n.rowIndex==null||o.rowIndex==null?0:this.getRowIndexNumber(n)-this.getRowIndexNumber(o));if(s.indexOf(t)!==-1)return s}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach(t=>{t.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),n=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.clientSideRowModel.highlightRowAtPixel(n[0],t):this.moveRows(n,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(he(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===1,s=this.mouseEventService.getNormalisedPosition(e).y,n=e.dragItem.rowNodes;let o=i?1:0;if(this.isFromThisGrid(e))n.forEach(r=>{r.rowTop<s&&(o-=1)}),this.moveRows(n,s,o);else{const r=bo(this.gos);let a=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===0&&a--,this.clientSideRowModel.updateRowData({add:n.filter(d=>!this.clientSideRowModel.getRowNode((r==null?void 0:r({data:d.data,level:0,rowPinned:d.rowPinned}))??d.data.id)).map(d=>d.data),addIndex:a})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var n;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),(n=this.rangeService)==null||n.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){z("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(e)){z("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=s=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",s))}),e.onDragLeave&&(t.onDragLeave=s=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",s))}),e.onDragging&&(t.onDragging=s=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",s))}),e.onDragStop&&(t.onDragStop=s=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",s))}),e.onDragCancel&&(t.onDragCancel=s=>{e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",s))}));const i={isInterestedIn:s=>s===2,getIconName:()=>"move",external:!0,...t};this.dragAndDropService.addDropTarget(i),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(i))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),n=this.onDragging.bind(this),o=this.onDragStop.bind(this),r=this.onDragCancel.bind(this);let a;return e?a={getContainer:t,onDragEnter:e.onDragEnter?d=>{i(d),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",d))}:i,onDragLeave:e.onDragLeave?d=>{s(d),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",d))}:s,onDragging:e.onDragging?d=>{n(d),e.onDragging(this.draggingToRowDragEvent("rowDragMove",d))}:n,onDragStop:e.onDragStop?d=>{o(d),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",d))}:o,onDragCancel:e.onDragCancel?d=>{r(d),e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",d))}:r,fromGrid:!0}:a={getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:n,onDragStop:o,onDragCancel:r,fromGrid:!0},a}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,s=i>this.pageBoundsService.getCurrentPageHeight();let n=-1,o;s||(n=this.rowModel.getRowIndexAtPixel(i),o=this.rowModel.getRow(n));let r;switch(t.vDirection){case 1:r="down";break;case 0:r="up";break;default:r=null;break}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:o,y:i,vDirection:r})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.clearRowHighlight()}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}},KR=class extends G{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const s=e.touchStartListener;t.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),kt(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:n}=e;i.addEventListener("mousedown",t);let o=null;const r=this.gos.get("suppressTouch");s&&!r&&(o=a=>{nu(a.target)||(n&&a.stopPropagation(),this.onTouchStart(e,a))},i.addEventListener("touchstart",o,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:o,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=d=>this.onTouchMove(d,e.eElement),n=d=>this.onTouchUp(d,e.eElement),o=d=>{d.cancelable&&d.preventDefault()},r=t.target,a=[{target:br(this.gos),type:"touchmove",listener:o,options:{passive:!1}},{target:r,type:"touchmove",listener:s,options:{passive:!0}},{target:r,type:"touchend",listener:n,options:{passive:!0}},{target:r,type:"touchcancel",listener:n,options:{passive:!0}}];this.addTemporaryEvents(a),e.dragStartPixels===0&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._alreadyProcessedByDragService=!0,t.button!==0))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=h=>this.onMouseMove(h,e.eElement),n=h=>this.onMouseUp(h,e.eElement),o=h=>h.preventDefault(),r=h=>{h.key===B.ESCAPE&&this.cancelDrag(e.eElement)},a=br(this.gos),d=[{target:a,type:"mousemove",listener:s},{target:a,type:"mouseup",listener:n},{target:a,type:"contextmenu",listener:o},{target:a,type:"keydown",listener:r}];this.addTemporaryEvents(d),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:s,listener:n,options:o}=t;i.addEventListener(s,n,o)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:n,options:o}=t;i.removeEventListener(s,n,o)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,s=q(i)?i:4;return gf(e,t,s)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(this.isEventNearStartEvent(e,t))return;this.dragging=!0,this.eventService.dispatchEvent({type:"dragStarted",target:i}),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;gs()&&((i=lt(this.gos).getSelection())==null||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i=e.type==="mousemove";return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t==null?void 0:t.tagName.toLocaleLowerCase();return!!(i!=null&&i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){this.dragging&&(this.dragging=!1,this.currentDragParams.onDragStop(e),this.eventService.dispatchEvent({type:"dragStopped",target:t})),this.resetDragProperties()}cancelDrag(e){var t,i;this.eventService.dispatchEvent({type:"dragCancelled",target:e}),(i=(t=this.currentDragParams)==null?void 0:t.onDragCancel)==null||i.call(t),this.resetDragProperties()}resetDragProperties(){this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}},uu=class extends ke{constructor(e,t,i,s,n,o){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=n,this.suppressVisibilityChange=o,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(_t("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new ZR(this,this.beans,this.rowNode,this.column):new jR(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&z("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getGui();this.gos.get("enableCellTextSelection")&&(this.removeMouseDownListener(),this.mouseDownListener=this.addManagedElementListeners(t,{mousedown:s=>{s==null||s.preventDefault()}})[0]);const i=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:()=>{var r;const s=this.getDragItem(),n=((r=s.rowNodes)==null?void 0:r.length)||1,o=this.getRowDragText(this.column);return o?o(s,n):n===1?this.cellValueFn():`${n} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},Rf=class extends G{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,s=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=yd(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}},jR=class extends Rf{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},ZR=class extends Rf{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),i=t&&t.shouldPreventRowMove(),s=this.gos.get("suppressRowDrag"),n=this.beans.dragAndDropService.hasExternalDropZones(),o=i&&!n||s;this.setDisplayedOrVisible(o)}},qR=new Set(["localEventService","__objectId","sticky","__autoHeights","checkAutoHeightsDebounced"]),Ir=class Mn{constructor(t){this.rowIndex=null,this.key=null,this.sourceRowIndex=-1,this.childrenMapped={},this.treeNode=null,this.treeNodeFlags=0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=Mn.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(t){this.setDataCommon(t,!1)}updateData(t){this.setDataCommon(t,!0)}setDataCommon(t,i){var o;const s=this.data;this.data=t,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(t,s,i);(o=this.localEventService)==null||o.dispatchEvent(n)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:"dataChanged",node:this,oldData:i,newData:t,update:s}}getRowIndexString(){return this.rowIndex==null?(We("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):this.rowPinned==="top"?Mn.ID_PREFIX_TOP_PINNED+this.rowIndex:this.rowPinned==="bottom"?Mn.ID_PREFIX_BOTTOM_PINNED+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new Mn(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(t,i){var r;const s=q(this.id)?this.createDaemonNode():null,n=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const o=this.createDataChangedEvent(t,n,!1);(r=this.localEventService)==null||r.dispatchEvent(o)}checkRowSelectable(){const t=Ad(this.beans.gos);this.setRowSelectable(t?t(this):!0)}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.dispatchRowEvent("selectableChanged"),i)return;if(Nn(this.beans.gos)){const n=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:n??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){var s;const i=bo(this.beans.gos);if(i)if(this.data){const n=((s=this.parent)==null?void 0:s.getRoute())??[];this.id=i({data:this.data,parentKeys:n.length>0?n:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(Mn.ID_PREFIX_ROW_GROUP)&&We(`Row IDs cannot start with ${Mn.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.dispatchRowEvent("topChanged"),this.setDisplayed(t!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(t){this.hovered=t}isHovered(){return this.hovered}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.dispatchRowEvent("masterChanged"))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(t,i){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[i.getId()]=t,t!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=Wt(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){var a;let t=!1,i=!0,s=0;const n=this.__autoHeights;if(n==null||(this.beans.visibleColsService.getAllAutoHeightCols().forEach(d=>{let h=n[d.getId()];if(h==null)if(this.beans.columnModel.isColSpanActive()){let p=[];switch(d.getPinned()){case"left":p=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":p=this.beans.visibleColsService.getRightColsForRow(this);break;case null:p=this.beans.columnViewportService.getColsWithinViewport(this);break}if(p.includes(d)){t=!0;return}h=-1}else{t=!0;return}else i=!1;h>s&&(s=h)}),t)||((i||s<10)&&(s=qs(this.beans.gos,this).height),s==this.rowHeight))return;this.setRowHeight(s);const r=this.beans.rowModel;(a=r.onRowHeightChangedDebounced)==null||a.call(r)}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.dispatchRowEvent("expandedChanged");const n={...this.createGlobalRowEvent("rowGroupOpened"),expanded:t,event:i||null};this.beans.rowNodeEventThrottle.dispatchExpanded(n,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(t){return this.beans.gos.addGridCommonParams({type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(t,i,s){const o=typeof t!="string"?t:this.beans.columnModel.getCol(t)??this.beans.columnModel.getColDefCol(t),r=this.beans.valueService.getValueForDisplay(o,this);if(this.beans.gos.get("readOnlyEdit"))return this.beans.eventService.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:o,colDef:o.getColDef(),data:this.data,node:this,oldValue:r,newValue:i,value:i,source:s}),!1;const a=this.beans.valueService.setValue(this,o,i,s);return this.dispatchCellChangedEvent(o,i,r),this.checkRowSelectable(),a}setGroupValue(t,i){const s=this.beans.columnModel.getCol(t);Ve(this.groupData)&&(this.groupData={});const n=s.getColId(),o=this.groupData[n];o!==i&&(this.groupData[n]=i,this.dispatchCellChangedEvent(s,i,o))}setAggData(t){const i=this.aggData;if(this.aggData=t,this.localEventService){const s=n=>{const o=this.aggData?this.aggData[n]:void 0,r=i?i[n]:void 0;if(o===r)return;const a=this.beans.columnModel.getCol(n);a&&this.dispatchCellChangedEvent(a,o,r)};for(const n in i)s(n);for(const n in t)(!i||!(n in i))&&s(n)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(xs(this.beans.gos)){const s=this.beans.gos.get("treeData"),n=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(s?!!n&&n(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(t,i,s){var o;const n={type:"cellChanged",node:this,column:t,newValue:i,oldValue:s};(o=this.localEventService)==null||o.dispatchEvent(n)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(i=>i.depthFirstSearch(t)),t(this)}calculateSelectedFromChildren(){var s;let t=!1,i=!1;if(!((s=this.childrenAfterGroup)!=null&&s.length))return this.selectable?this.selected:null;for(let n=0;n<this.childrenAfterGroup.length;n++){const o=this.childrenAfterGroup[n];let r=o.isSelected();if(!o.selectable){const a=o.calculateSelectedFromChildren();if(a===null)continue;r=a}switch(r){case!0:t=!0;break;case!1:i=!0;break;default:return}}if(!(t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(t){this.selected=t}dispatchRowEvent(t){var i;(i=this.localEventService)==null||i.dispatchEvent({type:t,node:this})}selectThisNode(t,i,s="api"){const n=!this.selectable&&t,o=this.selected===t;if(n||o)return!1;this.selected=t,this.dispatchRowEvent("rowSelected");const r=this.sibling;return r&&r.footer&&r.localEventService&&r.dispatchRowEvent("rowSelected"),this.beans.eventService.dispatchEvent({...this.createGlobalRowEvent("rowSelected"),event:i||null,source:s}),!0}setSelected(t,i=!1,s="api"){if(typeof s=="boolean"){z("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:t,clearSelection:i,rangeSelect:!1,source:s})}setSelectedParams(t){return this.rowPinned?(z("cannot select pinned rows"),0):this.id===void 0?(z("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...t,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return!!this.rowPinned}addEventListener(t,i){var n;this.localEventService||(this.localEventService=new So),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new Vd(this.beans.frameworkOverrides));const s=((n=this.frameworkEventListenerService)==null?void 0:n.wrap(i))??i;this.localEventService.addEventListener(t,s)}removeEventListener(t,i){var n;if(!this.localEventService)return;const s=((n=this.frameworkEventListenerService)==null?void 0:n.unwrap(i))??i;this.localEventService.removeEventListener(t,s),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}isFullWidthCell(){if(z("since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option."),this.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const t=[];let i=this;for(;i&&i.key!=null;)t.push(i.key),i=i.parent;return t.reverse()}createFooter(){if(this.sibling)return;const t=new Mn(this.beans);Object.keys(this).forEach(i=>{qR.has(i)||(t[i]=this[i])}),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,t.id="rowGroupFooter_"+this.id,t.sibling=this,this.sibling=t}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.dispatchRowEvent("firstChildChanged"))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.dispatchRowEvent("lastChildChanged"))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.dispatchRowEvent("childIndexChanged"))}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.dispatchRowEvent("draggingChanged"))}setHighlighted(t){this.highlighted!==t&&(this.highlighted=t,this.dispatchRowEvent("rowHighlightChanged"))}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.dispatchRowEvent("allChildrenCountChanged"))}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.dispatchRowEvent("rowIndexChanged"))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.dispatchRowEvent("uiLevelChanged"))}};Ir.ID_PREFIX_ROW_GROUP="row-group-",Ir.ID_PREFIX_TOP_PINNED="t-",Ir.ID_PREFIX_BOTTOM_PINNED="b-",Ir.OBJECT_ID_SEQUENCE=0;var Ls=Ir,YR=class extends G{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvancedFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:i})=>this.onAdvancedFilterEnabledChanged(i),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",i=>this.setAdvancedFilterModel(i.currentValue)),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setFilterModel(e,t="api"){var i;if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}(i=this.columnFilterService)==null||i.setFilterModel(e,t)}getFilterModel(){var e;return((e=this.columnFilterService)==null?void 0:e.getFilterModel())??{}}isColumnFilterPresent(){var e;return!!((e=this.columnFilterService)!=null&&e.isColumnFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.columnFilterService)!=null&&e.isAggregateFilterPresent())}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t,i;e?(t=this.columnFilterService)!=null&&t.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):(i=this.advancedFilterService)!=null&&i.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!((e=this.advancedFilterService)!=null&&e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){var e;(e=this.quickFilterService)==null||e.resetQuickFilterCache()}refreshFiltersForAggregations(){Pd(this.gos)&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):ui.resolve()).then(()=>{var o;const n={source:t,type:"filterChanged",columns:s};i&&Ut(n,i),this.eventService.dispatchEvent(n),(o=this.columnFilterService)==null||o.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.columnFilterService)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilterService)!=null&&e.isQuickFilterPresent())}updateAggFiltering(){this.aggFiltering=!!Pd(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}isFilterActive(e){var t;return!!((t=this.columnFilterService)!=null&&t.isFilterActive(e))}getOrCreateFilterWrapper(e){var t;return((t=this.columnFilterService)==null?void 0:t.getOrCreateFilterWrapper(e))??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){var t;return this.isAdvancedFilterEnabled()?!1:!!((t=this.columnFilterService)!=null&&t.isFilterAllowed(e))}getFloatingFilterCompDetails(e,t){var i;return(i=this.columnFilterService)==null?void 0:i.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){var t;return(t=this.columnFilterService)==null?void 0:t.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){var i;(i=this.columnFilterService)==null||i.destroyFilter(e,t)}areFilterCompsDifferent(e,t){var i;return!!((i=this.columnFilterService)!=null&&i.areFilterCompsDifferent(e,t))}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){var t;if(this.isAdvancedFilterEnabled()){if((t=this.dataTypeService)!=null&&t.isPendingInference()){this.advancedFilterModelUpdateQueue.push(e);return}this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvancedFilterEnabled()?!1:!!((e=this.columnFilterService)!=null&&e.hasFloatingFilters())}getFilterInstance(e,t){var i;if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}return(i=this.columnFilterService)==null?void 0:i.getFilterInstance(e,t)}getColumnFilterInstance(e){var t;return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):((t=this.columnFilterService)==null?void 0:t.getColumnFilterInstance(e))??Promise.resolve(void 0)}warnAdvancedFilters(){z("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;(t=this.advancedFilterService)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){var t;return(t=this.columnFilterService)==null?void 0:t.getColumnFilterModel(e)}setColumnFilterModel(e,t){var i;return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):((i=this.columnFilterService)==null?void 0:i.setColumnFilterModel(e,t))??Promise.resolve()}setColDefPropertiesForDataType(e,t,i){var s;(s=this.columnFilterService)==null||s.setColDefPropertiesForDataType(e,t,i)}},QR=class extends ke{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){var e;return((e=this.filterWrapper)==null?void 0:e.filterPromise)??null}afterInit(){var e,t;return((t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null?void 0:t.then(()=>{}))??ui.resolve()}afterGuiAttached(e){var t,i;(i=(t=this.filterWrapper)==null?void 0:t.filterPromise)==null||i.then(s=>{var n;(n=s==null?void 0:s.afterGuiAttached)==null||n.call(s,e)})}afterGuiDetached(){var e,t;(t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null||t.then(i=>{var s;(s=i==null?void 0:i.afterGuiDetached)==null||s.call(i)})}createFilter(e){var s,n;const{column:t,source:i}=this;this.filterWrapper=((s=this.filterManager)==null?void 0:s.getOrCreateFilterWrapper(t))??null,(n=this.filterWrapper)!=null&&n.filterPromise&&this.filterWrapper.filterPromise.then(o=>{const r=o.getGui();q(r)||z(`getGui method from filter returned ${r}; it should be a DOM element.`),this.appendChild(r),e&&this.eventService.dispatchEvent({type:"filterOpened",column:t,source:i,eGui:this.getGui()})})}onFilterDestroyed(e){(e.source==="api"||e.source==="paramsUpdated")&&e.column.getId()===this.column.getId()&&this.columnModel.getColDefCol(this.column)&&(Lt(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},Ff="ag-resizer-wrapper",tn=(e,t)=>`<div data-ref="${e}Resizer" class="ag-resizer ag-resizer-${t}"></div>`,XR=`<div class="${Ff}">
51
- ${tn("eTopLeft","topLeft")}
52
- ${tn("eTop","top")}
53
- ${tn("eTopRight","topRight")}
54
- ${tn("eRight","right")}
55
- ${tn("eBottomRight","bottomRight")}
56
- ${tn("eBottom","bottom")}
57
- ${tn("eBottomLeft","bottomLeft")}
58
- ${tn("eLeft","left")}
59
- </div>`,Ef=class extends G{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:n,height:o,x:r,y:a}=this.config;this.offsetParent||this.setOffsetParent();let d=0,h=0;const p=di(this.element);if(p){const f=this.findBoundaryElement(),m=window.getComputedStyle(f);if(m.minWidth!=null){const v=f.offsetWidth-this.element.offsetWidth;h=parseInt(m.minWidth,10)-v}if(m.minHeight!=null){const v=f.offsetHeight-this.element.offsetHeight;d=parseInt(m.minHeight,10)-v}}if(this.minHeight=n||d,this.minWidth=i||h,s&&this.setWidth(s),o&&this.setHeight(o),(!s||!o)&&this.refreshSize(),e)this.center();else if(r||a)this.offsetElement(r,a);else if(p&&t){let f=this.boundaryEl,m=!0;if(f||(f=this.findBoundaryElement(),m=!1),f){const v=parseFloat(f.style.top),w=parseFloat(f.style.left);m?this.offsetElement(isNaN(w)?0:w,isNaN(v)?0:v):this.setPosition(w,v)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const s=!!e[t],n=this.getResizerElement(t),o={dragStartPixels:0,eElement:n,onDragStart:r=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:r=>this.onResizeEnd(r,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(o),this.resizeListeners.push(o),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=s)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)Ar(i,e),e=nf(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const n=this.getAvailableHeight();n&&e>n&&(e=n)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?Ar(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),o=e?this.position.y:s.top,r=e?0:n.top;let a=0;if(t){const h=this.element.parentElement;if(h){const{bottom:p}=h.getBoundingClientRect();a=p-s.bottom}}return i+r-o-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)zi(t,e),e=Ca(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:n}=this.offsetParent,o=i?this.position.x:this.element.getBoundingClientRect().left;n&&e+o>n&&(e=n-o)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?zi(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:n,topBuffer:o}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y,d=this.shouldSkipX(t,!!i,!!n,r)?0:r,h=this.shouldSkipY(t,!!s,o,a)?0:a;return{movementX:d,movementY:h}}shouldSkipX(e,t,i,s){const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:n.left;let d=a<=0&&o.left>=e.clientX||o.right<=e.clientX&&o.right<=r.right;return d?!0:(t?d=s<0&&e.clientX>a+o.left||s>0&&e.clientX<a+o.left:i?d=s<0&&e.clientX>r.right||s>0&&e.clientX<a+o.left:d=s<0&&e.clientX>r.right||s>0&&e.clientX<r.right,d)}shouldSkipY(e,t,i=0,s){const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:n.top;let d=a<=0&&o.top>=e.clientY||o.bottom<=e.clientY&&o.bottom<=r.bottom;return d?!0:(t?d=s<0&&e.clientY>a+o.top+i||s>0&&e.clientY<a+o.top:d=s<0&&e.clientY>r.bottom||s>0&&e.clientY<r.bottom,d)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(XR,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Ff}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;!i&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const n=e[s],o=!!n.style.flex&&n.style.flex!=="0 0 auto";if(n===this.element)continue;let r=this.minHeight||0,a=this.minWidth||0;if(o){const d=window.getComputedStyle(n);d.minHeight&&(r=parseInt(d.minHeight,10)),d.minWidth&&(a=parseInt(d.minWidth,10))}else r=n.offsetHeight,a=n.offsetWidth;t+=r,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const n=i[s];n!==t&&(e?n.style.height=`${n.offsetHeight}px`:n.style.width=`${n.offsetWidth}px`,n.style.flex="0 0 auto",n===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:n,isBottom:o,isLeft:r}=this.currentResizer,a=n||r,d=o||s,{movementX:h,movementY:p}=this.calculateMouseMovement({e,isLeft:r,isTop:s}),f=this.position.x,m=this.position.y;let v=0,w=0;if(a&&h){const S=r?-1:1,b=this.getWidth(),R=b+h*S;let x=!1;r&&(v=b-R,(f+v<=0||R<=this.minWidth)&&(x=!0,v=0)),x||this.setWidth(R)}if(d&&p){const S=s?-1:1,b=this.getHeight(),R=b+p*S;let x=!1;s?(w=b-R,(m+w<=0||R<=this.minHeight)&&(x=!0,w=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&b<R&&this.getMinSizeOfSiblings().height+R>this.element.parentElement.offsetHeight&&(x=!0),x||this.setHeight(R)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&v||w)&&this.offsetElement(f+v,m+w)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:n,movementY:o}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+n,i+o),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},xf=class Cy extends G{constructor(t,i={}){super(),this.eFocusableElement=t,this.callbacks=i,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const n=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);n&&(n.focus(),s.preventDefault())},...i}}wireBeans(t){this.focusService=t.focusService}postConstruct(){this.eFocusableElement.classList.add(Cy.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(t){this.addManagedElementListeners(t,{keydown:i=>{if(!(i.defaultPrevented||Ds(i))){if(this.callbacks.shouldStopEventPropagation(i)){Fo(i);return}i.key===B.TAB?this.callbacks.onTabKeyDown(i):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(i)}}})}};xf.FOCUS_MANAGED_CLASS="ag-focus-managed";var zn=xf,Pf={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};function hu(e,t){return Ea(e)?(e.debounceMs!=null&&z("debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}function Ea(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var JR=class extends ke{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=ee,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new zn(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Ef(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`
60
- <form class="ag-filter-wrapper">
61
- <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">
62
- ${this.createBodyTemplate()}
63
- </div>
64
- </form>`;this.setTemplate(i,this.getAgComponents(),e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=Ea(e),this.resetButtonsPanel(e)}updateParams(e){this.providedFilterParams=e,this.applyActive=Ea(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(e,t){const{buttons:i,readOnly:s}=t??{},{buttons:n,readOnly:o}=e;if(s===o&&Sr(i,n))return;const r=n&&n.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Lt(this.eButtonsPanel),this.buttonListeners.forEach(h=>h()),this.buttonListeners=[]):r&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!r){this.eButtonsPanel&&fs(this.eButtonsPanel);return}const a=document.createDocumentFragment(),d=h=>{let p,f;switch(h){case"apply":p=this.translate("applyFilter"),f=w=>this.onBtApply(!1,!1,w);break;case"clear":p=this.translate("clearFilter"),f=()=>this.onBtClear();break;case"reset":p=this.translate("resetFilter"),f=()=>this.onBtReset();break;case"cancel":p=this.translate("cancelFilter"),f=w=>{this.onBtCancel(w)};break;default:z("Unknown button type specified");return}const v=ks(`<button
65
- type="${h==="apply"?"submit":"button"}"
66
- data-ref="${h}FilterButton"
67
- class="ag-button ag-standard-button ag-filter-apply-panel-button"
68
- >${p}
69
- </button>`);this.buttonListeners.push(...this.addManagedElementListeners(v,{click:f})),a.append(v)};n.forEach(h=>d(h)),this.eButtonsPanel.append(a),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=hu(this.providedFilterParams,this.getDefaultDebounceMs()),t=Wt(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(e!=null?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),t==null||t()};e!=null?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:"columnFilter"});const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;(i==="Enter"||i==="Space")&&(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const i=this.isModelValid(this.getModelFromUi()),s=this.queryForHtmlElement('[data-ref="applyFilterButton"]');s&&Tr(s,!i)}e&&!t||t==="immediately"?this.onBtApply(e):(!this.applyActive&&!t||t==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e==null?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||e==="toolPanel")return;const t=e==="floatingFilter"||e==="columnFilter",{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}refresh(e){const t=this.providedFilterParams;return this.providedFilterParams=e,this.resetButtonsPanel(e,t),!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Pf[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}},eF=class extends au{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},tF=class extends ke{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.activeClass="ag-active-item",this.options=[],this.itemEls=[]}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()}),!this.unFocusable&&this.addManagedElementListeners(e,{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){const t=e.key;switch(t){case B.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const i=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(i)}break;case B.DOWN:case B.UP:e.preventDefault(),this.navigate(t);break;case B.PAGE_DOWN:case B.PAGE_UP:case B.PAGE_HOME:case B.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}navigate(e){const t=e===B.DOWN;let i;if(!this.highlightedEl)i=this.itemEls[t?0:this.itemEls.length-1];else{let n=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);n=Math.min(Math.max(n,0),this.itemEls.length-1),i=this.itemEls[n]}this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||this.itemEls.length===0)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,n=Math.floor(this.getGui().clientHeight/s);let o=-1;e===B.PAGE_HOME?o=0:e===B.PAGE_END?o=i:e===B.PAGE_DOWN?o=Math.min(t+n,i):e===B.PAGE_UP&&(o=Math.max(t-n,0)),o!==-1&&this.highlightItem(this.itemEls[o])}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{fs(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{Lb(t,i+1),Ib(t,e.length)})}renderOption(e,t){const i=lt(this.gos),s=i.createElement("div");ti(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const n=i.createElement("span");s.appendChild(n),n.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListeners(s,{mouseover:()=>this.highlightItem(s),mousedown:o=>{o.preventDefault(),o.stopPropagation(),this.setValue(e)}}),this.createManagedBean(new Ao({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>n.scrollWidth>n.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const i=this.options.findIndex(s=>s.value===e);if(i!==-1){const s=this.options[i];this.value=s.value,this.displayValue=s.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!di(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(this.activeClass),pa(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:i,clientHeight:s}=t,{offsetTop:n,offsetHeight:o}=e;(n+o>i+s||n<i)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){!this.highlightedEl||!di(this.highlightedEl)||(this.highlightedEl.classList.remove(this.activeClass),pa(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},iF=class extends ff{constructor(e){if(super(e,(e==null?void 0:e.template)||`
70
- <div class="ag-picker-field" role="presentation">
71
- <div data-ref="eLabel"></div>
72
- <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">
73
- <div data-ref="eDisplayField" class="ag-picker-field-display"></div>
74
- <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
75
- </div>
76
- </div>`,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=ee,this.eWrapper=ee,this.eDisplayField=ee,this.eIcon=ee,this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:n,maxPickerWidth:o}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,i!=null&&this.setPickerMaxHeight(i),n!=null&&this.setPickerMinWidth(n),o!=null&&this.setPickerMaxWidth(o)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:i,inputWidth:s}=this.config;if(i){const n=_t(i,this.gos);n&&this.eIcon.appendChild(n)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Dr(e,!1),this.ariaRole&&ti(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case B.UP:case B.DOWN:case B.ENTER:case B.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case B.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:i,pickerAriaLabelValue:s,modalPicker:n=!0}=this.config,o={modal:n,eChild:e,closeOnEsc:!0,closedCallback:()=>{const m=Eg(this.gos);this.beforeHidePicker(),m&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(i,s),anchorToElement:this.eWrapper};e.style.position="absolute";const r=this.popupService.addPopup(o),{maxPickerHeight:a,minPickerWidth:d,maxPickerWidth:h,variableWidth:p}=this;p?(d&&(e.style.minWidth=d),e.style.width=ou(Ca(this.eWrapper)),h&&(e.style.maxWidth=h)):ya(e,h??Ca(this.eWrapper));const f=a??`${ma(this.popupService.getPopupParent())}px`;return e.style.setProperty("max-height",f),this.alignPickerToComponent(),r.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();Dr(t,e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return ya(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},pu=class extends iF{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),i&&t==null&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new tF("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),Hb(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){var i;const{key:t}=e;switch(t===B.TAB&&this.hidePicker(),t){case B.ENTER:case B.UP:case B.DOWN:case B.PAGE_UP:case B.PAGE_DOWN:case B.PAGE_HOME:case B.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(i=this.listComponent)==null||i.handleKeyDown(e):super.onKeyDown(e);break;case B.ESCAPE:super.onKeyDown(e);break;case B.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let n=this.listComponent.getDisplayValue();return n==null&&this.config.placeholder&&(n=this.config.placeholder),this.eDisplayField.textContent=n,this.setTooltip({newTooltipText:n??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},sF={selector:"AG-SELECT",component:pu},Df=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if(typeof e=="string")return;const t=[["displayKey"],["displayName"],["predicate","test"]],i=s=>s.some(n=>e[n]!=null)?!0:(z(`ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1);if(!t.every(i)){this.filterOptions=this.filterOptions.filter(s=>s===e)||[];return}this.customFilterOptions[e.displayKey]=e})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];typeof t=="string"?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:z("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else z("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},Tf=class extends JR{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:s}=t;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{i===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let o;if(i){const r=e,a=t;o=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;o=r.operator===a.operator&&hs(r.conditions,a.conditions,(d,h)=>this.areSimpleModelsEqual(d,h))}return o}shouldRefresh(e){var o;const t=this.getModel(),i=t?t.conditions??[t]:null,s=((o=e.filterOptions)==null?void 0:o.map(r=>typeof r=="string"?r:r.displayKey))??this.getDefaultFilterOptions();return!(!(!i||i.every(r=>s.find(a=>a===r.type)!==void 0))||typeof e.maxNumConditions=="number"&&i&&i.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const i=e;let s=i.conditions;s==null&&(s=[],z("Filter model is missing 'conditions'"));const n=this.validateAndUpdateConditions(s),o=this.getNumConditions();if(n<o)this.removeConditionsAndOperators(n);else if(n>o)for(let a=o;a<n;a++)this.createJoinOperatorPanel(),this.createOption();const r=i.operator==="OR";this.eJoinOperatorsAnd.forEach(a=>a.setValue(!r,!0)),this.eJoinOperatorsOr.forEach(a=>a.setValue(r,!0)),s.forEach((a,d)=>{this.eTypes[d].setValue(a.type,!0),this.setConditionIntoUi(a,d)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),ui.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),z('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(t==null)return!0;const{operator:i}=t,s=[];if(i){const o=t;s.push(...o.conditions??[])}else s.push(t);return s[i&&i==="OR"?"some":"every"](o=>this.individualConditionPasses(e,o))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Df,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(z('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(z('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(z('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new pu);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,s=>this.resetInput(s)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,n=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,n),this.resetJoinOperatorOr(i,s,n),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new eF);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const i=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<i){this.removeConditionsAndOperators(i+1);const s=e+1,n=i-s;n>0&&this.removeConditionsAndOperators(s,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,n)=>{const o=this.isConditionDisabled(n,e);s.setDisabled(o||this.filterListOptions.length<=1),n===1&&(Tr(this.eJoinOperatorPanels[0],o),this.eJoinOperatorsAnd[0].setDisabled(o),this.eJoinOperatorsOr[0].setDisabled(o))}),this.eConditionBodies.forEach((s,n)=>{et(s,this.isConditionBodyVisible(n))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach(s=>{s.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach(s=>{s.setValue(i,!0)}),this.forEachInput((s,n,o,r)=>{this.setElementDisplayed(s,n<r),this.setElementDisabled(s,this.isConditionDisabled(o,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(n=>fs(n))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(n=>{fs(n.getGui()),this.destroyBean(n)})}removeItems(e,t,i){return i==null?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof Wn&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const n=this.getJoinOperator();for(let r=this.getNumConditions()-1;r>=0;r--)if(this.isConditionUiComplete(r))t===-1&&(t=r,i=r);else{const a=r>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(r-1),d=r<t;(a||d)&&(this.removeConditionsAndOperators(r,1),s=!0,d&&i--)}let o=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),o=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),o=!0),o&&this.updateConditionStatusesAndValues(i,n),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(yd(this.filterPlaceholder)){const s=this.filterPlaceholder,n=this.eTypes[t].getValue(),o=this.translate(n);i=s({filterOptionKey:n,filterOption:o,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,n)=>{if(!(t instanceof Wn))return;const o=i===0&&n>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",r=i===0&&n>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(o,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,i){e instanceof Wn&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof ke&&et(e.getGui(),t)}setElementDisabled(e,t){e instanceof ke&&Tr(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Wn&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),n=this.getInputs(e);for(let o=0;o<n.length;o++){const r=n[o];r!=null&&i(r,o,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,i)=>this.resetJoinOperatorAnd(t,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((t,i)=>this.resetJoinOperatorOr(t,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),ui.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,n){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${n}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((s,n,o)=>{o===t&&this.setElementValue(s,i[n]!=null?i[n]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s)=>{this.setElementValue(t,i===0&&s===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),n=this.optionsFactory.getCustomOption(t.type),o=this.evaluateCustomFilter(n,s,i);return o??(i==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e))}evaluateCustomFilter(e,t,i){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(n=>n==null))return s(t,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}},Af=class extends Tf{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"notEqual":if(this.scalarFilterParams.includeBlanksInNotEqual)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),n=e[0]!=null?s(e[0],t):0;switch(i.type){case"equals":return n===0;case"notEqual":return n!==0;case"greaterThan":return n>0;case"greaterThanOrEqual":return n>=0;case"lessThan":return n<0;case"lessThanOrEqual":return n<=0;case"inRange":{const o=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?n>=0&&o<=0:n>0&&o<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return z('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},nF=65,oF=67,rF=86,lF=68,aF=90,cF=89;function Mf(e){var i;return e.altKey||e.ctrlKey||e.metaKey?!1:((i=e.key)==null?void 0:i.length)===1}function gu(e,t,i,s,n){const o=s?s.getColDef().suppressKeyboardEvent:void 0;if(!o)return!1;const r=e.addGridCommonParams({event:t,editing:n,column:s,node:i,data:i.data,colDef:s.getColDef()});return!!(o&&o(r))}function dF(e,t,i,s){const n=s.getDefinition(),o=n&&n.suppressHeaderKeyboardEvent;if(!q(o))return!1;const r=e.addGridCommonParams({colDef:n,column:s,headerRowIndex:i,event:t});return!!o(r)}function uF(e){const{keyCode:t}=e;let i;switch(t){case nF:i=B.A;break;case oF:i=B.C;break;case rF:i=B.V;break;case lF:i=B.D;break;case aF:i=B.Z;break;case cF:i=B.Y;break;default:i=e.code}return i}function hF(e,t=!1){return e===B.DELETE?!0:!t&&e===B.BACKSPACE?Jg():!1}var Un=class extends Wn{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=q(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{Mf(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:i=>{var n;const s=(n=i.clipboardData)==null?void 0:n.getData("text");s&&s.split("").some(o=>!e.test(o))&&i.preventDefault()}})}},xa={selector:"AG-INPUT-TEXT-FIELD",component:Un},fu=class extends Un{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const n=parseFloat(this.eInput.value),o=isNaN(n)?"":this.normalizeValue(n.toString());this.value!==o&&this.setValue(o)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;typeof e=="number"&&this.setPrecision(e),typeof t=="number"&&this.setMin(t),typeof i=="number"&&this.setMax(i),typeof s=="number"&&this.setStep(s)}onWheel(e){Je(this.gos)===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e);return this.min!=null&&t<this.min?e=this.min.toString():this.max!=null&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(this.precision==null)return e;if(t){const s=parseFloat(e).toFixed(this.precision);return parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,Pi(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Pi(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Pi(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(q(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){i=this.adjustPrecision(i);const n=this.normalizeValue(i);s=i!=n}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},pF={selector:"AG-INPUT-NUMBER-FIELD",component:fu},kf=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],mu=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const s=e,o=(s.conditions??[]).map(a=>this.getModelAsString(a)),r=s.operator==="AND"?"andCondition":"orCondition";return o.join(` ${i(r,Pf[r])} `)}else{if(e.type==="blank"||e.type==="notBlank")return i(e.type,e.type);{const s=e,n=this.optionsFactory.getCustomOption(s.type),{displayKey:o,displayName:r,numberOfInputs:a}=n||{};return o&&r&&a===0?(i(o,r),r):this.conditionToString(s,n)}}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},If=class extends mu{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:e.filter!=null?this.formatValue(e.filter):`${e.type}`}};function Cu(e){const{allowedCharPattern:t}=e??{};return t??null}var gF=class extends Af{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new If(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return kf}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=Cu(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),ti(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const n=this.createManagedBean(s?new Un({allowedCharPattern:s}):new fu);n.addCssClass(`ag-filter-${i}`),n.addCssClass("ag-filter-filter"),t.push(n),e.appendChild(n.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,n,o)=>{s<o&&t.push(this.processValue(this.stringToFloat(i.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=Gi(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}},Lf=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],_f=class extends mu{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}};function Of(e){const t=e&&e.trim();return t===""?e:t}var fF=class extends Tf{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>e==null?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(i==null)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return t.indexOf(i)===0;case"endsWith":{const s=t.lastIndexOf(i);return s>=0&&s===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new _f(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(z("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,(s,n,o,r)=>{if(n<r){let a=Gi(s.getValue());t&&this.textFilterParams.trimInput&&(a=Of(a)??null,s.setValue(a,!0)),i.push(a)}}),i}getDefaultFilterOptions(){return Lf}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),ti(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Un);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,s){const n=e.map(m=>this.formatter(m))||[],o=this.formatter(t),{api:r,colDef:a,column:d,context:h,textFormatter:p}=this.textFilterParams;if(i.type==="blank")return this.isBlank(t);if(i.type==="notBlank")return!this.isBlank(t);const f={api:r,colDef:a,column:d,context:h,node:s.node,data:s.data,filterOption:i.type,value:o,textFormatter:p};return n.some(m=>this.matcher({...f,filterText:m}))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function Vf(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseInt(e);return isNaN(t)?void 0:t}}function ms(e,t=Number.MAX_VALUE){return i=>{const s=Vf(i);if(!(s==null||s<e||s>t))return s}}function Lr(e,t){return e.toString().padStart(t,"0")}function mF(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function CF(e,t,i){return typeof e!="number"?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function Di(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(n=>Lr(n,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(n=>Lr(n,2)).join(":")),s}var vu=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function _r(e,t="YYYY-MM-DD"){const i=Lr(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>Lr(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${vu(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${vu(e.getDate())}`,DD:()=>Lr(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>n[e.getDay()],ddd:()=>n[e.getDay()].slice(0,3),dd:()=>n[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${vu(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(o).join("|"),"g");return t.replace(r,a=>a in o?o[a]():a)}function ii(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(f=>parseInt(f,10));if(s.filter(f=>!isNaN(f)).length!==3)return null;const[n,o,r]=s,a=new Date(n,o-1,r);if(a.getFullYear()!==n||a.getMonth()!==o-1||a.getDate()!==r)return null;if(!i||i==="00:00:00")return a;const[d,h,p]=i.split(":").map(f=>parseInt(f,10));return d>=0&&d<24&&a.setHours(d),h>=0&&h<60&&a.setMinutes(h),p>=0&&p<60&&a.setSeconds(p),a}var Nf=class{constructor(e,t,i,s,n){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}this.dateComp=a,a&&(s.appendChild(a.getGui()),a.afterGuiAttached&&a.afterGuiAttached(),this.tempValue&&a.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),n==null||n(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){et(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(e)}updateParams(e){var i,s;let t=!1;(i=this.dateComp)!=null&&i.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(e)!==null&&(t=!0),!t&&((s=this.dateComp)!=null&&s.onParamsUpdated)&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(e)!==null&&z("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}},Bf=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],Gf=class extends mu{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},n=i=="inRange"||s===2,o=ii(e.dateFrom),r=ii(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(n){const d=o!==null?_r(o,a):"null",h=r!==null?_r(r,a):"null";return`${d}-${h}`}return o!=null?_r(o,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Hf=1e3,Wf=1/0,vF=class extends Af{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Hf,this.maxValidYear=Wf,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&ii(t)||null,i&&ii(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const i=t;return t==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(i,s)=>{if(e[i]!=null)if(isNaN(e[i]))z(`DateFilter ${i} is not a number`);else return e[i]==null?s:Number(e[i]);return s};this.minValidYear=t("minValidYear",Hf),this.maxValidYear=t("maxValidYear",Wf),this.minValidYear>this.maxValidYear&&z("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:ii(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:ii(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&z("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Gf(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Nf(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Bf}createValueElement(){const t=lt(this.gos).createElement("div");return t.classList.add("ag-filter-body"),this.createFromToElement(t,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(t,this.eConditionPanelsTo,this.dateConditionToComps,"to"),t}createFromToElement(e,t,i,s){const o=lt(this.gos).createElement("div");o.classList.add(`ag-filter-${s}`),o.classList.add(`ag-filter-date-${s}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(n=>n.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,n,o)=>{n!==e||!t||s>=o||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=Di(s[0])),s.length>1&&(i.dateTo=Di(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,n,o)=>{s<o&&t.push(i.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},wu=class extends G{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?he(this.colsSpanning):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=q(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),n=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=n,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===n&&this.setLeft(n)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!Ft(this.beans.gos,"print")||e.getPinned()==="left")return t;const s=this.beans.visibleColsService.getColsLeftWidth();if(e.getPinned()==="right"){const n=this.beans.visibleColsService.getBodyContainerWidth();return s+n+t}return s+t}setLeft(e){if(q(e)&&(this.eCell.style.left=`${e}px`),mt(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&Nb(this.ariaEl,t.length)}}},wF="ag-column-first",SF="ag-column-last";function zf(e,t,i,s){return Ve(e)?[]:bF(e.headerClass,e,t,i,s)}function Uf(e,t,i){e.addOrRemoveCssClass(wF,i.isColAtEdge(t,"first")),e.addOrRemoveCssClass(SF,i.isColAtEdge(t,"last"))}function yF(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}function bF(e,t,i,s,n){if(Ve(e))return[];let o;if(typeof e=="function"){const r=yF(t,i,s,n);o=e(r)}else o=e;return typeof o=="string"?[o]:Array.isArray(o)?[...o]:[]}var RF=0,$f=class vy extends G{constructor(t,i,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=t,this.parentRowCtrl=s,this.beans=i,this.instanceId=t.getUniqueId()+"-"+RF++}wireBeans(t){this.pinnedWidthService=t.pinnedWidthService,this.focusService=t.focusService,this.userComponentFactory=t.userComponentFactory,this.ctrlsService=t.ctrlsService,this.dragAndDropService=t.dragAndDropService,this.menuService=t.menuService}postConstruct(){const t=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],t),this.addManagedEventListeners({overlayExclusiveChanged:t})}shouldStopEventPropagation(t){const{headerRowIndex:i,column:s}=this.focusService.getFocusedHeader();return dF(this.gos,t,i,s)}getWrapperHasFocus(){return Je(this.gos)===this.eGui}setGui(t,i){this.eGui=t,this.addDomData(i),i.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),i.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){this.eventService.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(t){const{wrapperElement:i,checkMeasuringCallback:s,compBean:n}=t,{animationFrameService:o,resizeObserverService:r,columnModel:a,gos:d}=this.beans,h=S=>{if(!this.isAlive()||!n.isAlive())return;const{paddingTop:b,paddingBottom:R,borderBottomWidth:x,borderTopWidth:T}=Hn(this.getGui()),I=b+R+x+T,L=i.offsetHeight+I;if(S<5){const A=lt(d),k=!A||!A.contains(i),N=L==0;if(k||N){o.requestAnimationFrame(()=>h(S+1));return}}a.setColHeaderHeight(this.column,L)};let p=!1,f;const m=()=>{const S=this.column.isAutoHeaderHeight();S&&!p&&v(),!S&&p&&w()},v=()=>{p=!0,h(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),f=r.observeResize(i,()=>h(0))},w=()=>{p=!1,f&&f(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),f=void 0};m(),n.addDestroyFunc(()=>w()),n.addManagedListeners(this.column,{widthChanged:()=>p&&h(0)}),n.addManagedEventListeners({sortChanged:()=>{p&&window.setTimeout(()=>h(0))}}),s&&s(m)}onDisplayedColumnsChanged(){const{comp:t,column:i,beans:s,eGui:n}=this;!t||!i||!n||(Uf(t,i,s.visibleColsService),Qg(n,s.visibleColsService.getAriaColIndex(i)))}addResizeAndMoveKeyboardListeners(t){this.resizeFeature&&t.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const t=this.focusService.isHeaderFocusSuppressed();this.eGui&&Pi(this.eGui,"tabindex",t?null:"-1")}onGuiKeyDown(t){var r;const i=Je(this.gos),s=t.key===B.LEFT||t.key===B.RIGHT;if(this.isResizing&&(t.preventDefault(),t.stopImmediatePropagation()),i!==this.eGui||!t.shiftKey&&!t.altKey||((this.isResizing||s)&&(t.preventDefault(),t.stopImmediatePropagation()),!s))return;const n=t.key===B.LEFT!==this.gos.get("enableRtl"),o=yf[n?"Left":"Right"];if(t.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const a=this.getViewportAdjustedResizeDiff(t);this.resizeHeader(a,t.shiftKey),(r=this.resizeFeature)==null||r.toggleColumnResizing(!0)}else this.moveHeader(o)}getViewportAdjustedResizeDiff(t){let i=this.getResizeDiff(t);if(this.column.getPinned()){const n=this.pinnedWidthService.getPinnedLeftWidth(),o=this.pinnedWidthService.getPinnedRightWidth(),r=Do(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(n+o+i>r)if(r>n+o)i=r-n-o;else return 0}return i}getResizeDiff(t){let i=t.key===B.LEFT!==this.gos.get("enableRtl");const s=this.column.getPinned(),n=this.gos.get("enableRtl");return s&&n!==(s==="right")&&(i=!i),(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{var t;(t=this.resizeFeature)==null||t.toggleColumnResizing(!1)},150))}handleKeyDown(t){const i=this.getWrapperHasFocus();switch(t.key){case B.PAGE_DOWN:case B.PAGE_UP:case B.PAGE_HOME:case B.PAGE_END:i&&t.preventDefault()}}addDomData(t){const i=vy.DOM_DATA_KEY_HEADER_CTRL;Vn(this.gos,this.eGui,i,this),t.addDestroyFunc(()=>Vn(this.gos,this.eGui,i,null))}getGui(){return this.eGui}focus(t){return this.eGui?(this.lastFocusEvent=t||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(t,i,s){const n=t??i;this.gos.get("preventDefaultOnContextMenu")&&n.preventDefault(),this.menuService.isHeaderContextMenuEnabled(s)&&this.menuService.showHeaderContextMenu(s,t,i),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(t,i){this.eventService.dispatchEvent({type:t,column:i})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null}};$f.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var Pa=$f,Su=class extends G{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},FF=class extends Pa{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s,n){this.comp=e,n=xr(this,this.beans.context,n),this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t,n),this.setupActive(),this.setupWidth(n),this.setupLeft(n),this.setupHover(n),this.setupFocus(n),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(n),this.setupUi(),n.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(n),n.addManagedListeners(this.column,{colDefChanged:()=>this.onColDefChanged(n)}),n.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=_t("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new zn(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();xo(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(Je(this.gos)===this.eGui)return;const s=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(s){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const n=this.findNextColumnWithFloatingFilter(e.shiftKey);n&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:n},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case B.UP:case B.DOWN:t||e.preventDefault();case B.LEFT:case B.RIGHT:if(t)return;e.stopPropagation();case B.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case B.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&Po(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const o=this.lastFocusEvent,r=!!(o&&o.key===B.TAB);if(o&&r){const a=o.shiftKey;this.focusService.focusInto(this.eGui,a)}}const n=this.getRowIndex();this.beans.focusService.setFocusedHeader(n,this.column)}setupHover(e){e.createManagedBean(new Su([this.column],this.eGui));const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const i=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:t}),t()}setupLeft(e){const t=new wu(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.filterManager)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{filterManager:t}=this.beans,i=s=>{if((s==null?void 0:s.source)==="filterDestroyed"&&!this.isAlive())return;const n=this.comp.getFloatingFilterComp();n&&n.then(o=>{if(o){const r=t==null?void 0:t.getCurrentFloatingFilterParentModel(this.column),a=s?{...s,columns:s.columns??[],source:s.source==="api"?"api":"columnFilter"}:null;o.onParentModelChanged(r,a)}})};[this.destroySyncListener]=e.addManagedListeners(this.column,{filterChanged:i}),t!=null&&t.isFilterActive(this.column)&&i(null)}setupWidth(e){const t=()=>{const i=`${this.column.getActualWidth()}px`;this.comp.setWidth(i)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){var o;const t=this.active;this.setupActive();const i=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.active?(o=this.beans.filterManager)==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!s?this.updateCompDetails(e,s,i):n.then(r=>{var a;!r||(a=this.beans.filterManager)!=null&&a.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,i):this.updateFloatingFilterParams(s)})}updateCompDetails(e,t,i){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),i&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e){var i;if(!e)return;const t=e.params;(i=this.comp.getFloatingFilterComp())==null||i.then(s=>{let n=!1;s!=null&&s.refresh&&typeof s.refresh=="function"&&s.refresh(t)!==null&&(n=!0),!n&&(s!=null&&s.onParamsUpdated)&&typeof s.onParamsUpdated=="function"&&s.onParamsUpdated(t)!==null&&z("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function q5(e){return e}var Ce="32.2.2";function EF(e){var t,i;return!!((t=e.filterManager)!=null&&t.isColumnFilterPresent())||!!((i=e.filterManager)!=null&&i.isAggregateFilterPresent())}function xF(e,t,i){var s;return(s=e.filterManager)==null?void 0:s.getFilterInstance(t,i)}function PF(e,t){var i;return((i=e.filterManager)==null?void 0:i.getColumnFilterInstance(t))??Promise.resolve(void 0)}function DF(e,t){var s;const i=e.columnModel.getColDefCol(t);if(i)return(s=e.filterManager)==null?void 0:s.destroyFilter(i,"api")}function TF(e,t){e.frameworkOverrides.wrapIncoming(()=>{var i;return(i=e.filterManager)==null?void 0:i.setFilterModel(t)})}function AF(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function MF(e,t){var i;return((i=e.filterManager)==null?void 0:i.getColumnFilterModel(t))??null}function kF(e,t,i){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,i))??Promise.resolve()}function IF(e,t){const i=e.columnModel.getCol(t);if(!i){We(`column '${t}' not found`);return}e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"})}function LF(e,t,i){if(t==null)return null;let s=null;const{compName:n,jsComp:o,fwComp:r}=Sf.getCompKeys(e,t,du);return n?s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[n]:o==null&&r==null&&t.filter===!0&&(s=i()),s}var Kf={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},jf=["january","february","march","april","may","june","july","august","september","october","november","december"],_F=class extends G{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){var e,t;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...((t=(e=this.gos.get("initialState"))==null?void 0:e.filter)==null?void 0:t.filterModel)??{}}}setFilterModel(e,t="api"){var n;if((n=this.dataTypeService)!=null&&n.isPendingInference()){this.filterModelUpdateQueue.push({model:e,source:t});return}const i=[],s=this.getFilterModel(!0);if(e){const o=new Set(Object.keys(e));this.allColumnFilters.forEach((r,a)=>{const d=e[a];i.push(this.setModelOnFilterWrapper(r.filterPromise,d)),o.delete(a)}),o.forEach(r=>{const a=this.columnModel.getColDefCol(r)||this.columnModel.getCol(r);if(!a){z("setFilterModel() - no column found for colId: "+r);return}if(!a.isFilterAllowed()){z("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);return}const d=this.getOrCreateFilterWrapper(a);if(!d){z("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}i.push(this.setModelOnFilterWrapper(d.filterPromise,e[r]))})}else this.allColumnFilters.forEach(o=>{i.push(this.setModelOnFilterWrapper(o.filterPromise,null))});ui.all(i).then(()=>{var a;const o=this.getFilterModel(!0),r=[];this.allColumnFilters.forEach((d,h)=>{const p=s?s[h]:null,f=o?o[h]:null;Sr(p,f)||r.push(d.column)}),r.length>0&&((a=this.filterManager)==null||a.onFilterChanged({columns:r,source:t}))})}setModelOnFilterWrapper(e,t){return new ui(i=>{e.then(s=>{typeof s.setModel!="function"&&(z("filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||ui.resolve()).then(()=>i())})})}getFilterModel(e){const t={},{allColumnFilters:i,initialFilterModel:s}=this;return i.forEach((n,o)=>{const r=this.getModelFromFilterWrapper(n);q(r)&&(t[o]=r)}),e||Object.entries(s).forEach(([n,o])=>{var r;q(o)&&!i.has(n)&&((r=this.columnModel.getCol(n))!=null&&r.isFilterAllowed())&&(t[n]=o)}),t}getModelFromFilterWrapper(e){const{filter:t}=e;return t?typeof t.getModel!="function"?(z("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return this.allColumnFilters.size?(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0):!1}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=o=>o?o.isFilterActive?o.isFilterActive():(z("Filter is missing isFilterActive() method"),!1):!1,t=!!Pd(this.gos),i=o=>{if(!o.isPrimary())return!0;const a=!this.columnModel.isPivotActive();return!o.isValueActive()||!a?!1:this.columnModel.isPivotMode()?!0:t},s=[],n=[];return this.forEachColumnFilter((o,r)=>{e(o)&&(i(r.column)?s.push(o):n.push(o))}).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=n})}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t))}forEachColumnFilter(e){return ui.all(Array.from(this.allColumnFilters.values()).map(t=>t.filterPromise.then(i=>e(i,t))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:n}=e,o=i?this.activeAggregateFilters:this.activeColumnFilters,r=i?n:s;for(let a=0;a<o.length;a++){const d=o[a];if(!(d==null||d===t)){if(typeof d.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!d.doesFilterPass({node:e,data:r}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>{var i;return(i=this.filterManager)==null?void 0:i.onFilterChanged(e)};this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",i).then(()=>{this.allColumnFilters.forEach(s=>{s.filterPromise&&s.filterPromise.then(n=>{n&&n!==t&&n.onAnyFilterChanged&&n.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter(t=>{t.onNewRowsLoaded&&t.onNewRowsLoaded()}).then(()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0})).then(()=>this.updateActiveFilters())}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():this.getModelFromInitialState(e)!=null}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){var i;let t;if(Id(this.gos))t="agSetColumnFilter";else{const s=(i=this.dataTypeService)==null?void 0:i.getBaseDataType(e);s==="number"?t="agNumberColumnFilter":s==="date"||s==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){var i;let t;if(Id(this.gos))t="agSetColumnFloatingFilter";else{const s=(i=this.dataTypeService)==null?void 0:i.getBaseDataType(e);s==="number"?t="agNumberColumnFloatingFilter":s==="date"||s==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let n;const o={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(n,e)(),filterChangedCallback:a=>this.filterChangedCallbackFactory(n,e)(a),doesRowPassOtherFilter:a=>this.filterManager?this.filterManager.doesRowPassOtherFilters(n,a):!0},r=this.userComponentFactory.getFilterDetails(s,o,i);return r?{filterPromise:()=>{const a=r.newAgStackInstance();return a!=null&&a.then(d=>{n=d,t&&(t.filter=d)}),a},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:Ng(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=(i==null?void 0:i())??null,t.compDetails=s,t}onColumnsChanged(){var i;const e=[];this.allColumnFilters.forEach((s,n)=>{let o;s.column.isPrimary()?o=this.columnModel.getColDefCol(n):o=this.columnModel.getCol(n),!(o&&o===s.column)&&(e.push(s.column),this.disposeFilterWrapper(s,"columnChanged"),this.disposeColumnListener(n))});const t=e.every(s=>s.getColDef().filter==="agGroupColumnFilter");e.length>0&&!t?(i=this.filterManager)==null||i.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){const e=this.columnModel.getAutoCols();e==null||e.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t)})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:i}=this.allColumnFilters.get(e.getColId())??{};return i&&typeof(i==null?void 0:i.isFilterAllowed)=="function"?i.isFilterAllowed():!0}getFloatingFilterCompDetails(e,t){const i=d=>{var p;const h=(p=this.getOrCreateFilterWrapper(e))==null?void 0:p.filterPromise;h!=null&&h.then(f=>{d(kr(f))})},s=e.getColDef(),n={...this.createFilterParams(e,s),filterChangedCallback:()=>i(d=>this.filterChangedCallbackFactory(d,e)())},o=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,du,n);let r=LF(this.frameworkOverrides,s,()=>this.getDefaultFloatingFilter(e));r==null&&(r="agReadOnlyFloatingFilter");const a={column:e,filterParams:o,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,a,r)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){var n;const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),(n=this.filterManager)==null||n.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId()),this.eventService.dispatchEvent({type:"filterDestroyed",source:t,column:e.column})})}filterModifiedCallbackFactory(e,t){return()=>{this.eventService.dispatchEvent({type:"filterModified",column:t,filterInstance:e})}}filterChangedCallbackFactory(e,t){return i=>{const s=(i==null?void 0:i.source)??"columnFilter",n={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(n)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s)){this.destroyFilter(i,"paramsUpdated");return}const n=i.getColDef().filterParams;if(!t.filterPromise){this.destroyFilter(i,"paramsUpdated");return}t.filterPromise.then(o=>{(o!=null&&o.refresh?o.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(o,i),filterChangedCallback:this.filterChangedCallbackFactory(o,i),doesRowPassOtherFilter:a=>this.filterManager?this.filterManager.doesRowPassOtherFilters(o,a):!0,...n}):!0)===!1&&this.destroyFilter(i,"paramsUpdated")})}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(i==null?void 0:i.render)&&(s==null?void 0:s.render)&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then(i=>{const s=kr(i);t(s)})}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstanceImpl(e).then(i=>{t(kr(i))})})}getFilterInstanceImpl(e){var s;const t=this.columnModel.getColDefCol(e);return t?((s=this.getOrCreateFilterWrapper(t))==null?void 0:s.filterPromise)??ui.resolve(null):ui.resolve(void 0)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){var o;if((o=this.dataTypeService)!=null&&o.isPendingInference()){let r=()=>{};const a=new Promise(d=>{r=d});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:r}),a}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(r=>new Promise(a=>{r.then(d=>a(d))}))(this.setModelOnFilterWrapper(s.filterPromise,t)):Promise.resolve()}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}setColDefPropertiesForDataType(e,t,i){const s=Id(this.gos),n=this.localeService.getLocaleTextFunc(),o=r=>{const{filterParams:a}=e;e.filterParams=typeof a=="object"?{...a,...r}:r};switch(t.baseDataType){case"number":{s&&o({comparator:(r,a)=>{const d=r==null?0:parseInt(r),h=a==null?0:parseInt(a);return d===h?0:d>h?1:-1}});break}case"boolean":{o(s?{valueFormatter:r=>q(r.value)?n(String(r.value),r.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(r,a)=>a,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(r,a)=>a===!1,numberOfInputs:0}]});break}case"date":{s&&o({valueFormatter:r=>{const a=i(r);return q(a)?a:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(r,a)=>{if(a===1&&r!=null){const d=jf[Number(r)-1];return n(d,Kf[d])}return r??n("blanks","(Blanks)")}});break}case"dateString":{const r=t.dateParser;o(s?{valueFormatter:a=>{const d=i(a);return q(d)?d:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:a=>{const d=r(a??void 0);return d?[String(d.getFullYear()),String(d.getMonth()+1),String(d.getDate())]:null},treeListFormatter:(a,d)=>{if(d===1&&a!=null){const h=jf[Number(a)-1];return n(h,Kf[h])}return a??n("blanks","(Blanks)")}}:{comparator:(a,d)=>{const h=r(d);return d==null||h<a?-1:h>a?1:0}});break}case"object":{s?o({valueFormatter:r=>{const a=i(r);return q(a)?a:n("blanks","(Blanks)")}}):e.filterValueGetter=r=>i({column:r.column,node:r.node,value:this.valueService.getValue(r.column,r.node)});break}}}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};function OF(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function VF(e,t="api"){var i;(i=e.filterManager)==null||i.onFilterChanged({source:t})}var NF=class extends ke{constructor(){super(`
77
- <div class="ag-floating-filter-input" role="presentation">
78
- <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>
79
- </div>`,[xa]),this.eFloatingFilterText=ee}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}},Zf=class extends ke{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e==null?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.getDefaultOption();return}const t=e.operator;let i;t?i=e.conditions[0]:i=e,this.lastType=i.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const i=e;return this.isTypeEditable(i.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Df,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return i==null||i==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();return`${t} ${i("ariaFilterInput","Filter Input")}`}},BF=class extends Zf{constructor(){super(`
80
- <div class="ag-floating-filter-input" role="presentation">
81
- <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field>
82
- <div data-ref="eDateWrapper" style="display: flex;"></div>
83
- </div>`,[xa]),this.eReadOnlyText=ee,this.eDateWrapper=ee}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}getDefaultFilterOptions(){return Bf}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Gf(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const i=e;this.dateComp.setDate(ii(i.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){et(this.eDateWrapper,e),et(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=this.dateComp.getDate(),t=Di(e);this.params.parentFilterInstance(i=>{if(i){const s=ii(t);i.onFloatingFilterChanged(this.getLastType()||null,s)}})}getDateComponentParams(){const e=hu(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Wt(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Nf(this.context,this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}},GF=class extends ke{constructor(){super(`
84
- <div class="ag-filter-filter">
85
- <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field>
86
- </div>`,[xa]),this.eDateInput=ee}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()},input:i=>{i.target===Je(this.gos)&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&gs(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:n,minValidDate:o,maxValidDate:r}=e.filterParams||{};if(o&&s&&z("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),r&&n&&z("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),o&&r){const[a,d]=[o,r].map(h=>h instanceof Date?h:ii(h));a&&d&&a.getTime()>d.getTime()&&z("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}o?o instanceof Date?t.min=_r(o):t.min=o:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=_r(r):t.max=r:n&&(t.max=`${n}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return ii(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Di(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){(!e||!e.suppressFocus)&&this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&e.filterParams.browserDatePicker!=null?e.filterParams.browserDatePicker:eu()||tu()||gs()&&Xg()>=14.1}},qf=class extends G{constructor(e){super(),this.params=e,this.eFloatingFilterTextInput=ee,this.valueChangedListener=()=>{}}setupGui(e){var s;this.eFloatingFilterTextInput=this.createManagedBean(new Un((s=this.params)==null?void 0:s.config));const t=this.eFloatingFilterTextInput.getGui();e.appendChild(t);const i=n=>this.valueChangedListener(n);this.addManagedListeners(t,{input:i,keydown:i})}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Yf=class extends Zf{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ee}postConstruct(){this.setTemplate(`
87
- <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div>
88
- `)}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){this.params=e;const t=e.browserAutoComplete??!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Ea(this.params.filterParams),!this.isReadOnly()){const i=hu(this.params.filterParams,this.getDefaultDebounceMs()),s=Wt(this.syncUpWithParentFilter.bind(this),i);this.floatingFilterInputService.setValueChangedListener(s)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();Lt(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===B.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=Of(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(s=>{s&&s.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}},HF=class extends G{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new fu),this.eFloatingFilterTextInput=this.createManagedBean(new Un),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,s=>this.valueChangedListener(s)),this.setupListeners(i,s=>this.valueChangedListener(s))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},WF=class extends Yf{init(e){var t;super.init(e),this.filterModelFormatter=new If(this.localeService,this.optionsFactory,(t=e.filterParams)==null?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){Cu(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return kf}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=Cu(e.filterParams),this.allowedCharPattern?this.createManagedBean(new qf({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new HF)}},zF=class extends Yf{init(e){super.init(e),this.filterModelFormatter=new _f(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Lf}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new qf)}};function UF(e){var t;return!!((t=e.filterManager)!=null&&t.isQuickFilterPresent())}function $F(e){return e.gos.get("quickFilterText")}function KF(e){var t;(t=e.filterManager)==null||t.resetQuickFilterCache()}var jF=class extends G{constructor(){super(...arguments),this.beanName="quickFilterService",this.quickFilter=null,this.quickFilterParts=null}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.pivotResultColsService=e.pivotResultColsService}postConstruct(){const e=this.resetQuickFilterCache.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}}),this.addManagedPropertyListener("quickFilterText",t=>this.setQuickFilter(t.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}refreshQuickFilterCols(){var n;const e=this.columnModel.isPivotMode(),t=this.columnModel.getAutoCols(),i=this.columnModel.getColDefCols();let s=(e&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?(n=this.pivotResultColsService.getPivotResultCols())==null?void 0:n.list:i)??[];t&&(s=s.concat(t)),this.colsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?s:s.filter(o=>o.isVisible()||o.isRowGroupActive())}isQuickFilterPresent(){return this.quickFilter!==null}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseQuickFilter(e){return q(e)?st(this.gos)?e.toUpperCase():(z("Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(e!=null&&typeof e!="string"){z(`Grid option quickFilterText only supports string inputs, received: ${typeof e}`);return}const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onQuickFilterColumnConfigChanged(){this.refreshQuickFilterCols(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassQuickFilterNoCache(e,t){return this.colsForQuickFilter.some(i=>{const s=this.getQuickFilterTextForColumn(i,e);return q(s)&&s.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:n}=this;return n(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const n=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(n)}return q(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.colsForQuickFilter.forEach(i=>{const s=this.getQuickFilterTextForColumn(i,e);q(s)&&t.push(s)}),t.join(`
89
- `)}},yu={version:Ce,moduleName:"@ag-grid-community/filter-core",beans:[YR]},ZF={version:Ce,moduleName:"@ag-grid-community/filter-api",apiFunctions:{isAnyFilterPresent:OF,onFilterChanged:VF},dependantModules:[yu]},bu={version:Ce,moduleName:"@ag-grid-community/column-filter",beans:[_F],dependantModules:[yu]},qF={version:Ce,moduleName:"@ag-grid-community/column-filter-api",apiFunctions:{isColumnFilterPresent:EF,getFilterInstance:xF,getColumnFilterInstance:PF,destroyFilter:DF,setFilterModel:TF,getFilterModel:AF,getColumnFilterModel:MF,setColumnFilterModel:kF,showColumnFilter:IF},dependantModules:[bu,ZF]},Qf={version:Ce,moduleName:"@ag-grid-community/floating-filter-core",controllers:[{name:"headerFilterCell",classImp:FF}],dependantModules:[bu]},YF={version:Ce,moduleName:"@ag-grid-community/read-only-floating-filter",userComponents:[{name:"agReadOnlyFloatingFilter",classImp:NF}],dependantModules:[Qf]},QF={version:Ce,moduleName:"@ag-grid-community/simple-filter",dependantModules:[bu],userComponents:[{name:"agTextColumnFilter",classImp:fF},{name:"agNumberColumnFilter",classImp:gF},{name:"agDateColumnFilter",classImp:vF},{name:"agDateInput",classImp:GF}]},XF={version:Ce,moduleName:"@ag-grid-community/simple-floating-filter",dependantModules:[QF,Qf],userComponents:[{name:"agTextColumnFloatingFilter",classImp:zF},{name:"agNumberColumnFloatingFilter",classImp:WF},{name:"agDateColumnFloatingFilter",classImp:BF}]},Xf={version:Ce,moduleName:"@ag-grid-community/quick-filter-core",beans:[jF],dependantModules:[yu]},JF={version:Ce,moduleName:"@ag-grid-community/quick-filter-api",apiFunctions:{isQuickFilterPresent:UF,getQuickFilter:$F,resetQuickFilter:KF},dependantModules:[Xf]},eE={version:Ce,moduleName:"@ag-grid-community/quick-filter",dependantModules:[Xf,JF]},tE={version:Ce,moduleName:"@ag-grid-community/filter",dependantModules:[XF,YF,eE,qF]},Ru=class extends ke{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},iE=class extends Ru{constructor(e){super(`<div class="ag-header-cell ag-floating-filter" role="gridcell">
90
- <div data-ref="eFloatingFilterBody" role="presentation"></div>
91
- <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation">
92
- <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button>
93
- </div>
94
- </div>`,e),this.eFloatingFilterBody=ee,this.eButtonWrapper=ee,this.eButtonShowMainFilter=ee}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(i,s)=>this.addOrRemoveCssClass(i,s),addOrRemoveBodyCssClass:(i,s)=>this.eFloatingFilterBody.classList.toggle(i,s),setButtonWrapperDisplayed:i=>et(this.eButtonWrapper,i),setCompDetails:i=>this.setCompDetails(i),getFloatingFilterComp:()=>this.compPromise,setWidth:i=>e.style.width=i,setMenuIcon:i=>this.eButtonShowMainFilter.appendChild(i)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()}}},sE=class extends Ru{constructor(e){super(`<div class="ag-header-cell" role="columnheader">
95
- <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
96
- <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
97
- </div>`,e),this.eResize=ee,this.eHeaderCompWrapper=ee,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((n,o)=>{o!=null&&o!=""?e.setAttribute(n,o):e.removeAttribute(n)})("col-id",this.column.getColId());const i={setWidth:n=>e.style.width=n,addOrRemoveCssClass:(n,o)=>this.addOrRemoveCssClass(n,o),setAriaSort:n=>n?Bb(e,n):Gb(e),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(i=>this.afterCompCreated(t,i))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},nE=class extends Ru{constructor(e){super(`<div class="ag-header-group-cell" role="columnheader">
98
- <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
99
- <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
100
- </div>`,e),this.eResize=ee,this.eHeaderCompWrapper=ee}postConstruct(){const e=this.getGui(),t=(s,n)=>n!=null?e.setAttribute(s,n):e.removeAttribute(s);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(s,n)=>this.addOrRemoveCssClass(s,n),setResizableDisplayed:s=>et(this.eResize,s),setWidth:s=>e.style.width=s,setAriaExpanded:s=>t("aria-expanded",s),setUserCompDetails:s=>this.setUserCompDetails(s),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const i=this.getGui(),s=e.getGui();this.eHeaderCompWrapper.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}},oE=class extends ke{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){Yg(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(s=>{const n=s.instanceId;let o=i[n];delete i[n],o==null&&(o=this.createHeaderComp(s),this.getGui().appendChild(o.getGui())),this.headerComps[n]=o}),Ei(i,(s,n)=>{this.getGui().removeChild(n.getGui()),this.destroyBean(n)}),t){const s=Qs(this.headerComps);s.sort((o,r)=>{const a=o.getCtrl().getColumnGroupChild().getLeft(),d=r.getCtrl().getColumnGroupChild().getLeft();return a-d});const n=s.map(o=>o.getGui());af(this.getGui(),n)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new nE(e);break;case"filter":t=new iE(e);break;default:t=new sE(e);break}return this.createBean(t),t.setParentComponent(this),t}},rE=class extends G{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady(this,t=>{this.gridBodyCon=t.gridBodyCtrl});const e=lt(this.gos);this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){var e;return((e=this.ctrlsService.getHeaderRowContainerCtrl())==null?void 0:e.getRowCount())??0}getHeaderPositionForColumn(e,t){let i;if(typeof e=="string"?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const s=this.ctrlsService.getHeaderRowContainerCtrl(),n=s==null?void 0:s.getAllCtrls(),o=he(n||[]).getType()==="filter",r=this.getHeaderRowCount()-1;let a=-1,d=i;for(;d;)a++,d=d.getParent();let h=a;return t&&o&&h===r-1&&h++,h===-1?null:{headerRowIndex:h,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,n=t.column,o=this.getHeaderRowCount(),r=e===0;let{headerRowIndex:a,column:d,headerRowIndexWithoutSpan:h}=r?this.headerPositionUtils.getColumnVisibleParent(n,s):this.headerPositionUtils.getColumnVisibleChild(n,s),p=!1;return a<0&&(a=0,d=n,p=!0),a>=o?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):h!==void 0&&(this.currentHeaderRowWithoutSpan=h),!p&&!d?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:d},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),n=e===2,o=this.gos.get("enableRtl");let r,a;if(this.currentHeaderRowWithoutSpan!==-1?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,n!==o?(a="Before",r=this.headerPositionUtils.findHeader(s,a)):(a="After",r=this.headerPositionUtils.findHeader(s,a)),r||!t)return this.focusService.focusHeaderPosition({headerPosition:r,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const d=this.gos.getCallback("tabToNextHeader");if(d)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:d,headerPosition:r,direction:a})}return this.focusNextHeaderRow(s,a,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let n=null,o;if(t==="Before"?s>0&&(o=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!n)return!1;const{column:r,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,n==null?void 0:n.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(mt(e)){const s=e.getDisplayedLeafColumns();i=t==="Before"?he(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},lE=class extends G{wireBeans(e){this.animationFrameService=e.animationFrameService,this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new zn(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>this.animationFrameService.requestAnimationFrame(()=>e()),gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){var o;const{columnModel:e}=this;let t=0;const i=this.columnModel.getGroupRowsHeight().reduce((r,a)=>r+a,0),s=this.columnModel.getColumnHeaderRowHeight();if((o=this.filterManager)!=null&&o.hasFloatingFilters()&&(t+=e.getFloatingFiltersHeight()),t+=i,t+=s,this.headerHeight===t)return;this.headerHeight=t;const n=`${t+1}px`;this.comp.setHeightAndMinHeight(n),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.visibleColsService.getAllCols().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey,s=i!==t?2:3;(this.headerNavigationService.navigateHorizontally(s,!0,e)||!i&&this.focusService.focusOverlay(!1)||this.focusService.focusNextGridCoreContainer(i))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case B.LEFT:t=2;case B.RIGHT:{q(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case B.UP:t=0;case B.DOWN:{q(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(Je(this.gos))||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){var n;if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;(s===this.eGui||s===((n=this.ctrlsService.getHeaderRowContainerCtrl())==null?void 0:n.getViewportElement()))&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Js())return;const t=new en(this.eGui),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}},Fu=class extends G{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=Ft(this.gos,"print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let n;e?n=t+i+s:(n=t,this.addSpacer&&(this.gos.get("enableRtl")?i:s)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(n+=this.scrollVisibleService.getScrollbarWidth())),this.callback(n)}},aE=class extends G{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function Jf(e){const{isFromHeader:t,fromLeft:i,xPosition:s,fromEnter:n,fakeEvent:o,pinned:r,gos:a,columnModel:d,columnMoveService:h,visibleColsService:p}=e;let{allMovingColumns:f}=e;if(t){const V=[];f.forEach(L=>{var N;let A=null,k=L.getParent();for(;k!=null&&k.getDisplayedLeafColumns().length===1;)A=k,k=k.getParent();A!=null?(!!((N=A.getColGroupDef())!=null&&N.marryChildren)?A.getProvidedColumnGroup().getLeafColumns():A.getLeafColumns()).forEach(Q=>{V.includes(Q)||V.push(Q)}):V.includes(L)||V.push(L)}),f=V}const m=f.slice();d.sortColsLikeCols(m);const v=hE({movingCols:m,draggingRight:i,xPosition:s,pinned:r,gos:a,columnModel:d,visibleColsService:p}),w=cE(m,d);if(v.length===0)return;const S=v[0];let b=w!==null&&!n;if(t&&(b=w!==null),b&&!o&&(!i&&S>=w||i&&S<=w))return;const R=p.getAllCols(),x=[];let T=null;for(let V=0;V<v.length;V++){const L=v[V],A=h.getProposedColumnOrder(m,L);if(!h.doesOrderPassRules(A))continue;const k=A.filter($=>R.includes($));if(T===null)T=k;else if(!hs(k,T))break;const N=dE(A);x.push({move:L,fragCount:N})}if(x.length===0)return;x.sort((V,L)=>V.fragCount-L.fragCount);const I=x[0].move;if(!(I>d.getCols().length-f.length))return{columns:f,toIndex:I}}function Eu(e){const{columns:t,toIndex:i}=Jf(e)||{},{finished:s,columnMoveService:n}=e;return!t||i==null?null:(n.moveColumns(t,i,"uiColumnMoved",s),s?null:{columns:t,toIndex:i})}function cE(e,t){const i=t.getCols(),s=Zy(e.map(d=>i.indexOf(d))),n=s[0];return he(s)-n!==s.length-1?null:n}function dE(e){function t(s){const n=[];let o=s.getOriginalParent();for(;o!=null;)n.push(o),o=o.getOriginalParent();return n}let i=0;for(let s=0;s<e.length-1;s++){let n=t(e[s]),o=t(e[s+1]);[n,o]=n.length>o.length?[n,o]:[o,n],n.forEach(r=>{o.indexOf(r)===-1&&i++})}return i}function uE(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}function hE(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:n,gos:o,columnModel:r,visibleColsService:a}=e;if(o.get("suppressMovableColumns")||t.some(T=>T.getColDef().suppressMovable))return[];const h=uE(a,n),p=r.getCols(),f=h.filter(T=>Ps(t,T)),m=h.filter(T=>!Ps(t,T)),v=p.filter(T=>!Ps(t,T));let w=0,S=s;if(i){let T=0;f.forEach(I=>T+=I.getActualWidth()),S-=T}if(S>0){for(let T=0;T<m.length;T++){const I=m[T];if(S-=I.getActualWidth(),S<0)break;w++}i&&w++}let b;if(w>0){const T=m[w-1];b=v.indexOf(T)+1}else b=v.indexOf(m[0]),b===-1&&(b=0);const R=[b],x=(T,I)=>T-I;if(i){let T=b+1;const I=p.length-1;for(;T<=I;)R.push(T),T++;R.sort(x)}else{let T=b;const I=p.length-1;let V=p[T];for(;T<=I&&h.indexOf(V)<0;)T++,R.push(T),V=p[T];T=b-1;const L=0;for(;T>=L;)R.push(T),T--;R.sort(x).reverse()}return R}function Da(e){var h;const{pinned:t,fromKeyboard:i,gos:s,ctrlsService:n,useHeaderRow:o,skipScrollPadding:r}=e;let a=(h=n.getHeaderRowContainerCtrl(t))==null?void 0:h.getViewportElement(),{x:d}=e;return a?(i&&(d-=a.getBoundingClientRect().left),s.get("enableRtl")&&(o&&(a=a.querySelector(".ag-header-row")),d=a.clientWidth-d),t==null&&!r&&(d+=n.get("center").getCenterViewportScrollLeft()),d):0}function ko(e,t){for(const i of e)i.setMoving(t,"uiColumnMoved")}var em=7,xu=100,Ta=xu/2,pE=5,gE=100,fE=class extends G{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!q(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){var t;const e=((t=this.lastDraggingEvent)==null?void 0:t.dragItem.columns)??[];for(const i of e){const s=i.getPinned();if(i.getColDef().lockPinned){if(s==this.pinned)return"move";continue}if(s===this.pinned||!this.pinned)return"move";if(!s&&this.pinned)return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===0)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,n=(t||[]).filter(o=>s[o.getId()]);this.setColumnsVisible(n,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(t,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){const n=this.gos.get("suppressMoveWhenColumnDragging");if(s&&!n){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!s&&Ve(e.hDirection))return;const{pinned:o,gos:r,ctrlsService:a}=this,d=Da({x:e.x,pinned:o,gos:r,ctrlsService:a});t||this.checkCenterForScrolling(d),n?this.handleColumnDragWhileSuppressingMovement(e,t,i,d,s):this.handleColumnDragWhileAllowingMovement(e,t,i,d,s)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(!e)return;const s=e.filter(n=>!n.getColDef().lockVisible);this.columnModel.setColsVisible(s,t,i)}finishColumnMoving(){if(this.clearHighlighted(),!this.lastMovedInfo)return;const{columns:e,toIndex:t}=this.lastMovedInfo;this.columnMoveService.moveColumns(e,t,"uiColumnMoved",!0)}handleColumnDragWhileSuppressingMovement(e,t,i,s,n){const o=this.getAllMovingColumns(e,!0);if(n){const r=this.isAttemptingToPin(o);r&&this.attemptToPinColumns(o,void 0,!0);const{fromLeft:a,xPosition:d}=this.getNormalisedXPositionInfo(o,r)||{};if(a==null||d==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:o,xPosition:d,fromEnter:t,fakeEvent:i,fromLeft:a})}else{if(!this.dragAndDropService.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(o,s)}}handleColumnDragWhileAllowingMovement(e,t,i,s,n){const o=this.getAllMovingColumns(e),r=this.normaliseDirection(e.hDirection)===1,a=e.dragSource.type===1,d=this.getMoveColumnParams({allMovingColumns:o,isFromHeader:a,xPosition:s,fromLeft:r,fromEnter:t,fakeEvent:i}),h=Eu({...d,finished:n});h&&(this.lastMovedInfo=h)}getAllMovingColumns(e,t=!1){const i=e.dragSource.getDragItem();let s=null;t?(s=i.columnsInSplit,s||(s=i.columns)):s=i.columns;const n=o=>o.getColDef().lockPinned?o.getPinned()==this.pinned:!0;return s?s.filter(n):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:i,xPosition:s,fromLeft:n,fromEnter:o,fakeEvent:r}=e,{pinned:a,gos:d,columnModel:h,columnMoveService:p,visibleColsService:f}=this;return{allMovingColumns:t,isFromHeader:i,fromLeft:n,xPosition:s,pinned:a,fromEnter:o,fakeEvent:r,gos:d,columnModel:h,columnMoveService:p,visibleColsService:f}}findFirstAndLastMovingColumns(e){const t=e.length;let i,s;for(let n=0;n<=t;n++){if(!i){const o=e[n];o.getLeft()!=null&&(i=o)}if(!s){const o=e[t-1-n];o.getLeft()!=null&&(s=o)}if(i&&s)break}return{firstMovingCol:i,lastMovingCol:s}}highlightHoveredColumn(e,t){var p;const{gos:i,columnModel:s}=this,n=i.get("enableRtl"),o=s.getCols().filter(f=>f.isVisible()&&f.getPinned()===this.pinned);let r=null,a=null,d=null;for(const f of o){if(a=f.getActualWidth(),r=this.getNormalisedColumnLeft(f,0,n),r!=null){const m=r+a;if(r<=t&&m>=t){d=f;break}}r=null,a=null}if(d)e.indexOf(d)!==-1&&(d=null);else{for(let f=o.length-1;f>=0;f--){const m=o[f],v=o[f].getParent();if(!v){d=m;break}const w=v==null?void 0:v.getDisplayedLeafColumns();if(w.length){d=he(w);break}}if(!d)return;r=this.getNormalisedColumnLeft(d,0,n),a=d.getActualWidth()}if(((p=this.lastHighlightedColumn)==null?void 0:p.column)!==d&&this.clearHighlighted(),d==null||r==null||a==null)return;let h;t-r<a/2!==n?h=0:h=1,d.setHighlighted(h),this.lastHighlightedColumn={column:d,position:h}}getNormalisedXPositionInfo(e,t){const{gos:i,visibleColsService:s}=this,n=i.get("enableRtl"),{firstMovingCol:o,column:r,position:a}=this.getColumnMoveAndTargetInfo(e,t,n);if(!o||!r||a==null)return;const d=s.getAllCols(),h=d.indexOf(o),p=d.indexOf(r),f=a===0!==n,m=h<p||h===p&&!f;let v=0;if(f?m&&(v-=1):m||(v+=1),p+v===h)return;const w=d[p+v];if(!w)return;const S=this.getNormalisedColumnLeft(w,20,n);return{fromLeft:m,xPosition:S}}getColumnMoveAndTargetInfo(e,t,i){const s=this.lastHighlightedColumn||{},{firstMovingCol:n,lastMovingCol:o}=this.findFirstAndLastMovingColumns(e);if(!n||!o||s.column||!t)return{firstMovingCol:n,...s};const a=this.getPinDirection()==="left";return{firstMovingCol:n,position:a?1:0,column:a!==i?n:o}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case 0:return 1;case 1:return 0}return e}getNormalisedColumnLeft(e,t,i){const{gos:s,ctrlsService:n}=this,o=e.getLeft();if(o==null)return null;const r=e.getActualWidth();return Da({x:i?o+r-t:o+t,pinned:e.getPinned(),useHeaderRow:i,skipScrollPadding:!0,gos:s,ctrlsService:n})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,i=this.failedMoveAttempts>em;return t&&i||e.some(s=>s.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:i,fromEnter:s,fakeEvent:n,fromLeft:o}=e,r=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:i,fromLeft:o,fromEnter:s,fakeEvent:n}),{columns:a,toIndex:d}=Jf(r)||{};a&&d!=null&&(this.lastMovedInfo={columns:a,toIndex:d}),this.finishColumnMoving()}clearHighlighted(){this.lastHighlightedColumn&&(this.lastHighlightedColumn.column.setHighlighted(null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+Ta,this.needToMoveLeft=e>s-Ta):(this.needToMoveLeft=e<i+Ta,this.needToMoveRight=e>s-Ta),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){var e;this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),gE),(e=this.dragAndDropService.getDragAndDropImageComponent())==null||e.setIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){var e;this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,(e=this.dragAndDropService.getDragAndDropImageComponent())==null||e.setIcon(this.getIconName()))}moveInterval(){var s,n;let e;this.intervalCount++,e=10+this.intervalCount*pE,e>xu&&(e=xu);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{if(this.failedMoveAttempts++,this.failedMoveAttempts<=em+1)return;if((s=this.dragAndDropService.getDragAndDropImageComponent())==null||s.setIcon("pinned"),!this.gos.get("suppressMoveWhenColumnDragging")){const o=(n=this.lastDraggingEvent)==null?void 0:n.dragItem.columns;this.attemptToPinColumns(o,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,i=!1){const s=(e||[]).filter(n=>!n.getColDef().lockPinned);return s.length?(i&&(t=this.getPinDirection()),this.columnModel.setColsPinned(s,t,"uiColumnDragged"),i&&this.dragAndDropService.nudge(),s.length):0}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}},mE=class extends G{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(this,e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]];break}}),this.moveColumnFeature=this.createManagedBean(new fE(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new aE(this.pinned)),this.dragAndDropService.addDropTarget(this),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}},CE=class extends G{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,n){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=n}postConstruct(){const e=[];let t,i;const s=()=>{if(et(this.eResize,t),!t)return;const r=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(r),i){const a=this.gos.get("skipHeaderOnAutoSize"),d=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",a)};this.eResize.addEventListener("dblclick",d);const h=new en(this.eResize);h.addEventListener("doubleTap",d),e.push(()=>{this.eResize.removeEventListener("dblclick",d),h.removeEventListener("doubleTap",d),h.destroy()})}},n=()=>{e.forEach(r=>r()),e.length=0},o=()=>{const r=this.column.isResizable(),a=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(r!==t||a!==i)&&(t=r,i=a,n(),s())};o(),this.addDestroyFunc(n),this.ctrl.setRefreshFunction("resize",o)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:n}=this,o=this.normaliseResizeAmount(t),r=n+o,a=[{key:i,newWidth:r}];if(this.column.getPinned()){const d=this.pinnedWidthService.getPinnedLeftWidth(),h=this.pinnedWidthService.getPinnedRightWidth(),p=Do(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(d+h+(o-s)>p)return}this.lastResizeAmount=o,this.columnSizeService.setColumnWidths(a,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",s=this.pinned==="right";return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},vE=class extends G{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){const e=t=>{t&&typeof t!="string"&&(this.selectionOptions=t)};e(this.gos.get("rowSelection")),this.addManagedPropertyListener("rowSelection",t=>e(t.currentValue))}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(Je(this.gos))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new au),this.cbSelectAll.addCssClass("ag-header-select-all"),ti(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),Ud(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),s=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${s} (${i})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${s} (${i})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return Md(this.gos)?!0:(z(`${e} is only available if using 'multiRow' selection mode.`),!1)}checkRightRowModelType(e){return st(this.gos)||xs(this.gos)?!0:(z(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${this.rowModel.getType()}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const n={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(n):this.selectionService.deselectAllRowNodes(n)}isCheckboxSelection(){const e=this.selectionOptions,t=e&&ra(e)&&Eo(this.column),i=this.column.getColDef().headerCheckboxSelection;let s=!1;return t?s=!0:typeof i=="function"?s=i(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()})):s=!!i,s&&this.checkRightRowModelType(t?"headerCheckbox":"headerCheckboxSelection")&&this.checkSelectionType(t?"headerCheckbox":"headerCheckboxSelection")}isFilteredOnly(){const e=this.selectionOptions;return e!==void 0?e.mode==="multiRow"&&e.selectAll==="filtered":!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){const e=this.selectionOptions;return e!==void 0?e.mode==="multiRow"&&e.selectAll==="currentPage":!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},wE=class extends Pa{constructor(e,t,i){super(e,t,i),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s,n){this.comp=e,n=xr(this,this.beans.context,n),this.setGui(t,n),this.updateState(),this.setupWidth(n),this.setupMovingCss(n),this.setupMenuClass(n),this.setupSortableClass(n),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:s,checkMeasuringCallback:r=>this.setRefreshFunction("measuring",r),compBean:n}),this.addColumnHoverListener(n),this.setupFilterClass(n),this.setupClassesFromColDef(),this.setupTooltip(n),this.addActiveHeaderMouseListeners(n),this.setupSelectAll(n),this.setupUserComp(n),this.refreshAria(),this.resizeFeature=n.createManagedBean(new CE(this.getPinned(),this.column,i,e,this)),n.createManagedBean(new Su([this.column],t)),n.createManagedBean(new wu(this.column,t,this.beans)),n.createManagedBean(new zn(t,{shouldStopEventPropagation:r=>this.shouldStopEventPropagation(r),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(n),n.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],()=>this.refresh(n)),n.addManagedListeners(this.column,{colDefChanged:()=>this.refresh(n)}),n.addManagedListeners(this.column,{headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const o=()=>this.checkDisplayName(n);n.addManagedEventListeners({columnValueChanged:o,columnRowGroupChanged:o,columnPivotChanged:o,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),n.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),n=this.column.getMaxWidth(),o=Math.min(Math.max(i+e,s),n);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:o}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,beans:i,column:s,ctrlsService:n}=this,{gos:o,columnModel:r,columnMoveService:a,visibleColsService:d}=i,h=this.getPinned(),p=t.getBoundingClientRect().left,f=s.getActualWidth(),m=o.get("enableRtl"),w=Da({x:e===0!==m?p-20:p+f+20,pinned:h,fromKeyboard:!0,gos:o,ctrlsService:n}),S=this.focusService.getFocusedHeader();Eu({allMovingColumns:[s],isFromHeader:!0,fromLeft:e===1,xPosition:w,pinned:h,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:r,columnMoveService:a,visibleColsService:d,finished:!0}),n.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(s,"auto"),(!this.isAlive()||this.beans.gos.get("ensureDomOrder"))&&S&&this.restoreFocus(S)}restoreFocus(e){this.focusService.focusHeaderPosition({headerPosition:{...e,column:this.column}})}setupUserComp(e){const t=this.lookupUserCompDetails(e);this.setCompDetails(t)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(e){const t=this.createParams(e),i=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(i,t)}createParams(e){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:i=>{this.menuService.showColumnMenu({column:this.column,buttonElement:i,positionBy:"button"})},showColumnMenuAfterMouseClick:i=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:i,positionBy:"mouse"})},showFilter:i=>{this.menuService.showFilterMenu({column:this.column,buttonElement:i,containerType:"columnFilter",positionBy:"button"})},progressSort:i=>{this.beans.sortController.progressSort(this.column,!!i,"uiColumnSorted")},setSort:(i,s)=>{this.beans.sortController.setSortForColumn(this.column,i,!!s,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(i,s)=>{this.setupTooltip(e,i,s)}})}setupSelectAll(e){this.selectAllFeature=e.createManagedBean(new vE(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===B.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===B.ENTER&&this.onEnterKeyDown(e),e.key===B.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof lu)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t,i){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.gos.get("tooltipShowMode")==="whenTruncated",n=this.eGui,o=this.column.getColDef();!i&&s&&!o.headerComponent&&(i=()=>{const d=n.querySelector(".ag-header-cell-text");return d?d.scrollWidth>d.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>n,getLocation:()=>"header",getTooltipValue:()=>t??this.column.getColDef().headerTooltip,shouldDisplayTooltip:i},a=e.createManagedBean(new Ao(r));this.setRefreshFunction("tooltip",()=>a.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=zf(t,this.gos,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(n=>{s.has(n)?s.delete(n):this.comp.addOrRemoveCssClass(n,!0)}),s.forEach(n=>this.comp.addOrRemoveCssClass(n,!1))};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:n,gos:o}=this,{columnModel:r}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),ko([t],!0)},onDragStopped:()=>ko([t],!1),onDragCancelled:()=>ko([t],!1),onGridEnter:h=>{var p;if(a){const f=((p=h==null?void 0:h.columns)==null?void 0:p.filter(m=>!m.getColDef().lockVisible))||[];r.setColsVisible(f,!0,"uiColumnMoved")}},onGridExit:h=>{var p;if(a){const f=((p=h==null?void 0:h.columns)==null?void 0:p.filter(m=>!m.getColDef().lockVisible))||[];r.setColsVisible(f,!1,"uiColumnMoved")}}};n.addDragSource(d,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(e){this.updateState(),this.refreshHeaderComp(e),this.refreshAria(),Object.values(this.refreshFunctions).forEach(t=>t())}refreshHeaderComp(e){const t=this.lookupUserCompDetails(e);(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==t.componentClass?this.attemptHeaderCompRefresh(t.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(t)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(e){this.displayName!==this.calculateDisplayName()&&this.refresh(e)}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const i=this.column.getActualWidth();this.comp.setWidth(`${i}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const i=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",i),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,i=e===1;this.comp.addOrRemoveCssClass("ag-header-highlight-before",t),this.comp.addOrRemoveCssClass("ag-header-highlight-after",i)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),i.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:n,isSpanningTotal:o}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",n>0);const{columnModel:r}=s,a=r.getColumnHeaderRowHeight();if(n===0){i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${a}px`);return}i.addOrRemoveCssClass("ag-header-span-total",o);const d=this.beans.columnModel.getGroupRowsHeight();let h=0;for(let p=0;p<n;p++)h+=d[d.length-1-p];e.style.setProperty("top",`${-h}px`),e.style.setProperty("height",`${a+h}px`)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Db(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(Je(this.beans.gos)))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((t,i)=>t==="filter"?-1:i.charCodeAt(0)-t.charCodeAt(0)).map(t=>this.ariaDescriptionProperties.get(t)).join(". ");this.beans.ariaAnnouncementService.announceValue(e,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(e){const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const i=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:t}),t()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(e){const t=n=>this.handleMouseOverChange(n.type==="mouseenter"),i=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),s=n=>this.handleContextMenuMouseEvent(n,void 0,this.column);e.addManagedListeners(this.getGui(),{mouseenter:t,mouseleave:t,click:i,contextmenu:s})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventService.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof lu?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy()}},SE=class extends G{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const t=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(n=>{n.getColDef().suppressAutoSize||i.push(n.getColId())}),i.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),n=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(n,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s=this.getSizeRatiosOfColumns(t,i),n={columnsToResize:t,resizeStartWidth:i,resizeRatios:s};let o=null;if(e&&(o=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),o){const r=o.getDisplayedLeafColumns(),a=n.groupAfterColumns=r.filter(h=>h.isResizable()),d=n.groupAfterStartWidth=this.getInitialSizeOfColumns(a);n.groupAfterRatios=this.getSizeRatiosOfColumns(a,d)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:n,groupAfterStartWidth:o,groupAfterRatios:r}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=n,this.resizeTakeFromStartWidth=o,this.resizeTakeFromRatios=r}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:n,resizeStartWidth:o,resizeRatios:r,groupAfterColumns:a,groupAfterStartWidth:d,groupAfterRatios:h}=e,p=[];if(p.push({columns:n,ratios:r,width:t}),a){const f=t-o;p.push({columns:a,ratios:h,width:d-f})}this.columnSizeService.resizeColumnSets({resizeSets:p,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},yE=class extends G{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}},bE=class extends Pa{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=e}setComp(e,t,i,s,n){this.comp=e,n=xr(this,this.beans.context,n),this.setGui(t,n),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(n),this.setupExpandable(n),this.setupTooltip(n),this.setupAutoHeight({wrapperElement:s,compBean:n}),this.setupUserComp(n),this.addHeaderMouseListeners(n);const o=this.getParentRowCtrl().getPinned(),r=this.column.getProvidedColumnGroup().getLeafColumns();n.createManagedBean(new Su(r,t)),n.createManagedBean(new wu(this.column,t,this.beans)),n.createManagedBean(new yE(e,this.column)),this.resizeFeature=n.createManagedBean(new SE(e,i,o,this.column)),n.createManagedBean(new zn(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(n,r),n.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(n),n.addDestroyFunc(()=>this.clearComponent())}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const i of t)e.addManagedListeners(i,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,i)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),i=t[0]===e,s=he(t)===e;if(!i&&!s)return;const n=e.getHighlighted(),o=!!this.getParentRowCtrl().findHeaderCellCtrl(d=>d.getColumnGroupChild().isMoving());let r=!1,a=!1;if(o){const d=this.beans.gos.get("enableRtl"),h=n===1,p=n===0;i&&(d?a=h:r=p),s&&(d?r=p:a=h)}this.comp.addOrRemoveCssClass("ag-header-highlight-before",r),this.comp.addOrRemoveCssClass("ag-header-highlight-after",a)}getColumn(){return this.column}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,ctrlsService:n}=this,{gos:o,columnModel:r,columnMoveService:a,visibleColsService:d}=t,h=o.get("enableRtl"),p=e===0,f=this.getPinned(),m=i.getBoundingClientRect(),v=m.left,w=m.width,S=Da({x:p!==h?v-20:v+w+20,pinned:f,fromKeyboard:!0,gos:o,ctrlsService:n}),b=s.getGroupId(),R=this.focusService.getFocusedHeader();Eu({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,fromLeft:e===1,xPosition:S,pinned:f,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:r,columnMoveService:a,visibleColsService:d,finished:!0});const x=s.getDisplayedLeafColumns(),T=p?x[0]:he(x);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(T,"auto"),(!this.isAlive()||this.beans.gos.get("ensureDomOrder"))&&R&&this.restoreFocus(b,s,R)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const n=s[0].getParent();if(!n)return;const o=this.findGroupWidthId(n,e);o&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:o}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(e){const t=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:s=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),s,"gridInitializing")},setTooltip:(s,n)=>{this.setupTooltip(e,s,n)}}),i=this.userComponentFactory.getHeaderGroupCompDetails(t);this.comp.setUserCompDetails(i)}addHeaderMouseListeners(e){const t=n=>this.handleMouseOverChange(n.type==="mouseenter"),i=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),s=n=>this.handleContextMenuMouseEvent(n,void 0,this.column.getProvidedColumnGroup());e.addManagedListeners(this.getGui(),{mouseenter:t,mouseleave:t,click:i,contextmenu:s})}handleMouseOverChange(e){this.eventService.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t,i){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.column.getColGroupDef(),n=this.gos.get("tooltipShowMode")==="whenTruncated",o=this.eGui;!i&&n&&!(s!=null&&s.headerGroupComponent)&&(i=()=>{const a=o.querySelector(".ag-header-group-text");return a?a.scrollWidth>a.clientWidth:!0});const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>t??(s&&s.headerTooltip),shouldDisplayTooltip:i};s&&(r.getColDef=()=>s),e.createManagedBean(new Ao(r))}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const i=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:i,expandableChanged:i})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=zf(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):(t.push("ag-header-group-cell-with-group"),e!=null&&e.wrapHeaderText&&t.push("ag-header-cell-wrap-text")),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(e){const i=this.column.getProvidedColumnGroup().getLeafColumns(),s=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());i.forEach(n=>{e.addManagedListeners(n,{movingChanged:s})}),s()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===B.ENTER){const i=this.column,s=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:s,gos:n,dragAndDropService:o}=this,{columnModel:r}=t,a=i.getProvidedColumnGroup().getLeafColumns();let d=!n.get("suppressDragLeaveHidesColumns");const h=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>d?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{d=!n.get("suppressDragLeaveHidesColumns"),ko(a,!0)},onDragStopped:()=>ko(a,!1),onDragCancelled:()=>ko(a,!1),onGridEnter:p=>{if(d){const{columns:f=[],visibleState:m}=p??{},v=f.filter(w=>!w.getColDef().lockVisible&&(!m||m[w.getColId()]));r.setColsVisible(v,!0,"uiColumnMoved")}},onGridExit:p=>{var f;if(d){const m=((f=p==null?void 0:p.columns)==null?void 0:f.filter(v=>!v.getColDef().lockVisible))||[];r.setColsVisible(m,!1,"uiColumnMoved")}}};o.addDragSource(h,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(r=>i[r.getId()]=r.isVisible());const s=[];this.beans.visibleColsService.getAllCols().forEach(r=>{t.indexOf(r)>=0&&(s.push(r),kt(t,r))}),t.forEach(r=>s.push(r));const n=[],o=e.getLeafColumns();for(const r of s)o.indexOf(r)!==-1&&n.push(r);return{columns:s,columnsInSplit:n,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}destroy(){super.destroy()}},RE=0,Pu=class extends G{constructor(e,t,i){super(),this.instanceId=RE++,this.rowIndex=e,this.pinned=t,this.type=i;const s=i=="group"?"ag-header-row-column-group":i=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=Ft(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.getHeaderCellCtrls().every(e=>e.getGui()!=null):!1}setComp(e,t,i=!0){this.comp=e,t=xr(this,this.beans.context,t),i&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this);e.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:i=>this.onVirtualColumnsChanged(i.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,gridStylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),e.addManagedPropertyListener("ensureDomOrder",i=>this.isEnsureDomOrder=i.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return ta(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=Ft(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans,i=[],s=e.getGroupRowsHeight(),n=e.getColumnHeaderRowHeight();i.push(...s),i.push(n),t!=null&&t.hasFloatingFilters()&&i.push(e.getFloatingFiltersHeight());let o=0;for(let a=0;a<this.rowIndex;a++)o+=i[a];const r=i[this.rowIndex];return{topOffset:o,rowHeight:r}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const s of t)this.recycleAndCreateHeaderCtrls(s,e);const i=s=>{const{focusService:n,visibleColsService:o}=this.beans;return n.isHeaderWrapperFocused(s)?o.isVisible(s.getColumnGroupChild()):!1};if(e)for(const[s,n]of e)i(n)?this.headerCellCtrls.set(s,n):this.destroyBean(n);return this.getHeaderCellCtrls()}getHeaderCellCtrls(){var e;return Array.from(((e=this.headerCellCtrls)==null?void 0:e.values())??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),s==null)switch(this.type){case"filter":{s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break}case"group":s=this.createBean(new bE(e,this.beans,this));break;default:s=this.createBean(new wE(e,this.beans,this));break}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach(s=>{const n=i.getHeadersToRender(s,t);e=e.concat(n)}),e}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;const t=this.getHeaderCellCtrls();let i;return typeof e=="function"?i=t.find(e):i=t.find(s=>s.getColumnGroupChild()==e),i}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);return i?i.focus(t):!1}destroy(){var e;(e=this.headerCellCtrls)==null||e.forEach(t=>{this.destroyBean(t)}),this.headerCellCtrls=void 0,super.destroy()}},FE=class extends G{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i});const s=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;this.ctrlsService.register(s,this),this.columnModel.isReady()&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const t=new To,i=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const a=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let d=0;d<a;d++){const h=this.createBean(new Pu(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(h)}},n=()=>{const a=t.next(),d=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==a);(d||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),d&&(this.columnsRowCtrl=this.createBean(new Pu(a,this.pinned,"column")))},o=()=>{var h;this.includeFloatingFilter=!!((h=this.filterManager)!=null&&h.hasFloatingFilters())&&!this.hidden;const a=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){a();return}const d=t.next();if(this.filtersRowCtrl){const p=this.filtersRowCtrl.getRowIndex()!==d;(!e||p)&&a()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Pu(d,this.pinned,"filter")))};s(),n(),o();const r=this.getAllCtrls();this.comp.setCtrls(r),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){var t;if(Xs(e))return(t=this.columnsRowCtrl)==null?void 0:t.getHeaderCellCtrl(e);if(this.groupsRowCtrls.length!==0)for(let i=0;i<this.groupsRowCtrls.length;i++){const s=this.groupsRowCtrls[i].getHeaderCellCtrl(e);if(s)return s}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const n=this.getAllCtrls()[e];return n?n.focusHeader(t,i):!1}getViewportElement(){return this.eViewport}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new mE(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){var t;const e=((t=this.filterManager)==null?void 0:t.hasFloatingFilters())&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Fu(e=>this.comp.setCenterWidth(`${e}px`),!0))}setupPinnedWidth(){if(this.pinned==null)return;const e=this.pinned==="left",t=this.pinned==="right";this.hidden=!0;const i=()=>{const s=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(s==null)return;const n=s==0,o=this.hidden!==n,r=this.gos.get("enableRtl"),a=this.scrollVisibleService.getScrollbarWidth(),h=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?s+a:s;this.comp.setPinnedContainerWidth(`${h}px`),this.comp.setDisplayed(!n),o&&(this.hidden=n,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},EE='<div class="ag-pinned-left-header" role="rowgroup"></div>',xE='<div class="ag-pinned-right-header" role="rowgroup"></div>',PE=`<div class="ag-header-viewport" role="presentation">
101
- <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div>
102
- </div>`,Du=class extends ke{constructor(e){super(),this.eCenterContainer=ee,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:i=>this.setDisplayed(i),setCtrls:i=>this.setCtrls(i),setCenterWidth:i=>this.eCenterContainer.style.width=i,setViewportScrollLeft:i=>this.getGui().scrollLeft=i,setPinnedContainerWidth:i=>{const s=this.getGui();s.style.width=i,s.style.maxWidth=i,s.style.minWidth=i}};this.createManagedBean(new FE(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",i=e?EE:t?xE:PE;this.setTemplate(i),this.eRowContainer=this.eCenterContainer!==ee?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let i;const s=n=>{const o=n.getGui();o.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(o),i&&lf(this.eRowContainer,o,i),i=o};e.forEach(n=>{const o=n.instanceId,r=t[o];delete t[o];const a=r||this.createBean(new oE(n));this.headerRowComps[o]=a,this.rowCompsList.push(a),s(a)}),Qs(t).forEach(n=>this.destroyRowComp(n))}},DE=class extends ke{constructor(){super('<div class="ag-header" role="presentation"/>')}postConstruct(){const e={addOrRemoveCssClass:(s,n)=>this.addOrRemoveCssClass(s,n),setHeightAndMinHeight:s=>{this.getGui().style.height=s,this.getGui().style.minHeight=s}};this.createManagedBean(new lE).setComp(e,this.getGui(),this.getFocusableElement());const i=s=>{this.createManagedBean(s),this.appendChild(s)};i(new Du("left")),i(new Du(null)),i(new Du("right"))}},TE={selector:"AG-HEADER-ROOT",component:DE},Tu=class extends G{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return["normal","print","autoHeight"].indexOf(e)===-1?(z(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}},AE=class extends ke{constructor(){super(`
103
- <div class="ag-overlay" role="presentation">
104
- <div class="ag-overlay-panel" role="presentation">
105
- <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div>
106
- </div>
107
- </div>`),this.eOverlayWrapper=ee,this.activePromise=null,this.activeOverlay=null,this.updateListenerDestroyFunc=null,this.activeOverlayWrapperCssClass=null,this.elToFocusAfter=null}wireBeans(e){this.overlayService=e.overlayService,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}handleKeyDown(e){if(e.key!==B.TAB||e.defaultPrevented||Ds(e)||this.focusService.findNextFocusableElement(this.eOverlayWrapper,!1,e.shiftKey))return;let i=!1;e.shiftKey?i=this.focusService.focusGridView(he(this.visibleColsService.getAllCols()),!0,!1):i=this.focusService.focusNextGridCoreContainer(!1),i&&e.preventDefault()}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new Tu(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.setOverlayWrapperComp(this),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i,s){if(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,!!e){if(this.setDisplayed(!0,{skipAriaHidden:!0}),i&&this.focusService.isGridFocused()){const n=Je(this.gos);n&&!Eg(this.gos)&&(this.elToFocusAfter=n)}e.then(n=>{if(this.activePromise!==e){this.activeOverlay!==n&&(this.destroyBean(n),n=null);return}if(this.activePromise=null,!n)return;if(this.activeOverlay!==n&&(this.eOverlayWrapper.appendChild(n.getGui()),this.activeOverlay=n,s)){const r=n;this.updateListenerDestroyFunc=this.addManagedPropertyListener(s,({currentValue:a})=>{var d;(d=r.refresh)==null||d.call(r,this.gos.addGridCommonParams({...a??{}}))})}const o=this.focusService;i&&o.isGridFocused()&&o.focusInto(this.eOverlayWrapper)})}}updateOverlayWrapperPaddingTop(e){this.eOverlayWrapper.style.setProperty("padding-top",`${e}px`)}destroyActiveOverlay(){var s;this.activePromise=null;const e=this.activeOverlay;if(!e)return;let t=this.elToFocusAfter;this.activeOverlay=null,this.elToFocusAfter=null,t&&!this.focusService.isGridFocused()&&(t=null);const i=this.updateListenerDestroyFunc;i&&(i(),this.updateListenerDestroyFunc=null),this.destroyBean(e),Lt(this.eOverlayWrapper),(s=t==null?void 0:t.focus)==null||s.call(t,{preventScroll:!0})}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.overlayService.setOverlayWrapperComp(void 0),super.destroy()}},ME={selector:"AG-OVERLAY-WRAPPER",component:AE},tm=class extends ke{constructor(e,t){super(),this.direction=t,this.eViewport=ee,this.eContainer=ee,this.hideTimeout=null,this.setTemplate(e)}wireBeans(e){this.animationFrameService=e.animationFrameService}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Jg()||Js())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=tf(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),i=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:i,touchend:i})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)}})}attemptSettingScrollPosition(e){const t=this.getViewportElement();Oy(()=>di(t),()=>this.setScrollPosition(e),100)}getViewportElement(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}},kE=class extends tm{constructor(){super(`<div class="ag-body-horizontal-scroll" aria-hidden="true">
108
- <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div>
109
- <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport">
110
- <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div>
111
- </div>
112
- <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div>
113
- </div>`,"horizontal"),this.eLeftSpacer=ee,this.eRightSpacer=ee}wireBeans(e){super.wireBeans(e),this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Fu(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.visibleColsService.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.scrollVisibleService.getScrollbarWidth();i&&(t+=s),zi(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let n=this.visibleColsService.getColsLeftWidth();this.enableRtl&&e&&(n+=s),zi(this.eLeftSpacer,n),this.eLeftSpacer.classList.toggle("ag-scroller-corner",n<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.scrollVisibleService.getScrollbarWidth()||0,o=i?0:s===0&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ar(this.getGui(),o),Ar(this.eViewport,o),Ar(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return wa(this.getViewportElement(),this.enableRtl)}setScrollPosition(e){di(this.getViewportElement())||this.attemptSettingScrollPosition(e),Sa(this.getViewportElement(),e,this.enableRtl)}},IE={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:kE},im=class extends G{wireBeans(e){this.maxDivHeightScaler=e.rowContainerHeightService}constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this)})}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=e!=null?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}},LE=class extends tm{wireBeans(e){super.wireBeans(e),this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}constructor(){super(`<div class="ag-body-vertical-scroll" aria-hidden="true">
114
- <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">
115
- <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>
116
- </div>
117
- </div>`,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new im(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.scrollVisibleService.getScrollbarWidth()||0,s=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),zi(this.getGui(),s),zi(this.eViewport,s),zi(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),s=this.getScrollPosition(),n=i.scrollTop;s!=n&&this.setScrollPosition(n,!0)}getScrollPosition(){return this.getViewportElement().scrollTop}setScrollPosition(e,t){!t&&!di(this.getViewportElement())&&this.attemptSettingScrollPosition(e),this.getViewportElement().scrollTop=e}},_E={selector:"AG-FAKE-VERTICAL-SCROLL",component:LE},Au=(e=>(e.FakeHScrollbar="fakeHScrollComp",e.Header="centerHeader",e.PinnedTop="topCenter",e.PinnedBottom="bottomCenter",e.StickyTop="stickyTopCenter",e.StickyBottom="stickyBottomCenter",e))(Au||{}),OE=class extends G{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Wt(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Wt(()=>this.lastScrollSource[0]=null,500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady(this,e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this,"Viewport")});for(const e of Object.values(Au)){const t=this.ctrlsService.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.ctrlsService.get("fakeVScrollComp"),t=this.gos.get("debounceVerticalScrollbar"),i=t?Wt(this.onVScroll.bind(this,"Viewport"),100):this.onVScroll.bind(this,"Viewport"),s=t?Wt(this.onVScroll.bind(this,"fakeVScrollComp"),100):this.onVScroll.bind(this,"fakeVScrollComp");this.addManagedElementListeners(this.eBodyViewport,{scroll:i}),this.registerScrollPartner(e,s)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...Object.values(Au),"Viewport"]){if(this.lastScrollSource[1]===t)continue;const i=this.getViewportForSource(t);Sa(i,e,this.enableRtl)}}getViewportForSource(e){return e==="Viewport"?this.centerRowsCtrl.getViewportElement():this.ctrlsService.get(e).getViewportElement()}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;const s=wa(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;let t;e==="Viewport"?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e==="Viewport"?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{this.eventService.dispatchEvent({...t,type:"bodyScrollEnd"})},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!Js()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=ma(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&va()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScroll("Viewport")}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl&&va()?e=e>0?0:s:e=Math.min(Math.max(e,0),s)),Sa(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let n=0;n<i;n++){const o=this.rowModel.getRow(n);if(typeof e=="function"){if(o&&e(o)){s=n;break}}else if(e===o||e===o.data){s=n;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(Ft(this.gos,"print"))return;const i=this.rowModel.getRowCount();if(typeof e!="number"||e<0||e>=i){z("Invalid row index for ensureIndexVisible: "+e);return}const n=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{var p;n||(p=this.paginationService)==null||p.goToPageWithIndex(e);const o=this.ctrlsService.getGridBodyCtrl(),r=o.getStickyTopHeight(),a=o.getStickyBottomHeight(),d=this.rowModel.getRow(e);let h;do{const f=d.rowTop,m=d.rowHeight,v=this.pageBoundsService.getPixelOffset(),w=d.rowTop-v,S=w+d.rowHeight,b=this.getVScrollPosition(),R=this.heightScaler.getDivStretchOffset(),x=b.top+R,T=b.bottom+R,I=T-x,V=this.heightScaler.getScrollPositionForPixel(w),L=this.heightScaler.getScrollPositionForPixel(S-I),A=Math.min((V+L)/2,w),k=x+r>w,N=T-a<S;let $=null;t==="top"?$=V:t==="bottom"?$=L:t==="middle"?$=A:k?$=V-r:N&&($=L+a),$!==null&&(this.setVerticalScrollPosition($),this.rowRenderer.redraw({afterScroll:!0})),h=f!==d.rowTop||m!==d.rowHeight}while(h);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i||i.isPinned()||!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{s!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),n=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),o=this.centerRowsCtrl.getCenterWidth(),r=this.enableRtl;let a=(r?i:s)||n,d=r?s:i;t!=="auto"&&(a=t==="start",d=t==="end");const h=t==="middle";if(a||d||h){const{colLeft:p,colMiddle:f,colRight:m}=this.getColumnBounds(e);return h?f-o/2:a?r?m:p:r?p-o:m-o}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:n}=this.getColumnBounds(e),o=this.enableRtl,r=o?t>n:i<n,a=o?i<s:t>s;return{columnBeforeStart:r,columnAfterEnd:a}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),n=e.getLeft(),o=t?-1:1,r=t?i-n:n,a=r+s*o,d=r+s/2*o;return{colLeft:r,colMiddle:d,colRight:a}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),i=t,s=e+t;return{start:i,end:s,width:e}}},VE=class extends G{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleService.onCentreViewportResized(),this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=Do(e);if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const s=this.gos.getCallback("processUnpinnedColumns");i.length&&(s&&(i=s({columns:i,viewportWidth:t})),this.columnModel.setColsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth(),i=this.pinnedWidthService.getPinnedLeftWidth(),s=t+i;if(s<e)return[];const n=[...this.visibleColsService.getLeftCols()],o=[...this.visibleColsService.getRightCols()];let r=0,a=0;const d=0,h=[];let p=s-d-e;for(;(a<n.length||r<o.length)&&p>0;){if(r<o.length){const f=o[r++];p-=f.getActualWidth(),h.push(f)}if(a<n.length&&p>0){const f=n[a++];p-=f.getActualWidth(),h.push(f)}}return h}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=ma(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventService.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},NE=class extends G{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{ei(this.gos)?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),ei(this.gos)&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},BE=class extends ke{constructor(){super(`
118
- <div class="ag-selection-checkbox" role="presentation">
119
- <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
120
- </div>`,[cu]),this.eCheckbox=ee}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=$d(e,t),[s,n]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],o=e(s,n);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${o} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:s=>Fo(s),click:s=>{Fo(s);const n=kd(this.gos)==="filteredDescendants",o=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(o,n)?this.onClicked(!0,n,s||{})===0&&this.onClicked(!1,n,s):o?this.onClicked(!1,n,s):this.onClicked(!0,n,s||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),Ad(this.gos)||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:s}),this.addManagedListeners(this.rowNode,{dataChanged:s,cellChanged:s}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&st(this.gos)}showOrHideSelect(){var n,o,r;let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if(typeof t=="function"){const a=(n=this.overrides)==null?void 0:n.callbackParams;if(!this.column)e=t({...a,node:this.rowNode,data:this.rowNode.data});else{const d=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...a,...d})}}else e=t??!1;const i=this.gos.get("rowSelection");if(i&&typeof i!="string"?!Hy(i):(o=this.column)==null?void 0:o.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!e),this.setVisible(!0),this.setDisplayed(!0);return}if((r=this.overrides)!=null&&r.removeHidden){this.setDisplayed(e);return}this.setVisible(e)}getIsVisible(){var t,i;if(this.overrides)return this.overrides.isVisible;const e=this.gos.get("rowSelection");return e&&typeof e!="string"?Ro(e):(i=(t=this.column)==null?void 0:t.getColDef())==null?void 0:i.checkboxSelection}},GE=class extends ke{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(_t("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const s=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",s),e.dataTransfer.setData("text/plain",s)}catch{}};if(t){const s=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e});t(s)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},HE=class extends G{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),s=e.cellStyle;t=s(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}},WE=class extends G{constructor(e,t,i,s,n){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=n}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case B.ENTER:this.onEnterKeyDown(e);break;case B.F2:this.onF2KeyDown(e);break;case B.ESCAPE:this.onEscapeKeyDown(e);break;case B.TAB:this.onTabKeyDown(e);break;case B.BACKSPACE:case B.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case B.DOWN:case B.UP:case B.RIGHT:case B.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:n}=this,{gos:o,rangeService:r,eventService:a}=s;if(!i.isEditing()){if(a.dispatchEvent({type:"keyShortcutChangedCellStart"}),hF(e,o.get("enableCellEditingOnBackspace"))){if(r&&ei(o))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const d=i.getColumn(),h=this.beans.valueService.getDeleteValue(d,n);n.setDataValue(d,h,"cellClear")}}else i.startRowOrCellEdit(e,t);a.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?B.UP:B.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(B.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(B.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const s=e.key;s===" "?this.onSpaceKeyDown(e):this.cellCtrl.startRowOrCellEdit(s,e)&&e.preventDefault()}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&ia(t)){const i=this.rowNode.isSelected(),s=!i,n=kd(t)==="filteredDescendants",o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:n,event:e,source:"spaceKey"});i===void 0&&o===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:n,event:e,source:"spaceKey"})}e.preventDefault()}destroy(){super.destroy()}},zE=class extends G{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Ds(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(e),e.preventDefault();return}const{eventService:t,rangeService:i,gos:s}=this.beans,n=e.ctrlKey||e.metaKey;i&&n&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const o=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(o);const r=this.column.getColDef();r.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{r.onCellClicked(o)})},0),(s.get("singleClickEdit")||r.singleClickEdit)&&!s.get("suppressClickEdit")&&!(e.shiftKey&&(i==null?void 0:i.getCellRanges().length)!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Js()||Og("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const{column:t,beans:i,cellCtrl:s}=this,{eventService:n,frameworkOverrides:o,gos:r}=i,a=t.getColDef(),d=s.createEvent(e,"cellDoubleClicked");n.dispatchEvent(d),typeof a.onCellDoubleClicked=="function"&&window.setTimeout(()=>{o.wrapOutgoing(()=>{a.onCellDoubleClicked(d)})},0),!r.get("singleClickEdit")&&!r.get("suppressClickEdit")&&s.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,n=e.target,{cellCtrl:o,beans:r}=this,{eventService:a,rangeService:d,focusService:h,gos:p}=r;if(this.isRightClickInExistingRange(e))return;const f=d&&d.getCellRanges().length!=0;if(!s||!f){const v=p.get("enableCellTextSelection")&&e.defaultPrevented,w=(gs()||v)&&!o.isEditing()&&!nu(n);o.focusCell(w)}if(s&&f&&!h.isCellFocused(o.getCellPosition())){e.preventDefault();const m=h.getFocusedCell();if(m){const{column:v,rowIndex:w,rowPinned:S}=m,b=r.rowRenderer.getRowByPosition({rowIndex:w,rowPinned:S}),R=b==null?void 0:b.getCellCtrl(v);R!=null&&R.isEditing()&&R.stopEditing(),h.setFocusedCell({column:v,rowIndex:w,rowPinned:S,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(n)){if(d){const m=this.cellCtrl.getCellPosition();if(s)d.extendLatestRangeToCell(m);else{const v=t||i;d.setRangeToCell(m,v)}}a.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=e.button===2||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return Po(e,"ag-selection-checkbox",3)}onMouseOut(e){this.mouseStayingInsideCell(e)||(this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),this.beans.columnHoverService.clearMouseOver())}onMouseOver(e){this.mouseStayingInsideCell(e)||(this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),this.beans.columnHoverService.setMouseOver([this.column]))}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},UE=class extends G{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();hs(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(e===1)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let n=0;i&&n<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),!(!i||Ve(i)||s!==i.getPinned()));n++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return this.beans.gos.get("enableRtl")&&this.colsSpanning?e=he(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.visibleColsService.getColsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.visibleColsService.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(e){if(this.rowSpan===1&&!e)return;const i=On(this.beans.gos)*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Or=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(Or||{}),Mu=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(Mu||{}),Vr="ag-cell-range-selected",$E="ag-cell-range-chart",KE="ag-cell-range-single-cell",jE="ag-cell-range-chart-category",ZE="ag-cell-range-handle",qE="ag-cell-range-top",YE="ag-cell-range-right",QE="ag-cell-range-bottom",XE="ag-cell-range-left",JE=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onCellSelectionChanged()}onCellSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Vr,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${Vr}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${Vr}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${Vr}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${Vr}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass($E,this.hasChartRange),pa(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(KE,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,n=!t&&e.bottom,o=!t&&e.left;this.cellComp.addOrRemoveCssClass(qE,i),this.cellComp.addOrRemoveCssClass(YE,s),this.cellComp.addOrRemoveCssClass(QE,n),this.cellComp.addOrRemoveCssClass(XE,o)}isSingleCell(){const{rangeService:e}=this.beans;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>Ps([1,0],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,n=!1;const o=this.cellCtrl.getCellPosition().column,r=this.beans.visibleColsService;let a,d;e?(a=r.getColAfter(o),d=r.getColBefore(o)):(a=r.getColBefore(o),d=r.getColAfter(o));const h=this.rangeService.getCellRanges().filter(p=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),p));a||(n=!0),d||(i=!0);for(let p=0;p<h.length&&!(t&&i&&s&&n);p++){const f=h[p],m=this.rangeService.getRangeStartRow(f),v=this.rangeService.getRangeEndRow(f);!t&&this.beans.rowPositionUtils.sameRow(m,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(v,this.cellCtrl.getCellPosition())&&(s=!0),!n&&a&&f.columns.indexOf(a)<0&&(n=!0),!i&&d&&f.columns.indexOf(d)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:n}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(ZE,!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=he(t),n=this.cellCtrl.getCellPosition(),o=Ag(e)&&!this.cellCtrl.isSuppressFillHandle(),r=zy(e);let a=i===1&&!this.cellCtrl.isEditing()&&(o||r);if(this.hasChartRange){const h=t[0].type===1&&this.rangeService.isCellInSpecificRange(n,t[0]);this.cellComp.addOrRemoveCssClass(jE,h),a=s.type===0}return a&&s.endRow!=null&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,n)}addSelectionHandle(){const e=he(this.rangeService.getCellRanges()).type,i=Ag(this.beans.gos)&&Ve(e)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},ex="ag-cell",tx="ag-cell-auto-height",ix="ag-cell-normal-height",sx="ag-cell-focus",nx="ag-cell-first-right-pinned",ox="ag-cell-last-left-pinned",rx="ag-cell-not-inline-editing",lx="ag-column-hover",ax="ag-cell-wrap-text",cx=0,sm=class ug extends G{constructor(t,i,s,n){super(),this.column=t,this.rowNode=i,this.beans=s,this.rowCtrl=n,this.cellRangeFeature=void 0,this.cellPositionFeature=void 0,this.cellCustomStyleFeature=void 0,this.tooltipFeature=void 0,this.cellMouseListenerFeature=void 0,this.cellKeyboardListenerFeature=void 0,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.onCellEditorAttachedFuncs=[],this.instanceId=t.getId()+"-"+cx++,this.colIdSanitised=ps(this.column.getId()),this.createCellPosition(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}onFocusOut(){this.beans.focusService.clearRestoreFocus()}addFeatures(){this.cellPositionFeature=new UE(this,this.beans),this.cellCustomStyleFeature=new HE(this,this.beans),this.cellMouseListenerFeature=new zE(this,this.beans,this.column),this.cellKeyboardListenerFeature=new WE(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.column.isTooltipEnabled()&&this.enableTooltipFeature(),this.beans.rangeService&&ei(this.beans.gos)&&(this.cellRangeFeature=new JE(this.beans,this))}removeFeatures(){const t=this.beans.context;this.cellPositionFeature=t.destroyBean(this.cellPositionFeature),this.cellCustomStyleFeature=t.destroyBean(this.cellCustomStyleFeature),this.cellMouseListenerFeature=t.destroyBean(this.cellMouseListenerFeature),this.cellKeyboardListenerFeature=t.destroyBean(this.cellKeyboardListenerFeature),this.cellRangeFeature=t.destroyBean(this.cellRangeFeature),this.disableTooltipFeature()}enableTooltipFeature(t,i){const s=()=>{const r=this.column.getColDef(),a=this.rowNode.data;if(r.tooltipField&&q(a))return Fr(a,r.tooltipField,this.column.isTooltipFieldContainsDots());const d=r.tooltipValueGetter;return d?d(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},n=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!i&&n&&!this.isCellRenderer()&&(i=()=>{const r=this.getGui(),a=r.children.length===0?r:r.querySelector(".ag-cell-value");return a?a.scrollWidth>a.clientWidth:!0});const o={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:t!=null?()=>t:s,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:i};this.tooltipFeature=new Ao(o,this.beans)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature)}setComp(t,i,s,n,o,r){var a,d,h,p;this.cellComp=t,this.eGui=i,this.printLayout=n,r??(r=this),this.addDomData(r),this.addFeatures(),r.addDestroyFunc(()=>this.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s,r),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),(a=this.cellPositionFeature)==null||a.setComp(i),(d=this.cellCustomStyleFeature)==null||d.setComp(t),(h=this.tooltipFeature)==null||h.refreshToolTip(),(p=this.cellKeyboardListenerFeature)==null||p.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(t,i),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(f=>f()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(t,i){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!t)return;const s=t.parentElement,n=qs(this.beans.gos,this.rowNode).height,o=d=>{if(this.editing||!this.isAlive()||!i.isAlive())return;const{paddingTop:h,paddingBottom:p,borderBottomWidth:f,borderTopWidth:m}=Hn(s),v=h+p+f+m,S=t.offsetHeight+v;if(d<5){const R=lt(this.beans.gos),x=!R||!R.contains(t),T=S==0;if(x||T){window.setTimeout(()=>o(d+1),0);return}}const b=Math.max(S,n);this.rowNode.setRowAutoHeight(b,this.column)},r=()=>o(0);r();const a=this.beans.resizeObserverService.observeResize(t,r);i.addDestroyFunc(()=>{a(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){const t=this.column.getColDef();return t.cellRenderer!=null||t.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}showValue(t=!1){var o,r;const i=this.getValueToDisplay();let s;if(this.rowNode.stub&&((o=this.rowNode.groupData)==null?void 0:o[this.column.getId()])==null){const a=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),a)}else if(this.isCellRenderer()){const a=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),a)}this.cellComp.setRenderDetails(s,i,t),(r=this.cellRangeFeature)==null||r.refreshHandle()}setupControlComps(){const t=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(t)),this.includeRowDrag=this.isIncludeControl(t.rowDrag),this.includeDndSource=this.isIncludeControl(t.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(t){return this.rowNode.rowPinned!=null?!1:typeof t=="function"||t===!0}isCheckboxSelection(t){const{rowSelection:i}=this.beans.gridOptions;return t.checkboxSelection||Eo(this.column)&&i&&typeof i!="string"&&Ro(i)}refreshShouldDestroy(){const t=this.column.getColDef(),i=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(t)),s=this.includeRowDrag!=this.isIncludeControl(t.rowDrag),n=this.includeDndSource!=this.isIncludeControl(t.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return i||s||n||o}startEditing(t=null,i=!1,s=null){const{editService:n}=this.beans;return!this.isCellEditable()||this.editing||!n?!0:this.cellComp?n.startEditing(this,t,i,s):(this.onCellCompAttachedFuncs.push(()=>{this.startEditing(t,i,s)}),!0)}setEditing(t,i){var s;this.editCompDetails=i,this.editing!==t&&(this.editing=t,(s=this.cellRangeFeature)==null||s.refreshHandle())}stopRowOrCellEdit(t=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(t):this.stopEditing(t)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(t=!1){this.onCellEditorAttachedFuncs=[];const{editService:i}=this.beans;return!this.editing||!i?!1:i.stopEditing(this,t)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.beans.valueService.getValueForDisplay(this.column,this.rowNode),setValue:i=>this.beans.valueService.setValue(this.rowNode,this.column,i),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(i,s,n,o)=>this.registerRowDragger(i,s,o),setTooltip:(i,s)=>{var n;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(i,s),(n=this.tooltipFeature)==null||n.refreshToolTip()}})}setFocusOutOnEditor(){var t;this.editing&&((t=this.beans.editService)==null||t.setFocusOutOnEditor(this))}setFocusInOnEditor(){var t;this.editing&&((t=this.beans.editService)==null||t.setFocusInOnEditor(this))}onCellChanged(t){t.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(t){var i;this.refreshShouldDestroy()?(i=this.rowCtrl)==null||i.recreateCell(this):this.refreshCell(t)}refreshCell(t){var p,f,m,v,w;if(this.suppressRefreshCell||this.editing)return;const i=this.column.getColDef(),s=t!=null&&!!t.newData,n=t!=null&&!!t.suppressFlash||!!i.suppressCellFlash,o=i.field==null&&i.valueGetter==null&&i.showRowGroup==null,r=t&&t.forceRefresh||o||s,a=!!this.cellComp,d=this.updateAndFormatValue(a),h=r||d;if(a){if(h){this.showValue(s);const S=(p=this.beans.filterManager)==null?void 0:p.isSuppressFlashingCellsBecauseFiltering();!n&&!S&&(this.beans.gos.get("enableCellChangeFlash")||i.enableCellChangeFlash)&&this.flashCell(),(f=this.cellCustomStyleFeature)==null||f.applyUserStyles(),(m=this.cellCustomStyleFeature)==null||m.applyClassesFromColDef()}(v=this.tooltipFeature)==null||v.refreshToolTip(),(w=this.cellCustomStyleFeature)==null||w.applyCellClassRules()}}stopEditingAndFocus(t=!1,i=!1){var s;(s=this.beans.editService)==null||s.stopEditingAndFocus(this,t,i)}flashCell(t){const i=(t==null?void 0:t.flashDuration)??(t==null?void 0:t.flashDelay),s=(t==null?void 0:t.fadeDuration)??(t==null?void 0:t.fadeDelay);this.animateCell("data-changed",i,s)}animateCell(t,i,s){if(!this.cellComp)return;const{gos:n}=this.beans;if(i||(i=n.get("cellFlashDuration")),i===0)return;q(s)||(s=n.get("cellFadeDuration"));const o=`ag-cell-${t}`,r=`ag-cell-${t}-animation`;this.cellComp.addOrRemoveCssClass(o,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},s))},i)})}onFlashCells(t){if(!this.cellComp)return;const i=this.beans.cellPositionUtils.createId(this.getCellPosition());t.cells[i]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(t){return this.callValueFormatter(t)??t}callValueFormatter(t){return this.beans.valueService.formatValue(this.column,this.rowNode,t)}updateAndFormatValue(t){const i=this.value,s=this.valueFormatted;return this.value=this.beans.valueService.getValueForDisplay(this.column,this.rowNode),this.valueFormatted=this.callValueFormatter(this.value),t?!this.valuesAreEqual(i,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(t,i){const s=this.column.getColDef();return s.equals?s.equals(t,i):t===i}getComp(){return this.cellComp}getValue(){return this.value}addDomData(t){const i=this.getGui();Vn(this.beans.gos,i,ug.DOM_DATA_KEY_CELL_CTRL,this),t.addDestroyFunc(()=>Vn(this.beans.gos,i,ug.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(t,i){return this.beans.gos.addGridCommonParams({type:i,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:t,rowIndex:this.rowNode.rowIndex})}processCharacter(t){var i;(i=this.cellKeyboardListenerFeature)==null||i.processCharacter(t)}onKeyDown(t){var i;(i=this.cellKeyboardListenerFeature)==null||i.onKeyDown(t)}onMouseEvent(t,i){var s;(s=this.cellMouseListenerFeature)==null||s.onMouseEvent(t,i)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var t;this.cellComp&&((t=this.cellPositionFeature)==null||t.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:t,column:i,beans:s}=this;Uf(t,i,s.visibleColsService)}refreshAriaColIndex(){const t=this.beans.visibleColsService.getAriaColIndex(this.column);Qg(this.getGui(),t)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var t;return(t=this.cellPositionFeature)==null?void 0:t.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(t,i=null){return this.cellComp?this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(t,this):this.startEditing(t,!0,i):(this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(t,i)}),!0)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(t=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:t})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onCellSelectionChanged()}onSuppressCellFocusChanged(t){this.eGui&&Pi(this.eGui,"tabindex",t?void 0:-1)}onFirstRightPinnedChanged(){if(!this.cellComp)return;const t=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(nx,t)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const t=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(ox,t)}onCellFocused(t){if(this.beans.focusService.isCellFocusSuppressed())return;const i=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){i&&(t!=null&&t.forceBrowserFocus)&&(this.focusEventToRestore=t);return}if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(sx,i),i&&t&&t.forceBrowserFocus){let n=this.cellComp.getFocusableElement();if(this.editing){const o=this.beans.focusService.findFocusableElements(n,null,!0);o.length&&(n=o[0])}n.focus({preventScroll:!!t.preventScrollOnBrowserFocus})}const s=this.beans.gos.get("editType")==="fullRow";!i&&!s&&this.editing&&this.stopRowOrCellEdit(),i&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:Gi(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(ex,!0),this.cellComp.addOrRemoveCssClass(rx,!0);const t=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(tx,t),this.cellComp.addOrRemoveCssClass(ix,!t)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(lx,t)}onColDefChanged(){var i;if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?(i=this.beans.editService)==null||i.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const t=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(ax,t)}dispatchCellContextMenuEvent(t){const i=this.column.getColDef(),s=this.createEvent(t,"cellContextMenu");this.beans.eventService.dispatchEvent(s),i.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{i.onCellContextMenu(s)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],this.onCellEditorAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const t=new BE;return this.beans.context.createBean(t),t.init({rowNode:this.rowNode,column:this.column}),t}createDndSource(){const t=new GE(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(t),t}registerRowDragger(t,i,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(t,i);return}const n=this.createRowDragComp(t,i,s);n&&(this.customRowDragComp=n,this.addDestroyFunc(()=>{this.beans.context.destroyBean(n),this.customRowDragComp=null}))}createRowDragComp(t,i,s){const n=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragManaged"),r=st(this.beans.gos);if(o){if(!r){z("managed row dragging is only allowed in the Client Side Row Model");return}if(n){z("managed row dragging is not possible when doing pagination");return}}const a=new uu(()=>this.value,this.rowNode,this.column,t,i,s);return this.beans.context.createBean(a),a}setSuppressRefreshCell(t){this.suppressRefreshCell=t}getEditCompDetails(){return this.editCompDetails}onCellEditorAttached(t){this.onCellEditorAttachedFuncs.push(t)}cellEditorAttached(){this.onCellEditorAttachedFuncs.forEach(t=>t()),this.onCellEditorAttachedFuncs=[]}};sm.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var sn=sm,dx=0,nm=class hg extends G{constructor(t,i,s,n,o){var r;super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=i,this.gos=i.gos,this.rowNode=t,this.paginationPage=((r=i.paginationService)==null?void 0:r.getCurrentPage())??0,this.useAnimationFrameForCreate=n,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=t.id+"-"+dx++,this.rowId=ps(t.id),this.initRowBusinessKey(),this.rowFocused=i.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=i.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const t=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=ps(t)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}isSticky(){return this.rowNode.sticky}updateGui(t,i){t==="left"?this.leftGui=i:t==="right"?this.rightGui=i:t==="fullWidth"?this.fullWidthGui=i:this.centerGui=i}setComp(t,i,s,n){n=xr(this,this.beans.context,n);const o={rowComp:t,element:i,containerType:s,compBean:n};this.allRowGuis.push(o),this.updateGui(s,o),this.initialiseRowComp(o),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(t){this.allRowGuis=this.allRowGuis.filter(i=>i.containerType!==t),this.updateGui(t,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(t){const i=t?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=i)}initialiseRowComp(t){const i=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),ia(i)&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(o=>s.addOrRemoveCssClass(o,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&Dr(t.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),Vn(i,t.element,hg.DOM_DATA_KEY_ROW_CTRL,this),t.compBean.addDestroyFunc(()=>Vn(i,t.element,hg.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(t){this.businessKeySanitised!=null&&t.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(t){this.rowId=ps(this.rowNode.id),this.rowId!=null&&t.setRowId(this.rowId)}executeSlideAndFadeAnimations(t){const{containerType:i}=t;this.slideInAnimation[i]&&(Sg(()=>{this.onTopChanged()}),this.slideInAnimation[i]=!1),this.fadeInAnimation[i]&&(Sg(()=>{t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[i]=!1)}addRowDraggerToRow(t){if(ei(this.gos)){z("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `cellSelection: true`");return}const i=this.beans.localeService.getLocaleTextFunc(),s=new uu(()=>`1 ${i("rowDragRow","row")}`,this.rowNode,void 0,t.element,void 0,!0),n=this.createBean(s,this.beans.context);this.rowDragComps.push(n),t.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(o=>o!==n),this.destroyBean(n,this.beans.context)})}setupFullWidth(t){const i=this.getPinnedForContainer(t.containerType);if(this.rowType=="FullWidthDetail"&&!this.gos.assertModuleRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)"))return;const s=this.createFullWidthCompDetails(t.element,i);t.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var t,i;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(s=>{var n;return(n=s==null?void 0:s.rowComp)==null?void 0:n.getFullWidthCellRenderer()}):[(i=(t=this.fullWidthGui)==null?void 0:t.rowComp)==null?void 0:i.getFullWidthCellRenderer()]}getCellElement(t){const i=this.getCellCtrl(t);return i?i.getGui():null}executeProcessRowPostCreateFunc(){const t=this.gos.getCallback("processRowPostCreate");if(!t||!this.areAllContainersReady())return;const i={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};t(i)}areAllContainersReady(){const t=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),i=!!this.centerGui,s=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return t&&i&&s}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this.rowNode}):!1}setRowType(){const t=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow")&&!this.gos.get("groupHideOpenParents"),i=this.isNodeFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,n=this.beans.columnModel.isPivotMode(),r=!!this.rowNode.group&&!this.rowNode.footer&&oa(this.gos,n);t?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":i?this.rowType="FullWidth":r?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(t=!1,i=!1){if(this.isFullWidth())return;if(t||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(i);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(t,i,s=null){const n={list:[],map:{}},o=(r,a)=>{n.list.push(a),n.map[r]=a};return i.forEach(r=>{const a=r.getInstanceId();let d=t.map[a];d||(d=new sn(r,this.rowNode,this.beans,this)),o(a,d)}),t.list.forEach(r=>{const a=r.getColumn().getInstanceId();if(n.map[a]!=null)return;if(!this.isCellEligibleToBeRemoved(r,s)){o(a,r);return}r.destroy()}),n}updateColumnListsImpl(t){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(t)}setCellCtrls(t){this.allRowGuis.forEach(i=>{const s=this.getCellCtrlsForContainer(i.containerType);i.rowComp.setCellCtrls(s,t)})}getCellCtrlsForContainer(t){switch(t){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const t=this.beans.columnViewportService,i=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=t.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const n=i.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,n,"left");const o=i.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(t,i){if(t.getColumn().getPinned()!=i)return!0;const r=t.isEditing(),a=this.beans.focusService.isCellFocused(t.getCellPosition());if(r||a){const h=t.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(h)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||Ft(this.gos,"print")}listenOnDomOrder(t){const i=()=>{t.rowComp.setDomOrder(this.getDomOrder())};t.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],i)}setAnimateFlags(t){if(this.isSticky()||!t)return;const i=q(this.rowNode.oldRowTop),s=this.beans.visibleColsService.isPinningLeft(),n=this.beans.visibleColsService.isPinningRight();if(i){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=n}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=n}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const t=(a,d)=>a?a.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(a.element,d).params):!0,i=t(this.fullWidthGui,null),s=t(this.centerGui,null),n=t(this.leftGui,"left"),o=t(this.rightGui,"right");return i&&s&&n&&o}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventService,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(i=>{this.addRowDraggerToRow(i)});return}this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach(t=>t.onRowIndexChanged())},cellChanged:t=>{this.getAllCellCtrls().forEach(i=>i.onCellChanged(t))}})}onRowNodeDataChanged(t){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!t.update,newData:!t.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const t=this.rowNode.highlighted;this.allRowGuis.forEach(i=>{const s=t===0,n=t===1;i.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),i.rowComp.addOrRemoveCssClass("ag-row-highlight-below",n)})}postProcessRowDragging(){const t=this.rowNode.dragging;this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-dragging",t))}updateExpandedCss(){const t=this.rowNode.isExpandable(),i=this.rowNode.expanded==!0;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",t),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",t&&i),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",t&&!i),Dr(s.element,t&&i)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Gi(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}findFullWidthRowGui(t){return this.allRowGuis.find(i=>i.element.contains(t))}onKeyboardNavigate(t){const i=this.findFullWidthRowGui(t.target);if(!((i?i.element:null)===t.target))return;const o=this.rowNode,r=this.beans.focusService.getFocusedCell(),a={rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:(r==null?void 0:r.column)??this.getColumnForFullWidth(i)};this.beans.navigationService.navigateToNextCell(t,t.key,a,!0),t.preventDefault()}onTabKeyDown(t){if(t.defaultPrevented||Ds(t))return;const i=this.allRowGuis.find(d=>d.element.contains(t.target)),s=i?i.element:null,n=s===t.target,o=Je(this.gos);let r=!1;s&&o&&(r=s.contains(o)&&o.classList.contains("ag-cell"));let a=null;!n&&!r&&(a=this.beans.focusService.findNextFocusableElement(s,!1,t.shiftKey)),(this.isFullWidth()&&n||!a)&&this.beans.navigationService.onTabKeyDown(this,t)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var i;const t=(i=this.allRowGuis.find(s=>di(s.element)))==null?void 0:i.element;return t?t.getBoundingClientRect().top:0}onSuppressCellFocusChanged(t){const i=this.isFullWidth()&&t?void 0:-1;this.allRowGuis.forEach(s=>{Pi(s.element,"tabindex",i)})}onFullWidthRowFocused(t){var o;const i=this.rowNode,s=t?this.isFullWidth()&&t.rowIndex===i.rowIndex&&t.rowPinned==i.rowPinned:!1,n=this.fullWidthGui?this.fullWidthGui.element:(o=this.centerGui)==null?void 0:o.element;n&&(n.classList.toggle("ag-full-width-focus",s),s&&(t!=null&&t.forceBrowserFocus)&&n.focus({preventScroll:!0}))}recreateCell(t){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,t),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,t),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,t),t.destroy(),this.updateColumnLists()}removeCellCtrl(t,i){const s={list:[],map:{}};return t.list.forEach(n=>{n!==i&&(s.list.push(n),s.map[n.getColumn().getInstanceId()]=n)}),s}onMouseEvent(t,i){switch(t){case"dblclick":this.onRowDblClick(i);break;case"click":this.onRowClick(i);break;case"touchstart":case"mousedown":this.onRowMouseDown(i);break}}createRowEvent(t,i){return this.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:i})}createRowEventWithSource(t,i){const s=this.createRowEvent(t,i);return s.source=this,s}onRowDblClick(t){Ds(t)||this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowDoubleClicked",t))}getColumnForFullWidth(t){const{visibleColsService:i}=this.beans;switch(t==null?void 0:t.containerType){case"center":return i.getCenterCols()[0];case"left":return i.getLeftCols()[0];case"right":return i.getRightCols()[0];default:return i.getAllCols()[0]}}onRowMouseDown(t){if(this.lastMouseDownOnDragger=Po(t.target,"ag-row-drag",3),!this.isFullWidth())return;const i=this.rowNode;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const s=this.findFullWidthRowGui(t.target),n=s==null?void 0:s.element,o=t.target;let r=!0;n&&n.contains(o)&&nu(o)&&(r=!1),this.beans.focusService.setFocusedCell({rowIndex:i.rowIndex,column:this.getColumnForFullWidth(s),rowPinned:i.rowPinned,forceBrowserFocus:r})}onRowClick(t){if(Ds(t)||this.lastMouseDownOnDragger)return;const{gos:s}=this;this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowClicked",t));const n=t.ctrlKey||t.metaKey,o=t.shiftKey,r=this.rowNode.isSelected();if(Nn(s)&&this.rowNode.group||this.isRowSelectionBlocked()||!Uy(s)&&!r||!Td(s)&&r)return;const d=$y(s),h=Td(s),p="rowClicked";if(r)d?this.rowNode.setSelectedParams({newValue:!1,event:t,source:p}):n?h&&this.rowNode.setSelectedParams({newValue:!1,event:t,source:p}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!o,rangeSelect:o,event:t,source:p});else{const f=d?!1:!n;this.rowNode.setSelectedParams({newValue:!0,clearSelection:f,rangeSelect:o,event:t,source:p})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!ia(this.gos)}setupDetailRowAutoHeight(t){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const i=()=>{const n=t.clientHeight;if(n!=null&&n>0){const o=()=>{this.rowNode.setRowHeight(n),(st(this.gos)||xs(this.gos))&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(o,0)}},s=this.beans.resizeObserverService.observeResize(t,i);this.addDestroyFunc(s),i()}createFullWidthCompDetails(t,i){const{gos:s,rowNode:n}=this,o=s.addGridCommonParams({fullWidth:!0,data:n.data,node:n,value:n.key,valueFormatted:n.key,eGridCell:t,eParentOfValue:t,pinned:i,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(a,d,h,p)=>this.addFullWidthRowDragging(a,d,h,p),setTooltip:(a,d)=>this.refreshRowTooltip(a,d)}),r=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return r.getFullWidthDetailCellRendererDetails(o);case"FullWidthGroup":return r.getFullWidthGroupCellRendererDetails(o);case"FullWidthLoading":return r.getFullWidthLoadingCellRendererDetails(o);default:return r.getFullWidthCellRendererDetails(o)}}refreshRowTooltip(t,i){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new Ao(s,this.beans))}addFullWidthRowDragging(t,i,s="",n){if(!this.isFullWidth())return;const o=new uu(()=>s,this.rowNode,void 0,t,i,n);this.createBean(o,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(o,this.beans.context)})}onUiLevelChanged(){const t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){const i="ag-row-level-"+t,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(n=>{n.rowComp.addOrRemoveCssClass(i,!0),n.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=t}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const t=this.isFirstRowOnPage(),i=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",t))),this.lastRowOnPage!==i&&(this.lastRowOnPage=i,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",i)))}stopEditing(t=!1){var i;this.stoppingRowEdit||(i=this.beans.rowEditService)==null||i.stopEditing(this,t)}setInlineEditingCss(){const t=this.editingRow||this.getAllCellCtrls().some(i=>i.isEditing());this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-inline-editing",t),i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!t)})}setEditingRow(t){this.editingRow=t}startRowEditing(t=null,i=null,s=null){var n;return this.editingRow?!0:((n=this.beans.rowEditService)==null?void 0:n.startEditing(this,t,i,s))??!0}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const t=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!t||!t.length||t.forEach(i=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(i,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))},t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!1))})}setStylesFromGridOptions(t,i){t&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(i,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(t){return t==="left"||t==="right"?t:null}getInitialRowClasses(t){const i=this.getPinnedForContainer(t),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[t],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:i};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const t=this.gos.get("rowStyle");if(t&&typeof t=="function"){z("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const i=this.gos.getCallback("getRowStyle");let s;if(i){const n={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};s=i(n)}return s||t?Object.assign({},t,s):this.emptyStyle}onRowSelected(t){const i=!!this.rowNode.isSelected();this.forEachGui(t,s=>{s.rowComp.addOrRemoveCssClass("ag-row-selected",i),pa(s.element,i),s.element.contains(Je(this.gos))&&(s===this.centerGui||s===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const t=this.rowNode.isSelected();if(t&&!Td(this.gos))return;const s=this.beans.localeService.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s,"rowSelection")}addHoverFunctionality(t){if(!this.active)return;const{element:i,compBean:s}=t,{rowNode:n,beans:o,gos:r}=this;s.addManagedListeners(i,{mouseenter:()=>n.onMouseEnter(),mouseleave:()=>n.onMouseLeave()}),s.addManagedListeners(n,{mouseEnter:()=>{!o.dragService.isDragging()&&!r.get("suppressRowHoverHighlight")&&(i.classList.add("ag-row-hover"),n.setHovered(!0))},mouseLeave:()=>{i.classList.remove("ag-row-hover"),n.setHovered(!1)}})}roundRowTopToBounds(t){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,n=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,t),n)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(t,i){t?i(t):this.allRowGuis.forEach(i)}onRowHeightChanged(t){if(this.rowNode.rowHeight==null)return;const i=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),o=Rg(this.gos)?qs(this.gos,this.rowNode).height:void 0,r=o?`${Math.min(s,o)-2}px`:void 0;this.forEachGui(t,a=>{a.element.style.height=`${i}px`,r&&a.element.style.setProperty("--ag-line-height",r)})}addEventListener(t,i){super.addEventListener(t,i)}removeEventListener(t,i){super.removeEventListener(t,i)}destroyFirstPass(t=!1){if(this.active=!1,!t&&yo(this.gos)&&!this.isSticky())if(this.rowNode.rowTop!=null){const n=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(n)}else this.allRowGuis.forEach(n=>n.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const i=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(i),this.beans.eventService.dispatchEvent(i),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const t=i=>(i.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=t(this.centerCellCtrls),this.leftCellCtrls=t(this.leftCellCtrls),this.rightCellCtrls=t(this.rightCellCtrls)}setFocusedClasses(t){this.forEachGui(t,i=>{i.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),i.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const t=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses()),!t&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){var i;const t=((i=this.beans.paginationService)==null?void 0:i.getCurrentPage())??0;this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(t,i=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return t;const s=this.beans.pageBoundsService.getPixelOffset();return t+s*(i?1:-1)}setRowTop(t){if(!this.printLayout&&q(t)){const i=this.applyPaginationOffset(t),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?i:this.beans.rowContainerHeightService.getRealPixelPosition(i)}px`;this.setRowTopStyle(o)}}getInitialRowTop(t){return this.suppressRowTransform?this.getInitialRowTopShared(t):void 0}getInitialTransform(t){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(t)})`}getInitialRowTopShared(t){if(this.printLayout)return"";const i=this.rowNode;let s;if(this.isSticky())s=i.stickyRowTop;else{const n=this.slideInAnimation[t]?this.roundRowTopToBounds(i.oldRowTop):i.rowTop,o=this.applyPaginationOffset(n);s=i.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return s+"px"}setRowTopStyle(t){this.allRowGuis.forEach(i=>this.suppressRowTransform?i.rowComp.setTop(t):i.rowComp.setTransform(`translateY(${t})`))}getRowNode(){return this.rowNode}getCellCtrl(t){let i=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==t&&(i=s)}),i!=null||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(t)>=0&&(i=s)}),i}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(t){var r;const i=this.rowNode.getRowIndexString();if(i===null)return;const s=this.beans.headerNavigationService.getHeaderRowCount()+(((r=this.beans.filterManager)==null?void 0:r.getHeaderRowCount())??0),n=this.rowNode.rowIndex%2===0,o=s+this.rowNode.rowIndex+1;this.forEachGui(t,a=>{a.rowComp.setRowIndex(i),a.rowComp.addOrRemoveCssClass("ag-row-even",n),a.rowComp.addOrRemoveCssClass("ag-row-odd",!n),Yg(a.element,o)})}setStoppingRowEdit(t){this.stoppingRowEdit=t}};nm.DOM_DATA_KEY_ROW_CTRL="renderedRow";var $n=nm,ux=class extends G{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Og("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedElementListeners(this.element,{[i]:s})})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Ds(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Js())return;const e=new en(this.element),t=i=>{const s=this.getRowForEvent(i.touchEvent),n=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,s,n)};this.addManagedListeners(e,{longTap:t}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=yr(this.gos,t,$n.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const n=i?i.getRowNode():null,o=s?s.getColumn():null;let r=null;if(o){const h=e||t;s.dispatchCellContextMenuEvent(h??null),r=this.valueService.getValue(o,n)}const a=this.ctrlsService.getGridBodyCtrl(),d=s?s.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:n,column:o,value:r,anchorToElement:d})}getControlsForEventTarget(e){return{cellCtrl:ca(this.gos,e,sn.DOM_DATA_KEY_CELL_CTRL),rowCtrl:ca(this.gos,e,$n.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),n=e.getColumn(),o=e.isEditing();!gu(this.gos,i,s,n,o)&&t==="keydown"&&(!o&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Mf(i)&&e.processCharacter(i)),t==="keydown"&&this.eventService.dispatchEvent(e.createEvent(i,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),n=this.focusService.getFocusedCell(),o=n&&n.column;if(!gu(this.gos,i,s,o,!1)){const a=i.key;if(t==="keydown")switch(a){case B.PAGE_HOME:case B.PAGE_END:case B.PAGE_UP:case B.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case B.UP:case B.DOWN:e.onKeyboardNavigate(i);break;case B.TAB:e.onTabKeyDown(i);break}}t==="keydown"&&this.eventService.dispatchEvent(e.createRowEvent("cellKeyDown",i))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=uF(e);if(i===B.A)return this.onCtrlAndA(e);if(i===B.C)return this.onCtrlAndC(e);if(i===B.D)return this.onCtrlAndD(e);if(i===B.V)return this.onCtrlAndV(e);if(i===B.X)return this.onCtrlAndX(e);if(i===B.Y)return this.onCtrlAndY();if(i===B.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[n,o]=[t.isEmpty("top"),t.isEmpty("bottom")],r=n?null:"top";let a,d;o?(a=null,d=i.getRowCount()-1):(a="bottom",d=t.getPinnedBottomRowCount()-1);const h=this.visibleColsService.getAllCols();if(Tt(h))return;s.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:d,rowEndPinned:a,columnStart:h[0],columnEnd:he(h)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){!this.gos.get("undoRedoCellEditing")||!this.undoRedoService||(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){var e;(e=this.undoRedoService)==null||e.redo("ui")}},hx=class extends G{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;et(this.element,t),zi(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},px=class extends G{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;et(this.element,t),zi(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},Aa=e=>e.getTopRowCtrls(),Ma=e=>e.getStickyTopRowCtrls(),ka=e=>e.getStickyBottomRowCtrls(),Ia=e=>e.getBottomRowCtrls(),La=e=>e.getCentreRowCtrls(),gx={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:La},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:La},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:La},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:La},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:Aa},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Aa},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Aa},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:Aa},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:Ma},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Ma},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Ma},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:Ma},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:ka},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:ka},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:ka},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:ka},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:Ia},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Ia},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Ia},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:Ia}};function Io(e){return gx[e]}var fx=["topCenter","topLeft","topRight"],mx=["bottomCenter","bottomLeft","bottomRight"],Cx=["center","left","right"],vx=["center","left","right","fullWidth"],wx=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],Sx=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],yx=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],om=["stickyTopCenter","stickyTopLeft","stickyTopRight"],rm=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],bx=[...om,"stickyTopFullWidth",...rm,"stickyBottomFullWidth"],Rx=[...fx,...mx,...Cx,...om,...rm],Fx=class extends G{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=Io(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new VE(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new ux(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const s=()=>this.onPinnedWidthChanged();this.forContainers(Sx,()=>{this.pinnedWidthFeature=this.createManagedBean(new hx(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:s})}),this.forContainers(yx,()=>{this.pinnedWidthFeature=this.createManagedBean(new px(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:s})}),this.forContainers(vx,()=>this.createManagedBean(new im(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(Rx,()=>this.createManagedBean(new NE(this.eContainer))),this.forContainers(wx,()=>this.createManagedBean(new Fu(n=>this.comp.setContainerWidth(`${n}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(bx.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const i=this.gos.get("ensureDomOrder"),s=Ft(this.gos,"print");this.comp.setDomOrder(i||s)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return Do(this.eViewport)}getCenterViewportScrollLeft(){return wa(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return rf(this.eViewport)}getViewportScrollLeft(){return wa(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||qb(this.eViewport)}getViewportElement(){return this.eViewport}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Sa(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const i=Ft(this.gos,"print"),n=this.gos.get("embedFullWidthRows")||i,o=t.filter(r=>{const a=r.isFullWidth();return this.options.fullWidth?!n&&a:n||!a});this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}},lm="ag-force-vertical-scroll",Ex="ag-selectable",xx="ag-column-moving",Px=class extends G{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,n,o,r){var a;this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=n,this.eStickyTop=o,this.eStickyBottom=r,this.eCenterColsViewport=i.querySelector(`.${Io("center").viewport}`),this.eFullWidthContainer=i.querySelector(`.${Io("fullWidth").container}`),this.eStickyTopFullWidthContainer=o.querySelector(`.${Io("stickyTopFullWidth").container}`),this.eStickyBottomFullWidthContainer=r.querySelector(`.${Io("stickyBottomFullWidth").container}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",d=>this.setCellTextSelection(d.currentValue)),this.createManagedBean(new Tu(this.comp)),this.bodyScrollFeature=this.createManagedBean(new OE(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,n,o,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),(a=this.filterManager)==null||a.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){const e=this.setFloatingHeights.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.onScrollGapChanged.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach(t=>{this.addManagedElementListeners(t,{focusin:i=>{const{target:s}=i,n=Po(s,"ag-root",t);t.classList.toggle("ag-has-focus",!n)},focusout:i=>{const{target:s,relatedTarget:n}=i,o=t.contains(n),r=Po(n,"ag-root",t);Po(s,"ag-root",t)||(!o||r)&&t.classList.remove("ag-has-focus")}})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(xx,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(Ex,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=e&&this.scrollVisibleService.getScrollbarWidth()||0,i=tf()?16:0,s=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s)),this.updateScrollingClasses()}onScrollGapChanged(){this.updateScrollingClasses()}updateScrollingClasses(){this.eGridBody.classList.toggle("ag-body-vertical-content-no-gap",!this.scrollVisibleService.hasVerticalScrollGap()),this.eGridBody.classList.toggle("ag-body-horizontal-content-no-gap",!this.scrollVisibleService.hasHorizontalScrollGap())}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(su(s)===null){this.rowRenderer.stopEditing();return}let n=t.some(o=>o.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!n){const o=this.popupService;n=o.getActivePopups().some(r=>r.contains(s))||o.isElementWithinCustomPopup(s)}n||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(i=>this.addManagedElementListeners(i,{focusout:e}))}updateRowCount(){var s;const e=this.headerNavigationService.getHeaderRowCount()+(((s=this.filterManager)==null?void 0:s.getHeaderRowCount())??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=t===-1?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?lm:null,i=Ft(this.gos,"normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&Yb(this.eBodyViewport)}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const i=e&&yo(this.gos)&&!this.rowContainerHeightService.isStretching(),s=i?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,i)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:i,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(i))&&this.mouseEventService.isEventFromThisGrid(e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaX:t,deltaY:i,shiftKey:s}=e,n=s||Math.abs(t)>Math.abs(i),o=e.target;n?(this.eStickyTopFullWidthContainer.contains(o)||this.eStickyBottomFullWidthContainer.contains(o))&&this.scrollGridBodyToMatchEvent(e):(e.preventDefault(),this.scrollVertically(i))}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:i}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||i})}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;(s===this.eBodyViewport||s===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Js())return;const t=new en(this.eBodyViewport),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new $R(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(this.rowDragFeature))}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){var n;const t=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(((n=this.filterManager)==null?void 0:n.getHeaderHeight())??0),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t),i>0&&(s+=i),s>0&&(s+=1),this.comp.setStickyTopTop(`${s}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight(),i=this.scrollVisibleService.isHorizontalScrollShowing()&&this.scrollVisibleService.getScrollbarWidth()||0,s=e+i;this.comp.setStickyBottomBottom(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.scrollVisibleService.getScrollbarWidth():0,o=Do(this.eGridBody)-s;if(o>0){this.columnSizeService.sizeColumnsToFit(o,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):z("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},Dx=class extends ke{constructor(e,t,i,s,n){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const o=document.createElement("div");o.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(o);const r=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1),ti(r,t.getCellAriaRole()),r.setAttribute("col-id",t.colIdSanitised);const a={addOrRemoveCssClass:(d,h)=>this.addOrRemoveCssClass(d,h),setUserStyles:d=>cf(r,d),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:d=>this.includeSelection=d,setIncludeRowDrag:d=>this.includeRowDrag=d,setIncludeDndSource:d=>this.includeDndSource=d,setRenderDetails:(d,h,p)=>this.setRenderDetails(d,h,p),setEditDetails:(d,h,p)=>this.setEditDetails(d,h,p),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(a,this.getGui(),this.eCellWrapper,i,n,void 0)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const n=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||n)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&this.eCellWrapper==null;if(s){const h=document.createElement("div");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=h,this.getGui().appendChild(this.eCellWrapper)}const n=!i&&this.eCellWrapper!=null;n&&(fs(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const o=!e&&i,r=o&&this.eCellValue==null;if(r){const h=document.createElement("span");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-value"),this.eCellValue=h,this.eCellWrapper.appendChild(this.eCellValue)}const a=!o&&this.eCellValue!=null;a&&(fs(this.eCellValue),this.eCellValue=void 0);const d=s||n||r||a;return d&&this.removeControls(),e||t&&this.addControls(),d}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,n=e.newAgStackInstance();if(n==null)return;const{params:o}=e;n.then(a=>this.afterCellEditorCreated(s,a,o,t,i)),Ve(this.cellEditor)&&o.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();Lt(t);const i=e!=null?ps(e,!0):null;i!=null&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),fs(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),fs(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const i=!this.beans.gos.get("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:n}=e,o=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const a=e.newAgStackInstance(),d=this.afterCellRendererCreated.bind(this,s,n);a&&a.then(d)};i&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const n=this.getParentOfValue();Lt(n),n.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,n){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){z(`cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const a=s||t.isPopup!==void 0&&t.isPopup();a?this.addPopupCellEditor(i,n):this.addInCellEditor(),this.refreshEditStyles(!0,a),t.afterGuiAttached&&t.afterGuiAttached(),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),(i=this.rowCtrl)==null||i.setInlineEditingCss()}addInCellEditor(){const e=this.getGui();e.contains(Je(this.beans.gos))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){var m;this.beans.gos.get("editType")==="fullRow"&&z("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const n=this.beans.popupService,o=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),r=t??((m=i.getPopupPosition)==null?void 0:m.call(i))??"over",a=this.beans.gos.get("enableRtl"),d={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:r,alignSide:a?"right":"left",keepWithinBounds:!0},h=n.positionPopupByComponent.bind(n,d),p=this.beans.localeService.getLocaleTextFunc(),f=n.addPopup({modal:o,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:p("ariaLabelCellEditor","Cell Editor")});f&&(this.hideEditorPopup=f.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(Je(this.beans.gos))&&iu()&&e.focus({preventScroll:!0}),Lt(this.getParentOfValue())}},Tx=class extends ke{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const n=this.getGui(),o=n.style;this.domOrder=this.rowCtrl.getDomOrder(),ti(n,"row");const r={setDomOrder:a=>this.domOrder=a,setCellCtrls:a=>this.setCellCtrls(a),showFullWidth:a=>this.showFullWidth(a),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,addOrRemoveCssClass:(a,d)=>this.addOrRemoveCssClass(a,d),setUserStyles:a=>cf(n,a),setTop:a=>o.top=a,setTransform:a=>o.transform=a,setRowIndex:a=>n.setAttribute("row-index",a),setRowId:a=>n.setAttribute("row-id",a),setRowBusinessKey:a=>n.setAttribute("row-business-key",a),refreshFullWidth:a=>{var d,h;return((h=(d=this.fullWidthCellRenderer)==null?void 0:d.refresh)==null?void 0:h.call(d,a()))??!1}};e.setComp(r,this.getGui(),i,void 0),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=s=>{if(this.isAlive()){const n=s.getGui();this.getGui().appendChild(n),this.rowCtrl.setupDetailRowAutoHeight(n),this.setFullWidthRowComp(s)}else this.beans.context.destroyBean(s)},i=e.newAgStackInstance();i!=null&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const n=s.instanceId;this.cellComps[n]==null?this.newCellComp(s):t[n]=null});const i=Qs(t).filter(s=>s!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const s=this.cellComps[i.instanceId];s&&t.push(s.getGui())}),af(this.getGui(),t)}newCellComp(e){const t=new Dx(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.instanceId]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=Qs(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&We("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().instanceId;this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}};function Ax(e){let t;return e.type==="center"?t=`<div class="${e.viewport}" data-ref="eViewport" role="presentation">
121
- <div class="${e.container}" data-ref="eContainer"></div>
122
- </div>`:t=`<div class="${e.container}" data-ref="eContainer"></div>`,t}var Mx=class extends ke{constructor(){super(),this.eViewport=ee,this.eContainer=ee,this.rowComps={},this.name=ke.elementGettingCreated.getAttribute("name"),this.options=Io(this.name),this.setTemplate(Ax(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setHorizontalScroll:i=>this.eViewport.scrollLeft=i,setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i,setOffsetTop:i=>this.eContainer.style.transform=`translateY(${i})`};this.createManagedBean(new Fx(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;const i=s=>{const n=s.instanceId,o=t[n];if(o)this.rowComps[n]=o,delete t[n],this.ensureDomOrder(o.getGui());else{if(!s.getRowNode().displayed)return;const r=new Tx(s,this.beans,this.options.type);this.rowComps[n]=r,this.appendRow(r.getGui())}};e.forEach(i),Qs(t).forEach(s=>{this.eContainer.removeChild(s.getGui()),s.destroy()}),ti(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?Zb(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(lf(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},kx={selector:"AG-ROW-CONTAINER",component:Mx};function Nr(e){return e.map(t=>`<ag-row-container name="${t}"></ag-row-container>`).join("")}var Ix=`<div class="ag-root ag-unselectable" role="treegrid">
123
- <ag-header-root></ag-header-root>
124
- <div class="ag-floating-top" data-ref="eTop" role="presentation">
125
- ${Nr(["topLeft","topCenter","topRight","topFullWidth"])}
126
- </div>
127
- <div class="ag-body" data-ref="eBody" role="presentation">
128
- <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation">
129
- ${Nr(["left","center","right","fullWidth"])}
130
- </div>
131
- <ag-fake-vertical-scroll></ag-fake-vertical-scroll>
132
- </div>
133
- <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation">
134
- ${Nr(["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])}
135
- </div>
136
- <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation">
137
- ${Nr(["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])}
138
- </div>
139
- <div class="ag-floating-bottom" data-ref="eBottom" role="presentation">
140
- ${Nr(["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])}
141
- </div>
142
- <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
143
- <ag-overlay-wrapper></ag-overlay-wrapper>
144
- </div>`,Lx=class extends ke{constructor(){super(Ix,[ME,IE,_E,TE,kx]),this.eBodyViewport=ee,this.eStickyTop=ee,this.eStickyBottom=ee,this.eTop=ee,this.eBottom=ee,this.eBody=ee}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(i,s)=>{const n=`${i}px`;s.style.minHeight=n,s.style.height=n},t={setRowAnimationCssOnBodyViewport:(i,s)=>this.setRowAnimationCssOnBodyViewport(i,s),setColumnCount:i=>Vb(this.getGui(),i),setRowCount:i=>Ob(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setStickyBottomHeight:i=>{this.eStickyBottom.style.height=i,this.eStickyBottom.classList.toggle("ag-hidden",i==="0px")},setStickyBottomBottom:i=>this.eStickyBottom.style.bottom=i,setStickyBottomWidth:i=>this.eStickyBottom.style.width=i,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(o=>{o.toggle("ag-layout-auto-height",s.autoHeight),o.toggle("ag-layout-normal",s.normal),o.toggle("ag-layout-print",s.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(lm,s),registerBodyViewportResizeListener:i=>{const s=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,s)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(n=>n.classList.toggle(i,s))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new Px),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&ei(this.gos)||Md(this.gos))&&_b(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},_x={selector:"AG-GRID-BODY",component:Lx},Ox=class extends G{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.getScrollbarWidth(),this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.updateScrollVisible()}onDisplayedColumnsWidthChanged(){this.updateScrollVisible()}onCentreViewportResized(){this.updateScrollGap()}updateScrollVisible(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())}):this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t),this.updateScrollGap()}updateScrollGap(){const e=this.ctrlsService.get("center"),t=e.hasHorizontalScrollGap(),i=e.hasVerticalScrollGap();(this.horizontalScrollGap!==t||this.verticalScrollGap!==i)&&(this.horizontalScrollGap=t,this.verticalScrollGap=i,this.eventService.dispatchEvent({type:"scrollGapChanged"}))}setScrollsVisible(e){(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing)&&(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventService.dispatchEvent({type:"scrollVisibilityChanged"}))}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}hasHorizontalScrollGap(){return this.horizontalScrollGap}hasVerticalScrollGap(){return this.verticalScrollGap}getScrollbarWidth(){if(this.scrollbarWidth==null){const e=this.gos.get("scrollbarWidth"),i=typeof e=="number"&&e>=0?e:$b();i!=null&&(this.scrollbarWidth=i,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},am="__ag_grid_instance",cm=class wy extends G{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=wy.gridInstanceSequence.next()}wireBeans(t){this.ctrlsService=t.ctrlsService}stampTopLevelGridCompWithGridInstance(t){t[am]=this.gridInstanceId}getRenderedCellForEvent(t){return ca(this.gos,t.target,sn.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let i=t;for(;i;){const s=i[am];if(q(s))return s===this.gridInstanceId;i=i.parentElement}return!1}getCellPositionForEvent(t){const i=this.getRenderedCellForEvent(t);return i?i.getCellPosition():null}getNormalisedPosition(t){const i=Ft(this.gos,"normal"),s=t;let n,o;if(s.clientX!=null||s.clientY!=null?(n=s.clientX,o=s.clientY):(n=s.x,o=s.y),i){const r=this.ctrlsService.getGridBodyCtrl(),a=r.getScrollFeature().getVScrollPosition(),d=r.getScrollFeature().getHScrollPosition();n+=d.left,o+=a.top}return{x:n,y:o}}};cm.gridInstanceSequence=new To;var Vx=cm,Nx=class extends G{constructor(){super(),this.beanName="navigationService",this.onPageDown=yg(this.onPageDown,100),this.onPageUp=yg(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.scrollVisibleService=e.scrollVisibleService,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,n=e.ctrlKey||e.metaKey,o=!!this.rangeService&&e.shiftKey,r=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case B.PAGE_HOME:case B.PAGE_END:!n&&!s&&(this.onHomeOrEndKey(i),a=!0);break;case B.LEFT:case B.RIGHT:case B.UP:case B.DOWN:if(!r)return!1;n&&!s&&!o&&(this.onCtrlUpDownLeftRight(i,r),a=!0);break;case B.PAGE_DOWN:case B.PAGE_UP:!n&&!s&&(a=this.handlePageUpDown(i,r,t));break}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===B.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){var r;const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:n,focusColumn:o}=e;q(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),q(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(n),this.focusService.setFocusedCell({rowIndex:n,column:o,rowPinned:null,forceBrowserFocus:!0}),(r=this.rangeService)==null||r.setRangeToCell({rowIndex:n,rowPinned:null,column:o})}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),n=this.pageBoundsService.getPixelOffset(),o=i.top+s,r=this.rowModel.getRowIndexAtPixel(o+n);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.pageBoundsService.getPixelOffset(),n=i.top,o=this.rowModel.getRowIndexAtPixel(n+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),n=this.pageBoundsService.getFirstRow(),o=this.pageBoundsService.getLastRow(),r=this.pageBoundsService.getPixelOffset(),a=this.rowModel.getRow(e.rowIndex),d=i?(a==null?void 0:a.rowHeight)-s-r:s-r,h=(a==null?void 0:a.rowTop)+d;let p=this.rowModel.getRowIndexAtPixel(h+r);if(p===e.rowIndex){const m=i?-1:1;t=p=e.rowIndex+m}let f;i?(f="bottom",p<n&&(p=n),t<n&&(t=n)):(f="top",p>o&&(p=o),t>o&&(t=o)),this.isRowTallerThanView(p)&&(t=p,f="top"),this.navigateTo({scrollIndex:t,scrollType:f,scrollColumn:null,focusIndex:p,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),n=this.pageBoundsService.getLastRow();let o=0,r=e.rowIndex;for(;r>=0&&r<=n;){const a=this.rowModel.getRow(r);if(a){const d=a.rowHeight??0;if(o+d>s)break;o+=d}r+=i}return Math.max(0,Math.min(r,n))}getViewportHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),t=this.scrollVisibleService.getScrollbarWidth();let i=e.bottom-e.top;return this.ctrlsService.get("center").isHorizontalScrollShowing()&&(i-=t),i}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return typeof i!="number"?!1:i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,n=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:n,focusIndex:s,focusColumn:n})}onHomeOrEndKey(e){const t=e===B.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:he(i),n=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:s,focusIndex:n,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(s!==!1){s?t.preventDefault():s===null&&this.focusService.allowFocusForNextGridCoreContainer(i);return}if(i){const{rowIndex:n,rowPinned:o}=e.getRowPosition();(o?n===0:n===this.pageBoundsService.getFirstRow())&&(this.gos.get("headerHeight")===0||this.focusService.isHeaderFocusSuppressed()?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof sn&&e.focusCell(!0),(!i&&this.focusService.focusOverlay(!1)||this.focusService.focusNextGridCoreContainer(i))&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!s&&(s=this.rowRenderer.getRowByPosition(i),!s||!s.isFullWidth())?!1:!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s=e.isEditing();if(!s&&e instanceof sn){const r=e.getRowCtrl();r&&(s=r.isEditing())}let n;return s?this.gos.get("editType")==="fullRow"?n=this.moveToNextEditingRow(e,t,i):n=this.moveToNextEditingCell(e,t,i):n=this.moveToNextCellNotEditing(e,t),n===null?n:n||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const n=this.findNextCellToFocusOn(s,t,!0);return n===!1?null:n==null?!1:(n.startEditing(null,!0,i),n.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),n=this.findNextCellToFocusOn(s,t,!0);if(n===!1)return null;if(n==null)return!1;const o=n.getCellPosition(),r=this.isCellEditable(s),a=this.isCellEditable(o),d=o&&s.rowIndex===o.rowIndex&&s.rowPinned===o.rowPinned;return r&&e.setFocusOutOnEditor(),d||(e.getRowCtrl().stopEditing(),n.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(n.setFocusInOnEditor(),n.focusCell()):n.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;e instanceof $n?s={...e.getRowPosition(),column:t?i[0]:he(i)}:s=e.getCellPosition();const n=this.findNextCellToFocusOn(s,t,!1);if(n===!1)return null;if(n instanceof sn)n.focusCell(!0);else if(n)return this.tryToFocusFullWidthRow(n.getRowPosition(),t);return q(n)}findNextCellToFocusOn(e,t,i){var n;let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gos.getCallback("tabToNextCell");if(q(o)){const h=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(h===!0||h===null)h===null&&z("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(h===!1)return!1;s={rowIndex:h.rowIndex,column:h.column,rowPinned:h.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const d=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:d+s.rowIndex,column:s.column},fromCell:!0}),null}const r=this.gos.get("editType")==="fullRow";if(i&&!r&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const a=this.getCellByPosition(s);if(!a){const d=this.rowRenderer.getRowByPosition(s);if(!d||!d.isFullWidth()||i)continue;return d}if(!a.isSuppressNavigable())return(n=this.rangeService)==null||n.setRangeToCell(s),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return e.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):e.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let n=i,o=!1;for(;n&&(n===i||!this.isValidNavigateCell(n));)this.gos.get("enableRtl")?t===B.LEFT&&(n=this.getLastCellOfColSpan(n)):t===B.RIGHT&&(n=this.getLastCellOfColSpan(n)),n=this.cellNavigationService.getNextCellToFocus(t,n),o=Ve(n);if(o&&e&&e.key===B.UP&&(n={rowIndex:-1,rowPinned:null,column:i.column}),s){const a=this.gos.getCallback("navigateToNextCell");if(q(a)){const h=a({key:t,previousCellPosition:i,nextCellPosition:n||null,event:e});q(h)?n={rowPinned:h.rowPinned,rowIndex:h.rowIndex,column:h.column}:n=null}}if(!n)return;if(n.rowIndex<0){const a=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+n.rowIndex,column:i.column},event:e||void 0,fromCell:!0});return}const r=this.getNormalisedPosition(n);r?this.focusPosition(r):this.tryToFocusFullWidthRow(n)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const n=this.focusService.getFocusedCell(),o={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?he(i):i[0])};this.focusPosition(o);const r=t??(n!=null&&this.rowPositionUtils.before(o,n));return this.eventService.dispatchEvent({type:"fullWidthRowFocused",rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:o.column,isFullWidthCell:!0,fromBelow:r}),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),(t=this.rangeService)==null||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return i.length===1?e:{rowIndex:e.rowIndex,column:he(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=na(this.gos),i=this.rowModel.getRow(e.rowIndex);!(t&&(i==null?void 0:i.sticky))&&Ve(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},Bx=class extends G{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},Gx=class extends G{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,n="left";const o=this.menuService.isLegacyMenuEnabled();!o&&this.gos.get("enableRtl")&&(s=1,n="right");const r=o?void 0:4*s,a=o?void 0:4;this.showPopup(e,d=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:d,nudgeX:r,nudgeY:a,alignSide:n,keepWithinBounds:!0,position:"under",column:e})},i,t,o)}showPopup(e,t,i,s,n){const o=e?this.createBean(new QR(e,"COLUMN_MENU")):void 0;if(this.activeMenu=o,!(o!=null&&o.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const r=document.createElement("div");ti(r,"presentation"),r.classList.add("ag-menu"),n||r.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(r,{keydown:w=>this.trapFocusWithin(w,r)}),r.appendChild(o==null?void 0:o.getGui());let a;const d=()=>o==null?void 0:o.afterGuiDetached(),h=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,p=w=>{e.setMenuVisible(!1,"contextMenu");const S=w instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),S&&s&&di(s)){const b=this.focusService.findTabbableParent(s);b&&b.focus()}d(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},f=this.localeService.getLocaleTextFunc(),m=n&&i!=="columnFilter"?f("ariaLabelColumnMenu","Column Menu"):f("ariaLabelColumnFilter","Column Filter"),v=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:p,positionCallback:()=>t(r),anchorToElement:h,ariaLabel:m});v&&(this.hidePopup=a=v.hideFunc),o.afterInit().then(()=>{t(r),o.afterGuiAttached({container:i,hidePopup:a})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==B.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){this.eventService.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Hx=class extends G{constructor(){super(...arguments),this.beanName="resizeObserverService"}observeResize(e,t){const s=Fg(this.gos).ResizeObserver,n=s?new s(t):null;return n==null||n.observe(e),()=>n==null?void 0:n.disconnect()}},Wx=class extends G{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){var i;const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const s=((i=this.paginationService)==null?void 0:i.getCurrentPage())??0;s!==this.lastPage&&(this.lastPage=s,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&z(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((i,s)=>i.index!==s.index?t*(s.index-i.index):s.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,n=s.list,o=this.destroyTasks,r=new Date().getTime();let a=new Date().getTime()-r;const d=e<=0,h=this.ctrlsService.getGridBodyCtrl();for(;d||a<e;){if(!h.getScrollFeature().scrollGridIfNeeded()){let f;if(i.length)this.sortTaskList(t),f=i.pop().task;else if(n.length)this.sortTaskList(s),f=n.pop().task;else if(o.length)f=o.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(f)||f()}a=new Date().getTime()-r}i.length||n.length||o.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=Fg(this.gos);t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){window.setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}},Be=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(Be||{}),zx=class extends G{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel=st(this.gos)}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},Ux=class extends G{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.valueService=e.valueService,this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const n=s.getBoundingClientRect();return{x:n.x+n.width/2,y:n.y+n.height/2}}showContextMenu(e){var o;const{rowNode:t}=e,i=e.column;let{anchorToElement:s,value:n}=e;t&&i&&n==null&&(n=this.valueService.getValueForDisplay(i,t)),s==null&&(s=this.getContextMenuAnchorElement(t,i)),(o=this.contextMenuFactory)==null||o.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,n,s)}showColumnChooser(e){var t;(t=this.columnChooserFactory)==null||t.showColumnChooser(e)}hidePopupMenu(){var e;(e=this.contextMenuFactory)==null||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;(e=this.columnChooserFactory)==null||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){var t;return!e.getColDef().suppressHeaderFilterButton&&!!((t=this.filterManager)!=null&&t.isFilterAllowed(e))}isHeaderContextMenuEnabled(e){const t=e&&Xs(e)?e.getColDef():e==null?void 0:e.getColGroupDef();return!(t!=null&&t.suppressHeaderContextMenu)&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Js()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){var t;return!!((t=this.filterManager)!=null&&t.isFilterAllowed(e))&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(e){var s;const t=e.getColDef(),i=(s=t.floatingFilterComponentParams)==null?void 0:s.suppressFilterButton;return i!=null&&z("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),t.suppressFloatingFilterButton==null?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?this.gos.exists("suppressMenuHide")?e:!1:e}showColumnMenuCommon(e,t,i,s){const{positionBy:n}=t,o=t.column;if(n==="button"){const{buttonElement:r}=t;e.showMenuAfterButtonClick(o,r,i,s)}else if(n==="mouse"){const{mouseEvent:r}=t;e.showMenuAfterMouseEvent(o,r,i,s)}else o&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(o,"auto"),this.animationFrameService.requestAnimationFrame(()=>{var a;const r=(a=this.ctrlsService.getHeaderRowContainerCtrl(o.getPinned()))==null?void 0:a.getHeaderCtrlForColumn(o);r&&e.showMenuAfterButtonClick(o,r.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(t!=null)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(i==null?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const n=this.getCellGui(s,t);return n||(s.isFullWidth()?s.getFullWidthElement():i)}},$x=class extends Wn{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Kx={selector:"AG-INPUT-TEXT-AREA",component:$x},jx=class extends Mo{constructor(){super(`<div class="ag-large-text">
145
- <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
146
- </div>`,[Kx]),this.eTextArea=ee}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),q(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===B.LEFT||t===B.UP||t===B.RIGHT||t===B.DOWN||e.shiftKey&&t===B.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!q(e)&&!q(this.params.value)?this.params.value:this.params.parseValue(e)}},Zx=class extends Mo{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){Vn(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,i=s=>{gu(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:i})}},qx=class extends Mo{constructor(){super(`<div class="ag-cell-edit-wrapper">
147
- <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>
148
- </div>`,[sF]),this.eSelect=ee,this.startedByEnter=!1}wireBeans(e){this.valueService=e.valueService}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:n,value:o,eventKey:r}=e;if(Ve(n)){z("no values found for select cellEditor");return}this.startedByEnter=r!=null?r===B.ENTER:!1;let a=!1;n.forEach(f=>{const m={value:f},v=i.formatValue(e.column,null,f),w=v!=null;m.text=w?v:f,t.addOption(m),a=a||o===f}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:d,valueListMaxWidth:h,valueListMaxHeight:p}=e;d!=null&&t.setPickerGap(d),p!=null&&t.setPickerMaxHeight(p),h!=null&&t.setPickerMaxWidth(h),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eSelect,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}},_a=class extends Mo{constructor(e){super(`
149
- <div class="ag-cell-edit-wrapper">
150
- ${e.getTemplate()}
151
- </div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=ee}init(e){this.params=e;const{cellStartedEdit:t,eventKey:i,suppressPreventDefault:s}=e,n=this.eInput;this.cellEditorInput.init(n,e);let o,r=!0;t?(this.focusAfterAttached=!0,i===B.BACKSPACE||i===B.DELETE?o="":i&&i.length===1?s?r=!1:o=i:(o=this.cellEditorInput.getStartValue(),i!==B.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,o=this.cellEditorInput.getStartValue()),r&&o!=null&&n.setStartValue(o),this.addManagedElementListeners(n.getGui(),{keydown:a=>{const{key:d}=a;(d===B.PAGE_UP||d===B.PAGE_DOWN)&&a.preventDefault()}})}afterGuiAttached(){var s,n;const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;gs()||t.getFocusableElement().focus();const i=t.getInputElement();this.highlightAllOnFocus?i.select():(n=(s=this.cellEditorInput).setCaret)==null||n.call(s)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},Yx=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'}getAgComponents(){return[xa]}init(e,t){this.eInput=e,this.params=t,t.maxLength!=null&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return!q(e)&&!q(this.params.value)?this.params.value:this.params.parseValue(e)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=q(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},dm=class extends _a{constructor(){super(new Yx)}},Qx=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'}getAgComponents(){return[pF]}init(e,t){this.eInput=e,this.params=t,t.max!=null&&e.setMax(t.max),t.min!=null&&e.setMin(t.min),t.precision!=null&&e.setPrecision(t.precision),t.step!=null&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){(e.key===B.UP||e.key===B.DOWN)&&e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!q(e)&&!q(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(t==null)return t;if(typeof t=="string"){if(t==="")return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}setCaret(){gs()&&this.eInput.getInputElement().focus({preventScroll:!0})}},Xx=class extends _a{constructor(){super(new Qx)}},Jx=class extends Un{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=gs();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Je(this.gos)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?Di(e??null,!1)??void 0:e;return this.min===t?this:(this.min=t,Pi(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?Di(e??null,!1)??void 0:e;return this.max===t?this:(this.max=t,Pi(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Pi(this.eInput,"step",e),this)}getDate(){if(this.eInput.validity.valid)return ii(this.getValue())??void 0}setDate(e,t){this.setValue(Di(e??null,!1),t)}},um={selector:"AG-INPUT-DATE-FIELD",component:Jx},e0=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[um]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return!q(e)&&!q(this.params.value)?this.params.value:e??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Di(e,!1)}},t0=class extends _a{constructor(){super(new e0)}},i0=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[um]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return!q(e)&&!q(this.params.value)?this.params.value:this.params.parseValue(e??"")}getStartValue(){return Di(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):ii(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Di(e??null,!1)??void 0}},s0=class extends _a{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new i0(()=>this.dataTypeService))}},n0=class extends Mo{constructor(){super(`
152
- <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
153
- <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
154
- </div>`,[cu]),this.eCheckbox=ee}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=$d(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},Br=class{constructor(e){this.cellValueChanges=e}},ku=class extends Br{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},o0=10,hm=class{constructor(e){this.actionStack=[],this.maxStackSize=e||o0,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},r0=class extends G{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:r,column:a,oldValue:d,value:h}=e,p={rowPinned:o,rowIndex:r,columnId:a.getColId(),newValue:h,oldValue:d};this.cellValueChanges.push(p)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new hm(e),this.redoStack=new hm(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady(this,i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){this.eventService.dispatchEvent({type:"undoStarted",source:e});const t=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo");this.eventService.dispatchEvent({type:"undoEnded",source:e,operationPerformed:t})}redo(e){this.eventService.dispatchEvent({type:"redoStarted",source:e});const t=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo");this.eventService.dispatchEvent({type:"redoEnded",source:e,operationPerformed:t})}undoRedo(e,t,i,s,n){if(!e)return!1;const o=e.pop();return!o||!o.cellValueChanges?!1:(this.processAction(o,r=>r[s],n),o instanceof ku?this.processRange(this.rangeService,o.ranges||[o[i]]):this.processCell(o.cellValueChanges),t.push(o),!0)}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:n,rowPinned:o,columnId:r}=s,a={rowIndex:n,rowPinned:o},d=this.rowPositionUtils.getRowNode(a);d.displayed&&d.setDataValue(r,t(s),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,n)=>{if(!s)return;const o=s.startRow,r=s.endRow;n===t.length-1&&(i={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,n={rowIndex:i,rowPinned:s},o=this.rowPositionUtils.getRowNode(n),r={rowPinned:t.rowPinned,rowIndex:o.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:n}=e,o=this.gridBodyCtrl.getScrollFeature(),r=this.columnModel.getCol(s);if(!r)return;o.ensureIndexVisible(i),o.ensureColumnVisible(r);const a={rowIndex:i,column:r,rowPinned:n};this.focusService.setFocusedCell({...a,forceBrowserFocus:!0}),t==null||t.setRangeToCell(a)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Br(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new Br(this.cellValueChanges);this.pushActionsToUndoStack(i)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Br(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new ku(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;this.rangeService&&ei(this.gos)?e=new ku(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new Br(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};function l0(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()}function a0(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()}function pm(e,t,i="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i),"ensureVisible")}function gm(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i),"ensureVisible")}function c0(e,t,i=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i),"ensureVisible")}function d0(e){var t;(t=e.undoRedoService)==null||t.undo("api")}function u0(e){var t;(t=e.undoRedoService)==null||t.redo("api")}function h0(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(kr)}function p0(e){return e.rowRenderer.getEditingCells()}function g0(e,t=!1){e.rowRenderer.stopEditing(t)}function f0(e,t){const i=e.columnModel.getCol(t.colKey);if(!i){z(`no column found for ${t.colKey}`);return}const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};t.rowPinned==null&&gm(e,t.rowIndex),pm(e,t.colKey);const o=e.navigationService.getCellByPosition(s);if(!o)return;const{focusService:r,gos:a}=e,d=()=>{const p=Je(a),f=o.getGui();return p!==f&&f.contains(p)},h=a.get("stopEditingWhenCellsLoseFocus")&&d();(h||!r.isCellFocused(s))&&r.setFocusedCell({...s,forceBrowserFocus:h,preventScrollOnBrowserFocus:!0}),o.startRowOrCellEdit(t.key)}function m0(e){var t;return((t=e.undoRedoService)==null?void 0:t.getCurrentUndoStackSize())??0}function C0(e){var t;return((t=e.undoRedoService)==null?void 0:t.getCurrentRedoStackSize())??0}var v0=class extends G{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){var h;const n=this.createCellEditorParams(e,t,i),o=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(o,n),a=(r==null?void 0:r.popupFromSelector)!=null?r.popupFromSelector:!!o.cellEditorPopup,d=(r==null?void 0:r.popupPositionFromSelector)!=null?r.popupPositionFromSelector:o.cellEditorPopupPosition;return e.setEditing(!0,r),e.getComp().setEditDetails(r,a,d,this.gos.get("reactiveCustomComponents")),this.eventService.dispatchEvent(e.createEvent(s,"cellEditingStarted")),!((h=r==null?void 0:r.params)!=null&&h.suppressPreventDefault)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:n}=this.takeValueFromCellEditor(t,i),o=e.getRowNode(),r=e.getColumn(),a=this.valueService.getValueForDisplay(r,o);let d=!1;return n&&(d=this.saveNewValue(e,a,s,o,r)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.eventService.dispatchEvent({...e.createEvent(null,"cellEditingStopped"),oldValue:a,newValue:s,valueChanged:d}),d}handleColDefChanged(e){const t=e.getCellEditor();if(t!=null&&t.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,n=this.createCellEditorParams(e,i,s),o=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(o,n);t.refresh(r.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp(),i=t.getCellEditor();i!=null&&i.focusIn?i.focusIn():(e.focusCell(!0),e.onCellEditorAttached(()=>{var s,n;return(n=(s=t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:n.call(s)}))}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new Zx(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?i:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,n){if(i===t)return!1;e.setSuppressRefreshCell(!0);const o=s.setDataValue(n,i,"edit");return e.setSuppressRefreshCell(!1),o}createCellEditorParams(e,t,i){const s=e.getColumn(),n=e.getRowNode();return this.gos.addGridCommonParams({value:this.valueService.getValueForDisplay(s,n),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:n,data:n.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:o=>this.valueService.parseValue(s,n,o,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const s=e?B.UP:B.DOWN;this.navigationService.navigateToNextCell(null,s,t,!1)}}},w0=class extends G{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){let n=!0;return e.getAllCellCtrls().reduce((r,a)=>{const d=a===i;return d?n=a.startEditing(t,d,s):a.startEditing(null,d,s),r?!0:a.isEditing()},!1)&&this.setEditing(e,!0),n}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let n=!1;for(const o of i){const r=o.stopEditing(t);s&&!t&&!n&&r&&(n=!0)}n&&this.eventService.dispatchEvent(e.createRowEvent("rowValueChanged")),s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",t));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}},Kn={version:Ce,moduleName:"@ag-grid-community/edit-core",beans:[v0]},S0={version:Ce,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing:d0,redoCellEditing:u0,getCellEditorInstances:h0,getEditingCells:p0,stopEditing:g0,startEditingCell:f0,getCurrentUndoSize:m0,getCurrentRedoSize:C0},dependantModules:[Kn]},y0={version:Ce,moduleName:"@ag-grid-community/undo-redo-edit",beans:[r0],dependantModules:[Kn]},b0={version:Ce,moduleName:"@ag-grid-community/full-row-edit",beans:[w0],dependantModules:[Kn]},fm={version:Ce,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:dm}],dependantModules:[Kn]},R0={version:Ce,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:dm},{name:"agNumberCellEditor",classImp:Xx,params:{suppressPreventDefault:!0}},{name:"agDateCellEditor",classImp:t0},{name:"agDateStringCellEditor",classImp:s0},{name:"agCheckboxCellEditor",classImp:n0}],dependantModules:[fm]},F0={version:Ce,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:qx}],dependantModules:[Kn]},E0={version:Ce,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:jx}],dependantModules:[Kn]},x0={version:Ce,moduleName:"@ag-grid-community/all-editors",dependantModules:[fm,R0,F0,E0]},P0={version:Ce,moduleName:"@ag-grid-community/editing",dependantModules:[Kn,y0,b0,x0,S0]},D0=class extends G{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(o=>this.cloneItemIntoDummy(o,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);const n=this.getAutoSizePadding();return s+n}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);s!=null&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),n=s.classList;["ag-header-cell","ag-header-group-cell"].some(a=>i.classList.contains(a))?(n.add("ag-header","ag-header-row"),s.style.position="static"):n.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some(d=>r.classList.contains(d))){for(let d=0;d<r.classList.length;d++){const h=r.classList[d];h!="ag-row-position-absolute"&&n.add(h)}break}r=r.parentElement}s.appendChild(i),t.appendChild(s)}},T0=class extends G{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide=st(this.gos),this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventService.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let n=(t=e.childStore)==null?void 0:t.getStoreBounds();return e.footer&&(n=(i=e.sibling.childStore)==null?void 0:i.getStoreBounds()),((n==null?void 0:n.heightPx)??0)+((n==null?void 0:n.topPx)??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.footer?e.sibling:e;for(;s.isExpandable()&&s.expanded;)if(s.master)s=s.detailNode;else if(s.childrenAfterSort){if(s.childrenAfterSort.length===0)break;s=he(s.childrenAfterSort)}return s.rowTop+s.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t=e==="top";let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,n=new Set,o=h=>{if(n.add(h),t){const p=this.getLastPixelOfGroup(h),f=s+i+h.rowHeight;p<f?h.stickyRowTop=i+(p-f):h.stickyRowTop=i}else{const p=this.getFirstPixelOfGroup(h),f=s-(i+h.rowHeight);p>f?h.stickyRowTop=i-(p-f):h.stickyRowTop=i}i=0,n.forEach(p=>{const f=p.stickyRowTop+p.rowHeight;i<f&&(i=f)})},r=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),d=h=>{if(!h.displayed)return!1;if(h.footer){if(r===!0||r==="grand"&&h.level===-1||r==="group"&&h.level>-1)return!1;const p=h.sibling.rowIndex?h.sibling.rowIndex+1===h.rowIndex:!1;return e==="bottom"&&p?!1:!n.has(h)}return h.isExpandable()?a===!0||e==="bottom"?!1:!n.has(h)&&h.expanded:!1};for(let h=0;h<100;h++){let p=s+i;t||(p=s-i);const f=this.rowModel.getRowIndexAtPixel(p),m=this.rowModel.getRow(f);if(m==null)break;const w=this.getStickyAncestors(m).find(b=>(t?b.rowIndex<f:b.rowIndex>f)&&d(b));if(w){o(w);continue}if((t?m.rowTop<p:m.rowTop+m.rowHeight>p)&&d(m)){o(m);continue}break}return t||n.forEach(h=>{h.stickyRowTop=i-(h.stickyRowTop+h.rowHeight)}),this.refreshNodesAndContainerHeight(e,n,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=!!this.gos.get("groupIncludeFooter")||e==="group",i=!!this.gos.get("groupIncludeTotalFooter")||e==="grand";return t&&i?!0:i?"grand":t?"group":!1}canRowsBeSticky(){const e=na(this.gos),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(i=>i.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows();return}for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,i){const s=e==="top",n=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,o={},r=[];for(let m=0;m<n.length;m++){const v=n[m].getRowNode();if(!t.has(v)){o[v.id]=n[m],v.sticky=!1;continue}r.push(n[m])}const a=new Set;for(let m=0;m<r.length;m++)a.add(r[m].getRowNode());const d=[];t.forEach(m=>{a.has(m)||(m.sticky=!0,d.push(this.createRowCon(m,!1,!1)))});let h=!!d.length||r.length!==n.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),h=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),h=!0),this.destroyRowCtrls(o,!1);const p=[...r,...d];p.sort((m,v)=>v.getRowNode().rowIndex-m.getRowNode().rowIndex),s||p.reverse(),p.forEach(m=>m.setRowTop(m.getRowNode().stickyRowTop));let f=0;return s?(t.forEach(m=>{m.rowIndex<this.pageBoundsService.getFirstRow()&&(f+=m.rowHeight)}),f>this.topContainerHeight&&(f=this.topContainerHeight),this.setOffsetTop(f)):(t.forEach(m=>{m.rowIndex>this.pageBoundsService.getLastRow()&&(f+=m.rowHeight)}),f>this.bottomContainerHeight&&(f=this.bottomContainerHeight),this.setOffsetBottom(f)),h?(s?this.stickyTopRowCtrls=p:this.stickyBottomRowCtrls=p,!0):!1}ensureRowHeightsValid(){let e=!1;const t=i=>{const s=i.getRowNode();if(s.rowHeightEstimated){const n=qs(this.gos,s);s.setRowHeight(n.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},A0=class extends G{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(o=>o.onCellSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(o=>o.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener("cellSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("cellSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{ei(this.gos)?i():s()}),ei(this.gos)&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",e=>this.onSuppressCellFocusChanged(e.currentValue)),this.addManagedPropertyListeners(["getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection","rowSelection"],()=>this.redrawRows()),na(this.gos)&&(st(this.gos)||xs(this.gos))&&(this.stickyRowFeature=this.createManagedBean(new T0(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this)))),this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=Ft(this.gos,"print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new M0(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=Qs(this.rowCtrlsByRowIndex),t=Qs(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}onSuppressCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onSuppressCellFocusChanged(e)),this.getFullWidthRowCtrls().forEach(t=>t.onSuppressCellFocusChanged(e))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getCols().forEach(t=>{const i=d=>{this.getAllCellCtrls().forEach(h=>{h.getColumn()===t&&d(h)})},s=()=>{i(d=>d.onLeftChanged())},n=()=>{i(d=>d.onWidthChanged())},o=()=>{i(d=>d.onFirstRightPinnedChanged())},r=()=>{i(d=>d.onLastLeftPinnedChanged())},a=()=>{i(d=>d.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",n),t.addEventListener("firstRightPinnedChanged",o),t.addEventListener("lastLeftPinnedChanged",r),t.addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",n),t.removeEventListener("firstRightPinnedChanged",o),t.removeEventListener("lastLeftPinnedChanged",r),t.removeEventListener("colDefChanged",a)})})}onDomLayoutChanged(){const e=Ft(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,"top"),this.refreshFloatingRows(this.bottomRowCtrls,"bottom")}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const{pinnedRowModel:i,beans:s,printLayout:n}=this,o=Object.fromEntries(e.map(a=>[a.getRowNode().id,a]));i.forEachPinnedRow(t,(a,d)=>{const h=e[d];h&&i.getPinnedRowById(h.getRowNode().id,t)===void 0&&(h.destroyFirstPass(),h.destroySecondPass()),a.id in o?(e[d]=o[a.id],delete o[a.id]):e[d]=new $n(a,s,!1,!1,n)});const r=t==="top"?i.getPinnedTopRowCount():i.getPinnedBottomRowCount();e.length=r}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else if((i=this.cachedRowCtrls)!=null&&i.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const s=n=>{const o=n[e.rowIndex];o&&o.getRowNode()===e&&(o.destroyFirstPass(),o.destroySecondPass(),n[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(e!=null){e==null||e.forEach(i=>this.redrawRow(i,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e!=null&&e.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const i=Je(this.gos),s=yr(this.gos,i,sn.DOM_DATA_KEY_CELL_CTRL),n=yr(this.gos,i,$n.DOM_DATA_KEY_ROW_CTRL);return s||n?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&yo(this.gos),n=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const o=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();o&&this.updateContainerHeights(o)}this.recycleRows(n,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){var s;const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),(s=this.stickyRowFeature)==null||s.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let t=this.pageBoundsService.getCurrentPageHeight();t===0&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){var e,t;if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0,(t=(e=this.frameworkOverrides).getLockOnRefresh)==null||t.call(e)}releaseLockOnRefresh(){var e,t;this.refreshInProgress=!1,(t=(e=this.frameworkOverrides).releaseLockOnRefresh)==null||t.call(e)}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&this.focusService.restoreFocusedCell(e,()=>{this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))})}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const n=t[s].getAllCellCtrls(),o=n.length;for(let r=0;r<o;r++)e.push(n[r])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const s in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[s]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&iu()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const i of this.getRowCtrls(e)){if(!i.isFullWidth())continue;i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){var n;const t=this.getCellCtrls(e.rowNodes,e.columns).map(o=>o.getCellRenderer()).filter(o=>o!=null);if((n=e.columns)!=null&&n.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(o=>{if(s&&!this.isRowInMap(o.getRowNode(),s)||!o.isFullWidth())return;const r=o.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const d=r[a];d!=null&&i.push(d)}}),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const s=i.getCellEditor();s&&t.push(s)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const s=i.id;switch(i.rowPinned){case"top":t.top[s]=i;break;case"bottom":t.bottom[s]=i;break;default:t.normal[s]=i;break}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return t.top[i]!=null;case"bottom":return t.bottom[i]!=null;default:return t.normal[i]!=null}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return!e||!t?i:i.filter(s=>{const n=s.getRowNode();return this.isRowInMap(n,t)})}getCellCtrls(e,t){let i;q(t)&&(i={},t.forEach(n=>{const o=this.columnModel.getCol(n);q(o)&&(i[o.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(n=>{n.getAllCellCtrls().forEach(o=>{const r=o.getColumn().getId();i&&!i[r]||s.push(o)})}),s}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e=!1){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];Ei(this.rowCtrlsByRowIndex,(i,s)=>{s.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return Ei(this.rowCtrlsByRowIndex,(i,s)=>{const n=s.getRowNode();t[n.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const s=this.rowCtrlsByRowIndex[i];s&&(s.destroyFirstPass(t),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&iu()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,n=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let o=!1;if(this.stickyRowFeature){o=this.stickyRowFeature.checkStickyRows();const a=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();a&&this.updateContainerHeights(a)}const r=this.firstRenderedRow!==s||this.lastRenderedRow!==n;if(!(t&&!o&&!r)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!o),i!=null)){const a=this.getCellToRestoreFocusToAfterRefresh();i!=null&&a==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(o=>i[o]=!0);const n=Object.keys(this.rowCtrlsByRowIndex).filter(o=>!i[o]);this.removeRowCtrls(n,t)}calculateIndexesToDraw(e){const t=mF(this.firstRenderedRow,this.lastRenderedRow),i=(n,o)=>{const r=o.getRowNode().rowIndex;r!=null&&(r<this.firstRenderedRow||r>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(o)&&t.push(r)};Ei(this.rowCtrlsByRowIndex,i),Ei(e,i),t.sort((n,o)=>n-o);const s=[];for(let n=0;n<t.length;n++){const o=t[n],r=this.rowModel.getRow(o);r&&!r.sticky&&s.push(o)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t),s.forEach(n=>{this.createOrUpdateRowCtrl(n,e,t,i)}),e&&(i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventService.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const s=i.getRowNode();return!(t!=null&&!this.isRowInMap(s,t))})}createOrUpdateRowCtrl(e,t,i,s){let n,o=this.rowCtrlsByRowIndex[e];if(o||(n=this.rowModel.getRow(e),q(n)&&q(t)&&t[n.id]&&n.alreadyRendered&&(o=t[n.id],t[n.id]=null)),!o)if(n||(n=this.rowModel.getRow(e)),q(n))o=this.createRowCon(n,i,s);else return;return n&&(n.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=o,o}destroyRowCtrls(e,t){const i=[];Ei(e,(s,n)=>{if(n){if(this.cachedRowCtrls&&n.isCacheable()){this.cachedRowCtrls.addRow(n);return}if(n.destroyFirstPass(!t),t){const o=n.instanceId;this.zombieRowCtrls[o]=n,i.push(()=>{n.destroySecondPass(),delete this.zombieRowCtrls[o]})}else n.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),Ly(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=On(this.gos);return e*t}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let e,t;if(!this.rowModel.isRowsToRender())e=0,t=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const a=this.getRowBufferInPixels(),d=this.ctrlsService.getGridBodyCtrl(),h=this.gos.get("suppressRowVirtualisation");let p=!1,f,m;do{const R=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:x,pageLastPixel:T}=this.pageBoundsService.getCurrentPagePixelRange(),I=this.rowContainerHeightService.getDivStretchOffset(),V=d.getScrollFeature().getVScrollPosition(),L=V.top,A=V.bottom;h?(f=x+I,m=T+I):(f=Math.max(L+R-a,x)+I,m=Math.min(A+R+a,T)+I),this.firstVisibleVPixel=Math.max(L+R,x)+I,this.lastVisibleVPixel=Math.min(A+R,T)+I,p=this.ensureAllRowsInRangeHaveHeightsCalculated(f,m)}while(p);let v=this.rowModel.getRowIndexAtPixel(f),w=this.rowModel.getRowIndexAtPixel(m);const S=this.pageBoundsService.getFirstRow(),b=this.pageBoundsService.getLastRow();v<S&&(v=S),w>b&&(w=b),e=v,t=w}const i=Ft(this.gos,"normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),n=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>n&&(t=e+n);const o=e!==this.firstRenderedRow,r=t!==this.lastRenderedRow;(o||r)&&(this.firstRenderedRow=e,this.lastRenderedRow=t,this.eventService.dispatchEvent({type:"viewportChanged",firstRow:e,lastRow:t}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){var o,r;const i=(o=this.pinnedRowModel)==null?void 0:o.ensureRowHeightsValid(),s=(r=this.stickyRowFeature)==null?void 0:r.ensureRowHeightsValid(),n=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(n||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),s||n||i?(this.updateContainerHeights(),!0):!1}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),n=this.focusService.isRowNodeFocused(s),o=e.isEditing(),r=s.detail;return n||o||r?!!this.isRowPresent(s):!1}isRowPresent(e){return this.rowModel.isRowPresent(e)?this.paginationService?this.paginationService.isRowPresent(e):!0:!1}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const n=this.gos.get("suppressAnimationFrame"),o=i&&!n&&!this.printLayout;return new $n(e,this.beans,t,o,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(t=>t.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null));break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!s}},M0=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e==null||e.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],kt(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],kt(this.entriesList,e)}getEntries(){return this.entriesList}},k0=class extends G{constructor(){super(...arguments),this.beanName="pinnedRowModel",this.nextId=0,this.pinnedTopRows=new mm,this.pinnedBottomRows=new mm}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedRowData(this.gos.get("pinnedTopRowData"),"top"),this.setPinnedRowData(this.gos.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",e=>this.setPinnedRowData(e.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",e=>this.setPinnedRowData(e.currentValue,"bottom")),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){return(e==="top"?this.pinnedTopRows:this.pinnedBottomRows).isEmpty()}isRowsToRender(e){return!this.isEmpty(e)}onGridStylesChanges(e){if(e.rowHeightChanged){const t=i=>{i.setRowHeight(i.rowHeight,!0)};this.pinnedBottomRows.forEach(t),this.pinnedTopRows.forEach(t)}}ensureRowHeightsValid(){var s,n;let e=!1,t=0;const i=o=>{if(o.rowHeightEstimated){const r=qs(this.gos,o);o.setRowTop(t),o.setRowHeight(r.height),t+=r.height,e=!0}};return(s=this.pinnedBottomRows)==null||s.forEach(i),t=0,(n=this.pinnedTopRows)==null||n.forEach(i),this.eventService.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(e===void 0){i.clear();return}const s=bo(this.gos),n=t==="top"?Ls.ID_PREFIX_TOP_PINNED:Ls.ID_PREFIX_BOTTOM_PINNED,o=i.getIds(),r=[],a=new Set;let d=0,h=-1;for(const p of e){const f=(s==null?void 0:s({data:p,level:0,rowPinned:t}))??n+this.nextId++;if(a.has(f)){z("Duplicate ID",f,"found for pinned row with data",p,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter.");continue}h++,a.add(f),r.push(f);const m=i.getById(f);if(m!==void 0)m.data!==p&&m.setData(p),d+=this.setRowTopAndRowIndex(m,d,h),o.delete(f);else{const v=new Ls(this.beans);v.id=f,v.data=p,v.rowPinned=t,d+=this.setRowTopAndRowIndex(v,d,h),i.push(v)}}o.forEach(p=>{var f;(f=i.getById(p))==null||f.clearRowTopAndRowIndex()}),i.removeAllById(o),i.setOrder(r)}setRowTopAndRowIndex(e,t,i){return e.setRowTop(t),e.setRowHeight(qs(this.gos,e).height),e.setRowIndex(i),e.rowHeight}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getPinnedTopRowCount(){return this.pinnedTopRows.getSize()}getPinnedBottomRowCount(){return this.pinnedBottomRows.getSize()}getPinnedTopRow(e){return this.pinnedTopRows.getByIndex(e)}getPinnedBottomRow(e){return this.pinnedBottomRows.getByIndex(e)}getPinnedRowById(e,t){return t==="top"?this.pinnedTopRows.getById(e):this.pinnedBottomRows.getById(e)}forEachPinnedRow(e,t){return e==="top"?this.pinnedTopRows.forEach(t):this.pinnedBottomRows.forEach(t)}getTotalHeight(e){const t=e.getSize();if(t===0)return 0;const i=e.getByIndex(t-1);return i===void 0?0:i.rowTop+i.rowHeight}},mm=class{constructor(){this.cache={},this.ordering=[]}getById(e){return this.cache[e]}getByIndex(e){const t=this.ordering[e];return this.cache[t]}push(e){this.cache[e.id]=e,this.ordering.push(e.id)}removeAllById(e){for(const t of e)delete this.cache[t];this.ordering=this.ordering.filter(t=>!e.has(t))}setOrder(e){this.ordering=e}forEach(e){this.ordering.forEach((t,i)=>{const s=this.cache[t];s&&e(s,i)})}clear(){this.ordering.length=0,this.cache={}}isEmpty(){return this.ordering.length===0}getSize(){return this.ordering.length}getIds(){return new Set(this.ordering)}},I0=class extends G{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},L0=class extends G{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Wt(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){kt(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),this.activeBlockLoadsCount==0&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.gos.get("debug")&&Fi("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()==="needsLoading").slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(xs(this.gos))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.gos.get("debug")&&Fi(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},_0={version:Ce,moduleName:"@ag-grid-community/row-node-block",beans:[L0]},O0=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return this.root===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(){var e;return this.root&&((e=this.root)==null?void 0:e.key)===null&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){var e;return this.end&&((e=this.end)==null?void 0:e.key)===null&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex(n=>n.id===e.id);if(s>-1){const n=t.slice(0,s),o=t.slice(s+1);return this.setEndRange(e),i?{keep:n,discard:o}:{keep:o,discard:n}}else return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(i==null){const n=this.getRange().slice();return t&&e.depthFirstSearch(o=>!o.group&&n.push(o)),n.push(e),this.setRoot(e),{keep:n,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find(n=>{var o;return n.id===((o=this.end)==null?void 0:o.id)}))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const n=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:n}}}},V0=class extends G{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,n){if(t==null&&e==null)return;const o={},r={},a=(d,h)=>{d.split(" ").forEach(p=>{p.trim()!=""&&h(p)})};if(t){const d=Object.keys(t);for(let h=0;h<d.length;h++){const p=d[h],f=t[p];let m;typeof f=="string"?m=this.expressionService.evaluate(f,i):typeof f=="function"&&(m=f(i)),a(p,v=>{m?o[v]=!0:r[v]=!0})}}e&&n&&Object.keys(e).forEach(d=>a(d,h=>{o[h]||(r[h]=!0)})),n&&Object.keys(r).forEach(n),Object.keys(o).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return typeof i=="function"?s=i(t):s=i,typeof s=="string"&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(n=>{i(n)})}},N0=class extends G{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:n,forceFocusOutWhenTabGuardsAreEmpty:o,isFocusableContainer:r,focusInnerElement:a,onFocusIn:d,onFocusOut:h,shouldStopEventPropagation:p,onTabKeyDown:f,handleKeyDown:m,eFocusableElement:v}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=a,this.eFocusableElement=v,this.focusTrapActive=!!n,this.forceFocusOutWhenTabGuardsAreEmpty=!!o,this.isFocusableContainer=!!r,this.providedFocusIn=d,this.providedFocusOut=h,this.providedShouldStopEventPropagation=p,this.providedOnTabKeyDown=f,this.providedHandleKeyDown=m}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new zn(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)}))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){var d;const t=lt(this.gos),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(s===-1)return;let n,o;e?(n=0,o=s):(n=s+1,o=i.length);const r=i.slice(n,o),a=this.gos.get("tabIndex");r.sort((h,p)=>{const f=parseInt(h.getAttribute("tabindex")||"0"),m=parseInt(p.getAttribute("tabindex")||"0");return m===a?1:f===a?-1:f===0?1:m===0?-1:f-m}),(d=r[e?r.length-1:0])==null||d.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},B0=class extends G{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:i,eFocusableElement:s}=this,n=[t,i],o={setTabIndex:S=>{n.forEach(b=>S!=null?b.setAttribute("tabindex",S):b.removeAttribute("tabindex"))}};this.addTabGuards(t,i);const{focusTrapActive:r=!1,onFocusIn:a,onFocusOut:d,focusInnerElement:h,handleKeyDown:p,onTabKeyDown:f,shouldStopEventPropagation:m,forceFocusOutWhenTabGuardsAreEmpty:v,isFocusableContainer:w}=e;this.tabGuardCtrl=this.createManagedBean(new N0({comp:o,focusTrapActive:r,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:a,onFocusOut:d,focusInnerElement:h,handleKeyDown:p,onTabKeyDown:f,shouldStopEventPropagation:m,forceFocusOutWhenTabGuardsAreEmpty:v,isFocusableContainer:w}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=lt(this.gos).createElement("div"),i=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),ti(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Lt(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){ba(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},Cm=class extends ke{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new B0(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},G0=0,H0=200,W0=class extends G{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(s!==-1){const v=this.popupList[s];v.alignedToElement=t}const n=t.getBoundingClientRect(),o=this.getParentRect(),r=this.keepXYWithinBounds(i,n.top-o.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const h=o.right-o.left-a;let p;this.gos.get("enableRtl")?(p=m(),p<0&&(p=f(),this.setAlignedStyles(i,"left")),p>h&&(p=0,this.setAlignedStyles(i,"right"))):(p=f(),p>h&&(p=m(),this.setAlignedStyles(i,"right")),p<0&&(p=0,this.setAlignedStyles(i,"left"))),i.style.left=`${p}px`,i.style.top=`${r}px`;function f(){return n.right-o.left-2}function m(){return n.left-o.left-a}}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:n}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:n,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:n,eventSource:o,alignSide:r="left",position:a="over",column:d,rowNode:h,type:p}=e,f=o.getBoundingClientRect(),m=this.getParentRect(),v=this.getPopupIndex(t);if(v!==-1){const S=this.popupList[v];S.alignedToElement=o}const w=()=>{let S=f.left-m.left;r==="right"&&(S-=t.offsetWidth-f.width);let b;return a==="over"?(b=f.top-m.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,f,m,e.nudgeY||0)==="under"?b=f.top-m.top+f.height:b=f.top-t.offsetHeight-(s||0)*2-m.top),{x:S,y:b}};this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:n,updatePosition:w,postProcessCallback:()=>this.callPostProcessPopup(p,t,o,null,d,h)})}shouldRenderUnderOrAbove(e,t,i,s){const n=i.bottom-t.bottom,o=t.top-i.top,r=e.offsetHeight+s;return n>r?"under":o>r||o>n?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i],{alignedToElement:n}=s;!n||(["right","left","over","above","under"].forEach(r=>{n.classList.remove(`ag-has-popup-positioned-${r}`),e.classList.remove(`ag-popup-positioned-${r}`)}),!t)||(n.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,n,o){const r=this.gos.getCallback("postProcessPopup");r&&r({column:n,rowNode:o,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:n,skipObserver:o,updatePosition:r}=e,a={width:0,height:0},d=(h=!1)=>{let{x:p,y:f}=r();h&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(p+=s),n&&(f+=n),i&&(p=this.keepXYWithinBounds(t,p,1),f=this.keepXYWithinBounds(t,f,0)),t.style.left=`${p}px`,t.style.top=`${f}px`,e.postProcessCallback&&e.postProcessCallback())};if(d(),!o){const h=this.resizeObserverService.observeResize(t,()=>d(!0));setTimeout(()=>h(),H0)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=lt(this.gos);let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),of(t)}keepXYWithinBounds(e,t,i){const s=i===0,n=s?"clientHeight":"clientWidth",o=s?"top":"left",r=s?"height":"width",a=s?"scrollTop":"scrollLeft",d=lt(this.gos),h=d.documentElement,p=this.getPopupParent(),f=e.getBoundingClientRect(),m=p.getBoundingClientRect(),v=d.documentElement.getBoundingClientRect(),w=p===d.body,S=Math.ceil(f[r]);let R=w?(s?nf:Ca)(h)+h[a]:p[n];w&&(R-=Math.abs(v[o]-m[o]));const x=R-S;return Math.min(Math.max(t,0),Math.abs(x))}addPopup(e){const t=lt(this.gos),{eChild:i,ariaLabel:s,alwaysOnTop:n,positionCallback:o,anchorToElement:r}=e;if(!t)return z("could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const d=this.createPopupWrapper(i,s,!!n),h=this.addEventListenersToPopup({...e,wrapperEl:d});return o&&o(),this.addPopupToPopupList(i,d,h,r),{hideFunc:h}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();q(e.style.top)||(e.style.top=`${i.top*-1}px`),q(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const s=this.getPopupParent(),n=document.createElement("div");return this.environment.applyThemeClasses(n),n.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||ti(e,"dialog"),xo(e,t),n.appendChild(e),s.appendChild(n),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),n}handleThemeChange(e){if(e.themeChanged)for(const t of this.popupList)this.environment.applyThemeClasses(t.wrapper)}addEventListenersToPopup(e){const t=lt(this.gos),i=this.getPopupParent(),{wrapperEl:s,eChild:n,closedCallback:o,afterGuiAttached:r,closeOnEsc:a,modal:d}=e;let h=!1;const p=w=>{if(!s.contains(Je(this.gos)))return;w.key===B.ESCAPE&&!Ds(w)&&v({keyboardEvent:w})},f=w=>v({mouseEvent:w}),m=w=>v({touchEvent:w}),v=(w={})=>{const{mouseEvent:S,touchEvent:b,keyboardEvent:R,forceHide:x}=w;!x&&(this.isEventFromCurrentPopup({mouseEvent:S,touchEvent:b},n)||h)||(h=!0,i.removeChild(s),t.removeEventListener("keydown",p),t.removeEventListener("mousedown",f),t.removeEventListener("touchstart",m),t.removeEventListener("contextmenu",f),this.eventService.removeEventListener("dragStarted",f),o&&o(S||b||R),this.removePopupFromPopupList(n))};return r&&r({hidePopup:v}),window.setTimeout(()=>{a&&t.addEventListener("keydown",p),d&&(t.addEventListener("mousedown",f),this.eventService.addEventListener("dragStarted",f),t.addEventListener("touchstart",m),t.addEventListener("contextmenu",f))},0),v}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:G0++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(o=>o&&o()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const n=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=n,s.isAnchored=!0,n}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:n}=e,o=s.getBoundingClientRect(),r=f=>parseInt(f.substring(0,f.length-1),10),a=(f,m)=>{const v=i[f]-o[f],w=r(n.style[f]);return{initialDiff:v,lastDiff:v,initial:w,last:w,direction:m}},d=a("top",0),h=a("left",1),p=this.getFrameworkOverrides();return new ui(f=>{p.wrapIncoming(()=>{p.setInterval(()=>{const m=t.getBoundingClientRect(),v=s.getBoundingClientRect();if(v.top==0&&v.left==0&&v.height==0&&v.width==0){e.hidePopup();return}const S=(b,R)=>{const x=r(n.style[R]);b.last!==x&&(b.initial=x,b.last=x);const T=m[R]-v[R];if(T!=b.lastDiff){const I=this.keepXYWithinBounds(n,b.initial+b.initialDiff-T,b.direction);n.style[R]=`${I}px`,b.last=I}b.lastDiff=T};S(d,"top"),S(h,"left")},200).then(m=>{f(()=>{m!=null&&window.clearInterval(m)})})},"popupPositioning")})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,n=i||s;if(!n)return!1;const o=this.getPopupIndex(t);if(o===-1)return!1;for(let r=o;r<this.popupList.length;r++){const a=this.popupList[r];if(Jy(a.element,n))return!0}return this.isElementWithinCustomPopup(n.target)}isElementWithinCustomPopup(e){const t=lt(this.gos);for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,n=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),o=n.length,r=this.getWrapper(e);if(!r||s<=1||!t.contains(e))return!1;const a=i.indexOf(r),d=r.querySelectorAll("div"),h=[];d.forEach(f=>{f.scrollTop!==0&&h.push([f,f.scrollTop])});let p=!1;for(o?r.classList.contains("ag-always-on-top")?a!==s-1&&(he(n).insertAdjacentElement("afterend",r),p=!0):a!==s-o-1&&(n[0].insertAdjacentElement("beforebegin",r),p=!0):a!==s-1&&(he(i).insertAdjacentElement("afterend",r),p=!0);h.length;){const f=h.pop();f[0].scrollTop=f[1]}return p}},z0=["touchstart","touchend","touchmove","touchcancel"],vm=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new ui(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const n=Ps(z0,t);e.addEventListener(t,i,{capture:!!s,passive:n})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},U0=class extends G{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===B.UP,s=e===B.DOWN,n=e===B.LEFT;let o,r;if(i||s)r=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),o=t.column;else{const a=this.visibleColsService.getAllCols(),d=this.gos.get("enableRtl");r=t.rowIndex,o=n!==d?a[0]:he(a)}return{rowIndex:r,rowPinned:null,column:o}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case B.UP:i=this.getCellAbove(i);break;case B.DOWN:i=this.getCellBelow(i);break;case B.RIGHT:this.gos.get("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case B.LEFT:this.gos.get("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,z("unknown key for navigation ",e);break}i?s=this.isCellGoodToFocusOn(i):s=!0}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}return i?!t.isSuppressNavigable(i):!1}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;let s=!1;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}else i&&(s=!0);const n=this.rowModel.getRow(e.rowIndex),o=s?void 0:this.getNextStickyPosition(n);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!na(this.gos)||!e||!e.sticky)return;const i=this.rowRenderer.getStickyTopRowCtrls().some(a=>a.getRowNode().rowIndex===e.rowIndex);let s=[];i?s=[...this.rowRenderer.getStickyTopRowCtrls()].sort((a,d)=>a.getRowNode().rowIndex-d.getRowNode().rowIndex):s=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((a,d)=>d.getRowNode().rowIndex-a.getRowNode().rowIndex);const n=t?-1:1,o=s.findIndex(a=>a.getRowNode().rowIndex===e.rowIndex),r=s[o+n];if(r)return{rowIndex:r.getRowNode().rowIndex,rowPinned:null}}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return t==="top"?this.pinnedRowModel.getPinnedTopRowCount()-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowCount()-1<=i:this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned,s=i?t===0:t===this.pageBoundsService.getFirstRow();let n=!1;if(s)return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;i&&(n=!0);const o=this.rowModel.getRow(e.rowIndex),r=n?void 0:this.getNextStickyPosition(o,!0);return r||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowCount()-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){var o;const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,n=this.visibleColsService.getColAfter(e.column);if(!n){n=t[0];const r=this.getRowBelow(e);if(Ve(r)||!r.rowPinned&&!(((o=this.paginationService)==null?void 0:o.isRowInPage(r))??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:n,rowPinned:s}}getNextTabbedCellBackwards(e){var o;const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,n=this.visibleColsService.getColBefore(e.column);if(!n){n=he(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(Ve(r)||!r.rowPinned&&!(((o=this.paginationService)==null?void 0:o.isRowInPage(r))??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:n,rowPinned:s}}},$t=(e,t)=>{for(const i in t)t[i]=e;return t},wm={...$t("@ag-grid-community/core",{dispatchEvent:0,destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,getState:0,setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0,redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRow:0,getFirstDisplayedRowIndex:0,getLastDisplayedRow:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0,getModel:0,getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0,getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0,addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0,expireValueCache:0,getValue:0,getCellValue:0,showColumnMenuAfterButtonClick:0,showColumnMenuAfterMouseClick:0,showColumnMenu:0,hidePopupMenu:0,onSortChanged:0,getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0,setGridAriaProperty:0,refreshCells:0,flashCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0,addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getColumnDef:0,getColumnDefs:0,sizeColumnsToFit:0,setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumn:0,getDisplayNameForColumnGroup:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnVisible:0,setColumnsVisible:0,setColumnPinned:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0,moveColumn:0,moveColumnByIndex:0,moveColumns:0,setColumnWidth:0,setColumnWidths:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0,autoSizeColumn:0,autoSizeColumns:0,autoSizeAllColumns:0,undoCellEditing:0,redoCellEditing:0,getCellEditorInstances:0,getEditingCells:0,stopEditing:0,startEditingCell:0,getCurrentUndoSize:0,getCurrentRedoSize:0,isAnyFilterPresent:0,onFilterChanged:0,isColumnFilterPresent:0,getFilterInstance:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0,paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0,expandAll:0,collapseAll:0,onRowHeightChanged:0,setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...$t("@ag-grid-community/client-side-row-model",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,resetRowHeights:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0}),...$t("@ag-grid-community/csv-export",{getDataAsCsv:0,exportDataAsCsv:0}),...$t("@ag-grid-community/infinite-row-model",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...$t("@ag-grid-enterprise/advanced-filter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...$t("@ag-grid-enterprise/charts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...$t("@ag-grid-enterprise/clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...$t("@ag-grid-enterprise/excel-export",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...$t("@ag-grid-enterprise/master-detail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...$t("@ag-grid-enterprise/menu",{showContextMenu:0,showColumnChooser:0,hideColumnChooser:0}),...$t("@ag-grid-enterprise/range-selection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...$t("@ag-grid-enterprise/row-grouping",{addAggFunc:0,addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0,isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumn:0,removeValueColumns:0,addValueColumn:0,addValueColumns:0,setRowGroupColumns:0,removeRowGroupColumn:0,removeRowGroupColumns:0,addRowGroupColumn:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0,setPivotColumns:0,removePivotColumn:0,removePivotColumns:0,addPivotColumn:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...$t("@ag-grid-enterprise/server-side-row-model",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0}),...$t("@ag-grid-enterprise/side-bar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...$t("@ag-grid-enterprise/status-bar",{getStatusPanel:0})},Iu={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},$0=(e,t)=>e.eventService.dispatchEvent(t),Sm=class{};Reflect.defineProperty(Sm,"name",{value:"GridApi"});var K0=class extends G{constructor(){super(),this.beanName="apiFunctionService",this.api=new Sm,this.fns={...Iu,dispatchEvent:$0},this.beans=null,this.preDestroyLink="";const{api:e}=this;for(const t in wm)e[t]=this.makeApi(t)[t]}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){var n;const{fns:i,beans:s}=this;i!==Iu&&(i[e]=((n=s==null?void 0:s.validationService)==null?void 0:n.validateApiFunction(e,t))??t)}makeApi(e){return{[e]:(...t)=>{const{beans:i,fns:{[e]:s}}=this;return s?s(i,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:i,preDestroyLink:s}=this;if(!t)z(`Grid API function ${e}() cannot be called as the grid has been destroyed.
155
- Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
156
- To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${s}`);else{const n=wm[e];i.assertModuleRegistered(n,`api.${e}`)&&z(`API function '${e}' not registered to module '${n}'`)}}destroy(){super.destroy(),this.fns=Iu,this.beans=null}};function j0(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionService").api}}var Z0=class extends G{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],n={};return e.forEach(o=>{const r=this.createDefFromColumn(o,t,i);let a=!0,d=r,h=o.getOriginalParent(),p=null;for(;h;){let f=null;if(h.isPadding()){h=h.getOriginalParent();continue}const m=n[h.getGroupId()];if(m){m.children.push(d),a=!1;break}if(f=this.createDefFromGroup(h),f&&(f.children=[d],n[f.groupId]=f,d=f,h=h.getOriginalParent()),h!=null&&p===h){a=!1;break}p=h}a&&s.push(d)}),s}createDefFromGroup(e){const t=Bd(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=Bd(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=e.isVisible()?void 0:!0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,s}},q0=class extends G{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(e){this.eventService.dispatchEvent({type:"displayedColumnsChanged",source:e})}gridColumns(){this.eventService.dispatchEvent({type:"gridColumnsChanged"})}headerHeight(e){this.eventService.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"})}groupHeaderHeight(e){this.eventService.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}groupOpened(e){this.eventService.dispatchEvent({type:"columnGroupOpened",columnGroup:e.length===1?e[0]:void 0,columnGroups:e})}rowGroupChanged(e,t){this.eventService.dispatchEvent({type:"columnRowGroupChanged",columns:e,column:e.length===1?e[0]:null,source:t})}genericColumnEvent(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t.length===1?t[0]:null,source:i})}pivotModeChanged(){this.eventService.dispatchEvent({type:"columnPivotModeChanged"})}virtualColumnsChanged(e){this.eventService.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}newColumnsLoaded(e){this.eventService.dispatchEvent({type:"newColumnsLoaded",source:e})}everythingChanged(e){this.eventService.dispatchEvent({type:"columnEverythingChanged",source:e})}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:n}=e;this.eventService.dispatchEvent({type:"columnMoved",columns:t,column:t&&t.length===1?t[0]:null,toIndex:s,finished:n,source:i})}columnPinned(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,n=>n.getPinned());this.eventService.dispatchEvent({type:"columnPinned",pinned:s??null,columns:e,column:i,source:t})}columnVisible(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,n=>n.isVisible());this.eventService.dispatchEvent({type:"columnVisible",visible:s,columns:e,column:i,source:t})}getCommonValue(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i})}columnResized(e,t,i,s=null){e&&e.length&&this.eventService.dispatchEvent({type:"columnResized",columns:e,column:e.length===1?e[0]:null,flexColumns:s,finished:t,source:i})}},Y0=class extends G{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){const e=this.columnModel.getColDefCols();if(Ve(e)||!this.columnModel.isAlive())return[];const i=this.columnModel.getAllCols().map(s=>this.createStateItemFromColumn(s));return this.orderColumnStateList(i),i}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,n=e.isPivotActive()?i.indexOf(e):null,o=e.isValueActive()?e.getAggFunc():null,r=e.getSort()!=null?e.getSort():null,a=e.getSortIndex()!=null?e.getSortIndex():null,d=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:r,sortIndex:a,aggFunc:o,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:n,flex:d}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map((s,n)=>[s.getColId(),n]));e.sort((s,n)=>{const o=i.has(s.colId)?i.get(s.colId):-1,r=i.has(n.colId)?i.get(n.colId):-1;return o-r})}},Q0=class extends G{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[],t=this.columnModel.getColTree();return As(null,t,i=>{zt(i)&&e.push({groupId:i.getGroupId(),open:i.isExpanded()})}),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];As(null,t,s=>{if(zt(s)){const n=s.getColGroupDef(),o={groupId:s.getGroupId(),open:n?n.openByDefault:void 0};i.push(o)}}),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const s=[];e.forEach(n=>{const o=n.groupId,r=n.open,a=this.columnModel.getProvidedColGroup(o);a&&a.isExpanded()!==r&&(a.setExpanded(r),s.push(a))}),this.visibleColsService.refresh(t,!0),s.length&&this.eventDispatcher.groupOpened(s),this.columnAnimationService.finish()}},X0=class extends G{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const o=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=o-this.scrollPosition-this.scrollWidth,this.viewportRight=o-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t];break}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||this.isAnyParentAutoHeaderHeight(e)?!0:this.isColumnInRowViewport(e)}isAnyParentAutoHeaderHeight(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,n=this.viewportRight+200,o=t<s&&i<s,r=t>n&&i>n;return!o&&!r}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=n=>{const o=n.getLeft();return q(o)&&o>this.viewportLeft},i=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),s=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,s,i,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach(o=>e[o.getId()]=!0);const n=(o,r,a)=>{let d=!1;for(let h=0;h<o.length;h++){const p=o[h];let f=!1;if(Xs(p))f=e[p.getId()]===!0;else{const v=p.getDisplayedChildren();v&&(f=n(v,r,a+1))}f&&(d=!0,r[a]||(r[a]=[]),r[a].push(p))}return d};n(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),n(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),n(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){const e=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),i=this.colsWithinViewportHash!==t;return i&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),i}},J0=class extends G{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(){return!1}getGui(){return this.eGui}init(s){const n=e(s),o=typeof n;if(o==="string"||o==="number"||o==="boolean"){this.eGui=ks("<span>"+n+"</span>");return}if(n==null){this.eGui=ks("<span></span>");return}this.eGui=n}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}},eP=class extends G{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},dragAndDropImageComponent:{mandatoryMethodList:["setIcon","setLabel"],optionalMethodList:[]},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},tP=["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","controlsColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"],ym=Object.fromEntries(tP.map((e,t)=>[e,t]));function iP(e,t){const i=(e.beanName?ym[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,s=(t.beanName?ym[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return i-s}function sP(e,t){return(e==null?void 0:e.beanName)==="gridDestroyService"?-1:0}var nP=class extends G{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(i!=null)return new i(...t)}},oP=class extends G{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={gridCtrl:void 0,gridBodyCtrl:void 0,center:void 0,left:void 0,right:void 0,bottomCenter:void 0,bottomLeft:void 0,bottomRight:void 0,topCenter:void 0,topLeft:void 0,topRight:void 0,stickyTopCenter:void 0,stickyTopLeft:void 0,stickyTopRight:void 0,stickyBottomCenter:void 0,stickyBottomLeft:void 0,stickyBottomRight:void 0,fakeHScrollComp:void 0,fakeVScrollComp:void 0,gridHeaderCtrl:void 0,centerHeader:void 0,leftHeader:void 0,rightHeader:void 0},this.ready=!1,this.readyCallbacks=[],this.runReadyCallbacksAsync=!1}wireBeans(e){var t,i;this.runReadyCallbacksAsync=((i=(t=e.frameworkOverrides).runWhenReadyAsync)==null?void 0:i.call(t))??!1}postConstruct(){this.addEventListener("ready",()=>{this.updateReady(),this.ready&&(this.readyCallbacks.forEach(e=>e(this.params)),this.readyCallbacks.length=0)},this.runReadyCallbacksAsync)}updateReady(){this.ready=Object.values(this.params).every(e=>(e==null?void 0:e.isAlive())??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const i=this.readyCallbacks.indexOf(t);i>=0&&this.readyCallbacks.splice(i,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},rP=class extends G{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${i??"null"}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,n=e.rowIndex===t.rowIndex;return i&&s&&n}},lP=class extends G{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){st(this.gos)&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(s=>this.eventService.dispatchEvent(s)),this.events=[]};t?i():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},aP=class extends G{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),t===void 0?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRow(e.rowIndex);case"bottom":return this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!0:e&&!t||!e&&t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(q(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}},bm={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},Rm={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},Fm={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},cP=class extends G{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.ancestorThemeClasses=[],this.sizesMeasured=!1,this.gridTheme=null}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("theme",()=>this.handleThemeGridOptionChange()),this.handleThemeGridOptionChange(),this.addDestroyFunc(()=>this.stopUsingTheme()),this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.ancestorThemeClasses=this.readAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(bm),this.getSizeEl(Rm),this.getSizeEl(Fm)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(bm)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(Rm)}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(Fm)}hasMeasuredSizes(){return this.sizesMeasured}getGridThemeClass(){var e;return((e=this.gridTheme)==null?void 0:e.getCssClass())||null}getThemeClasses(){return this.gridTheme?[this.gridTheme.getCssClass()]:this.ancestorThemeClasses}applyThemeClasses(e){const t=this.getThemeClasses();for(const i of Array.from(e.classList))i.startsWith("ag-theme-")&&!t.includes(i)&&e.classList.remove(i);e.classList.add(...t)}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(t==null||isNaN(t)||!isFinite(t))return e!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):e!=""?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(t!=null)return t;const i=this.measureSizeEl(e);return i==="detached"||i==="no-styles"?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";const i=t.offsetWidth;return i===Em?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.gos.get("theme")&&this.applyThemeClasses(i),this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${Em}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);s==="no-styles"&&z(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const n=this.resizeObserverService.observeResize(t,()=>{const o=this.measureSizeEl(e);o==="detached"||o==="no-styles"||(this.lastKnownValues.set(e,o),o!==s&&(s=o,this.fireGridStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>n()),t}fireGridStylesChangedEvent(e){this.eventService.dispatchEvent({type:"gridStylesChanged",[e]:!0})}setUpThemeClassObservers(){const e=new MutationObserver(()=>{const i=this.readAncestorThemeClasses();dP(i,this.ancestorThemeClasses)||(this.ancestorThemeClasses=i,this.fireGridStylesChangedEvent("themeChanged"))});let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement;this.addDestroyFunc(()=>e.disconnect())}readAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(;e;){const i=Array.from(e.classList).filter(s=>s.startsWith("ag-theme-"));for(const s of i)t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}handleThemeGridOptionChange(){const{gos:e,eMeasurementContainer:t,gridTheme:i}=this,s=e.get("theme")||null;s!==i&&(i==null||i.stopUse(),this.gridTheme=s,s==null||s.startUse({loadThemeGoogleFonts:e.get("loadThemeGoogleFonts"),container:this.eGridDiv}),t&&this.applyThemeClasses(t),this.fireGridStylesChangedEvent("themeChanged"))}stopUsingTheme(){var e;(e=this.gridTheme)==null||e.stopUse(),this.gridTheme=null}},dP=(e,t)=>e.length===t.length&&e.findIndex((i,s)=>e[s]!==t[s])===-1,Em=15538,uP=class extends G{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new So}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=sa(this.gos);this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},Lu=class Ni extends G{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(t){this.eGridDiv=t.eGridDiv,this.columnModel=t.columnModel,this.visibleColsService=t.visibleColsService,this.headerNavigationService=t.headerNavigationService,this.headerPositionUtils=t.headerPositionUtils,this.rowRenderer=t.rowRenderer,this.rowPositionUtils=t.rowPositionUtils,this.cellPositionUtils=t.cellPositionUtils,this.navigationService=t.navigationService,this.ctrlsService=t.ctrlsService,this.filterManager=t.filterManager,this.rangeService=t.rangeService,this.advancedFilterService=t.advancedFilterService,this.overlayService=t.overlayService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",Ni.toggleKeyboardMode),t.addEventListener("mousedown",Ni.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.removeEventListener("keydown",Ni.toggleKeyboardMode),t.removeEventListener("mousedown",Ni.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=Ni.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(Ni.keyboardModeActive=s)}postConstruct(){const t=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:t,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:t,columnRowGroupChanged:t}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(this,i=>{this.gridCtrl=i.gridCtrl})}registerKeyboardFocusEvents(){const t=lt(this.gos);Ni.addKeyboardModeEvents(t),Ni.instanceCount++,this.addDestroyFunc(()=>{Ni.instanceCount--,Ni.removeKeyboardModeEvents(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,i=this.columnModel.getCol(t.getId());t!==i&&this.clearFocusedCell()}isKeyboardMode(){return Ni.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(Je(this.gos),$n.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(Je(this.gos),Pa.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(t,i){let s=t;for(;s;){if(yr(this.gos,s,i))return!1;s=s.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(t){return this.isCellRestoreFocused(t)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}clearRestoreFocus(){this.restoredFocusedCellPosition=null,this.awaitRestoreFocusedCell=!1}restoreFocusedCell(t,i){this.awaitRestoreFocusedCell=!0,setTimeout(()=>{this.awaitRestoreFocusedCell&&(this.setRestoreFocusedCell(t),i())})}isCellRestoreFocused(t){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.restoredFocusedCellPosition)}setRestoreFocusedCell(t){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=t)}getFocusEventParams(t){const{rowIndex:i,rowPinned:s,column:n}=t,o={rowIndex:i,rowPinned:s,column:n,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s});return r&&(o.isFullWidthCell=r.isFullWidth()),o}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const t=this.getFocusEventParams(this.focusedCellPosition);this.focusedCellPosition=null,this.eventService.dispatchEvent({type:"cellFocusCleared",...t})}setFocusedCell(t){const{column:i,rowIndex:s,rowPinned:n,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1}=t,a=this.columnModel.getCol(i);if(!a){this.focusedCellPosition=null;return}this.focusedCellPosition={rowIndex:s,rowPinned:Gi(n),column:a},this.eventService.dispatchEvent({type:"cellFocused",...this.getFocusEventParams(this.focusedCellPosition),forceBrowserFocus:o,preventScrollOnBrowserFocus:r})}isCellFocused(t){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.focusedCellPosition)}isRowNodeFocused(t){return this.isRowFocused(t.rowIndex,t.rowPinned)}isHeaderWrapperFocused(t){if(this.focusedHeaderPosition==null)return!1;const i=t.getColumnGroupChild(),s=t.getRowIndex(),n=t.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return i===o&&s===r&&n==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(t,i){this.focusedHeaderPosition={headerRowIndex:t,column:i}}isHeaderFocusSuppressed(){return this.gos.get("suppressHeaderFocus")||this.overlayService.isExclusive()}isCellFocusSuppressed(){return this.gos.get("suppressCellFocus")||this.overlayService.isExclusive()}focusHeaderPosition(t){var h;if(this.isHeaderFocusSuppressed())return!1;const{direction:i,fromTab:s,allowUserOverride:n,event:o,fromCell:r,rowWithoutSpanValue:a}=t;let{headerPosition:d}=t;if(r&&((h=this.filterManager)!=null&&h.isAdvancedFilterHeaderActive()))return this.focusAdvancedFilter(d);if(n){const p=this.getFocusedHeader(),f=this.headerNavigationService.getHeaderRowCount();if(s){const m=this.gos.getCallback("tabToNextHeader");m&&(d=this.getHeaderPositionFromUserFunc({userFunc:m,direction:i,currentPosition:p,headerPosition:d,headerRowCount:f}))}else{const m=this.gos.getCallback("navigateToNextHeader");if(m&&o){const v={key:o.key,previousHeaderPosition:p,nextHeaderPosition:d,headerRowCount:f,event:o};d=m(v)}}}return d?this.focusProvidedHeaderPosition({headerPosition:d,direction:i,event:o,fromCell:r,rowWithoutSpanValue:a}):!1}focusHeaderPositionFromUserFunc(t){if(this.isHeaderFocusSuppressed())return!1;const{userFunc:i,headerPosition:s,direction:n,event:o}=t,r=this.getFocusedHeader(),a=this.headerNavigationService.getHeaderRowCount(),d=this.getHeaderPositionFromUserFunc({userFunc:i,direction:n,currentPosition:r,headerPosition:s,headerRowCount:a});return!!d&&this.focusProvidedHeaderPosition({headerPosition:d,direction:n,event:o})}getHeaderPositionFromUserFunc(t){const{userFunc:i,direction:s,currentPosition:n,headerPosition:o,headerRowCount:r}=t,d=i({backwards:s==="Before",previousHeaderPosition:n,nextHeaderPosition:o,headerRowCount:r});return d===!0||d===null?(d===null&&z("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),n):d===!1?null:d}focusProvidedHeaderPosition(t){var f;const{headerPosition:i,direction:s,fromCell:n,rowWithoutSpanValue:o,event:r}=t,{column:a,headerRowIndex:d}=i;if(d===-1)return(f=this.filterManager)!=null&&f.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(i):this.focusGridView(a);this.headerNavigationService.scrollToColumn(a,s);const h=this.ctrlsService.getHeaderRowContainerCtrl(a.getPinned()),p=(h==null?void 0:h.focusHeader(i.headerRowIndex,a,r))||!1;return p&&(o!=null||n)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),p}focusFirstHeader(){if(this.overlayService.isExclusive()&&this.focusOverlay())return!0;let t=this.visibleColsService.getAllCols()[0];if(!t)return!1;t.getParent()&&(t=this.visibleColsService.getColGroupAtLevel(t,0));const i=this.headerPositionUtils.getHeaderIndexToFocus(t,0);return this.focusHeaderPosition({headerPosition:i,rowWithoutSpanValue:0})}focusLastHeader(t){if(this.overlayService.isExclusive()&&this.focusOverlay(!0))return!0;const i=this.headerNavigationService.getHeaderRowCount()-1,s=he(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:i,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(t){var i;return(i=this.filterManager)!=null&&i.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(t)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,i){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===Gi(i)}findFocusableElements(t,i,s=!1){const n=Kb;let o=sf;i&&(o+=", "+i),s&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(t.querySelectorAll(n)).filter(h=>di(h)),a=Array.prototype.slice.apply(t.querySelectorAll(o));return a.length?((h,p)=>h.filter(f=>p.indexOf(f)===-1))(r,a):r}focusInto(t,i=!1,s=!1){const n=this.findFocusableElements(t,null,s),o=i?he(n):n[0];return o?(o.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(t,i){if(!i)return null;const s=this.findFocusableElements(t),n=s.indexOf(i);if(n===-1)return null;let o=-1;for(let r=n-1;r>=0;r--)if(s[r].classList.contains("ag-tab-guard-top")){o=r;break}return o<=0?null:s[o-1]}findNextFocusableElement(t=this.eGridDiv,i,s){const n=this.findFocusableElements(t,i?':not([tabindex="-1"])':null),o=Je(this.gos);let r;i?r=n.findIndex(d=>d.contains(o)):r=n.indexOf(o);const a=r+(s?-1:1);return a<0||a>=n.length?null:n[a]}isTargetUnderManagedComponent(t,i){if(!i)return!1;const s=t.querySelectorAll(`.${zn.FOCUS_MANAGED_CLASS}`);if(!s.length)return!1;for(let n=0;n<s.length;n++)if(s[n].contains(i))return!0;return!1}findTabbableParent(t,i=5){let s=0;for(;t&&su(t)===null&&++s<=i;)t=t.parentElement;return su(t)===null?null:t}focusOverlay(t){var s;const i=this.overlayService.isVisible()&&((s=this.overlayService.getOverlayWrapper())==null?void 0:s.getGui());return!!i&&this.focusInto(i,t)}focusGridViewFailed(t,i){return i&&this.focusOverlay(t)||t&&this.focusLastHeader()}focusGridView(t,i=!1,s=!0){var o,r;if(this.overlayService.isExclusive())return s&&this.focusOverlay(i);if(this.isCellFocusSuppressed())return i&&!this.isHeaderFocusSuppressed()?this.focusLastHeader():s&&this.focusOverlay(i)?!0:this.focusNextGridCoreContainer(!1);const n=i?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(n){const{rowIndex:a,rowPinned:d}=n;if(t??(t=(o=this.getFocusedHeader())==null?void 0:o.column),t&&a!==void 0&&a!==null){if(this.navigationService.ensureCellVisible({rowIndex:a,column:t,rowPinned:d}),i){const h=this.rowRenderer.getRowByPosition(n);if(h!=null&&h.isFullWidth()&&this.navigationService.tryToFocusFullWidthRow(n,i))return!0}return this.setFocusedCell({rowIndex:a,column:t,rowPinned:Gi(d),forceBrowserFocus:!0}),(r=this.rangeService)==null||r.setRangeToCell({rowIndex:a,rowPinned:d,column:t}),!0}}return!!(s&&this.focusOverlay(i)||i&&this.focusLastHeader())}isGridFocused(){const t=Je(this.gos);return!!t&&this.eGridDiv.contains(t)}focusNextGridCoreContainer(t,i=!1){return!i&&this.gridCtrl.focusNextInnerContainer(t)?!0:((i||!t&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(t),!1)}focusAdvancedFilter(t){var i;return this.advancedFilterFocusColumn=t==null?void 0:t.column,((i=this.advancedFilterService)==null?void 0:i.getCtrl().focusHeaderComp())??!1}focusNextFromAdvancedFilter(t,i){var n;const s=(i?void 0:this.advancedFilterFocusColumn)??((n=this.visibleColsService.getAllCols())==null?void 0:n[0]);return t?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(t){this.gridCtrl.addFocusableContainer(t)}removeFocusableContainer(t){this.gridCtrl.removeFocusableContainer(t)}focusGridInnerElement(t){return this.gridCtrl.focusInnerElement(t)}allowFocusForNextGridCoreContainer(t){this.gridCtrl.allowFocusForNextCoreContainer(t)}};Lu.keyboardModeActive=!1,Lu.instanceCount=0;var hP=Lu,pP=class extends G{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=Ft(this.gos,"print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},gP=class extends G{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.beans.context.getGridId());const{dragAndDropService:s,mouseEventService:n,ctrlsService:o,resizeObserverService:r}=this.beans,a={getContainer:()=>this.eGui,isInterestedIn:h=>h===1||h===0,getIconName:()=>"notAllowed"};s.addDropTarget(a),this.addDestroyFunc(()=>s.removeDropTarget(a)),n.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new Tu(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),this.updateGridThemeClass(),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)});const d=r.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>d()),o.register("gridCtrl",this)}isDetailGrid(){var t;const e=this.focusService.findTabbableParent(this.getGui());return((t=e==null?void 0:e.getAttribute("row-id"))==null?void 0:t.startsWith("detail"))||!1}getOptionalSelectors(){var t,i,s,n,o;const e=this.beans;return{paginationSelector:(t=e.paginationService)==null?void 0:t.getPaginationSelector(),gridHeaderDropZonesSelector:(i=e.columnDropZonesService)==null?void 0:i.getDropZoneSelector(),sideBarSelector:(s=e.sideBarService)==null?void 0:s.getSideBarSelector(),statusBarSelector:(n=e.statusBarService)==null?void 0:n.getStatusPanelSelector(),watermarkSelector:(o=e.licenseManager)==null?void 0:o.getWatermarkSelector()}}onGridSizeChanged(){this.eventService.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:i,nextIndex:s}=this.getNextFocusableIndex(t,e);if(s<0||s>=t.length)return!1;if(s===0){if(i>0){const n=this.visibleColsService.getAllCols(),o=he(n);if(this.focusService.focusGridView(o,!0))return!0}return!1}return this.focusContainer(t[s],e)}focusInnerElement(e){const t=this.gos.getCallback("focusGridInnerElement");if(t&&t({fromBottom:!!e}))return!0;const i=this.getFocusableContainers(),s=this.visibleColsService.getAllCols();if(e){if(i.length>1)return this.focusContainer(he(i),!0);const n=he(s);if(this.focusService.focusGridView(n,!0))return!0}if(this.gos.get("headerHeight")===0||this.focusService.isHeaderFocusSuppressed()){if(this.focusService.focusGridView(s[0]))return!0;for(let n=1;n<i.length;n++)if(this.focusService.focusInto(i[n].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){var o;const t=this.view.getFocusableContainers(),{nextIndex:i,indexWithFocus:s}=this.getNextFocusableIndex(t,e);if(s===-1||i<0||i>=t.length)return;const n=t[i];(o=n.setAllowFocus)==null||o.call(n,!0),setTimeout(()=>{var r;(r=n.setAllowFocus)==null||r.call(n,!1)})}getNextFocusableIndex(e,t){const i=Je(this.gos),s=e.findIndex(o=>o.getGui().contains(i)),n=s+(t?-1:1);return{indexWithFocus:s,nextIndex:n}}focusContainer(e,t){var s,n;(s=e.setAllowFocus)==null||s.call(e,!0);const i=this.focusService.focusInto(e.getGui(),t);return(n=e.setAllowFocus)==null||n.call(e,!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}updateGridThemeClass(){const e=this.beans.environment.getGridThemeClass();e&&this.view.setGridThemeClass(e)}handleThemeChange(e){e.themeChanged&&this.updateGridThemeClass()}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},fP=class extends Cm{constructor(e){super(),this.gridBody=ee,this.sideBar=ee,this.pagination=ee,this.rootWrapperBody=ee,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:o=>this.addCssClass(o),setGridThemeClass:o=>this.addCssClass(o),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:o=>{this.getGui().style.userSelect=o??"",this.getGui().style.webkitUserSelect=o??""},setCursor:o=>{this.getGui().style.cursor=o??""}},t=this.createManagedBean(new gP),i=t.getOptionalSelectors(),s=this.createTemplate(i),n=[_x,...Object.values(i).filter(o=>!!o)];this.setTemplate(s,n),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:o=>t.focusInnerElement(o),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&Fi("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",n=e.watermarkSelector?"<ag-watermark></ag-watermark>":"",o=e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':"";return`<div class="ag-root-wrapper" role="presentation">
157
- ${t}
158
- <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation">
159
- <ag-grid-body data-ref="gridBody"></ag-grid-body>
160
- ${i}
161
- </div>
162
- ${s}
163
- ${o}
164
- ${n}
165
- </div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){var t;if(!e&&((t=this.pagination)!=null&&t.isDisplayed())){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach(t=>{t&&e.push(t)}),e.filter(t=>di(t.getGui()))}},mP=class extends G{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrlsService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";typeof e=="function"&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map(n=>{var r;if(!n){We("alignedGrids contains an undefined option."),t||We(`You may want to configure via a callback to avoid setup race conditions:
166
- "alignedGrids: () => [linkedGrid]"`),We(i());return}if(this.isGridApi(n))return n;const o=n;return"current"in o?(r=o.current)==null?void 0:r.api:(o.api||We(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),o.api)}).filter(n=>!!n&&!n.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{t.isDestroyed()||t.dispatchEvent(e)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const i=[];return e.columns?e.columns.forEach(s=>{i.push(t(s))}):e.column&&i.push(t(e.column)),i}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":z("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){const{columnModel:t}=this;e.columnGroups.forEach(i=>{let s=null;i&&(s=t.getProvidedColGroup(i.getGroupId())),!(i&&!s)&&t.setColumnGroupOpened(s,i.isExpanded(),"alignedGridChanged")})}processColumnEvent(e){var h;const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e),{columnApplyStateService:n,columnSizeService:o,ctrlsService:r}=this;switch(e.type){case"columnMoved":{const f=e.api.getColumnState().map(m=>({colId:m.colId}));n.applyColumnState({state:f,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const f=e.api.getColumnState().map(m=>({colId:m.colId,hide:m.hide}));n.applyColumnState({state:f},"alignedGridChanged")}break;case"columnPinned":{const f=e.api.getColumnState().map(m=>({colId:m.colId,pinned:m.pinned}));n.applyColumnState({state:f},"alignedGridChanged")}break;case"columnResized":{const p=e,f={};s.forEach(m=>{f[m.getId()]={key:m.getColId(),newWidth:m.getActualWidth()}}),(h=p.flexColumns)==null||h.forEach(m=>{f[m.getId()]&&delete f[m.getId()]}),o.setColumnWidths(Object.values(f),!1,p.finished,"alignedGridChanged");break}}const d=r.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(p=>{p.setGridOption("alwaysShowVerticalScroll",d)})}},CP={version:Ce,moduleName:"@ag-grid-community/aligned-grid",beans:[mP]};function vP(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null}function wP(e){return e.columnModel.getColumnDefs()}function SP(e,t){typeof t=="number"?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)}function yP(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")}function bP(e,t,i){return e.visibleColsService.getColumnGroup(t,i)}function RP(e,t){return e.columnModel.getProvidedColGroup(t)}function FP(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""}function EP(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""}function xP(e,t){return e.columnModel.getColDefCol(t)}function PP(e){return e.columnModel.getColDefCols()}function DP(e,t){return e.columnApplyStateService.applyColumnState(t,"api")}function TP(e){return e.columnGetStateService.getColumnState()}function AP(e){e.columnApplyStateService.resetColumnState("api")}function MP(e){return e.columnGroupStateService.getColumnGroupState()}function kP(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")}function IP(e){e.columnGroupStateService.resetColumnGroupState("api")}function LP(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()}function _P(e){return e.visibleColsService.isPinningLeft()}function OP(e){return e.visibleColsService.isPinningRight()}function VP(e,t){return e.visibleColsService.getColAfter(t)}function NP(e,t){return e.visibleColsService.getColBefore(t)}function BP(e,t,i){e.columnModel.setColsVisible([t],i,"api")}function GP(e,t,i){e.columnModel.setColsVisible(t,i,"api")}function HP(e,t,i){e.columnModel.setColsPinned([t],i,"api")}function WP(e,t,i){e.columnModel.setColsPinned(t,i,"api")}function zP(e){return e.columnModel.getCols()}function UP(e){return e.visibleColsService.getLeftCols()}function $P(e){return e.visibleColsService.getCenterCols()}function KP(e){return e.visibleColsService.getRightCols()}function jP(e){return e.visibleColsService.getAllCols()}function ZP(e){return e.columnViewportService.getViewportColumns()}function qP(e,t,i){e.columnMoveService.moveColumns([t],i,"api")}function YP(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")}function QP(e,t,i){e.columnMoveService.moveColumns(t,i,"api")}function XP(e,t,i,s=!0,n="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,n)}function JP(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)}function eD(e){return e.visibleColsService.getTreeLeft()}function tD(e){return e.visibleColsService.getTreeCenter()}function iD(e){return e.visibleColsService.getTreeRight()}function sD(e){return e.visibleColsService.getAllTrees()}function nD(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})}function oD(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})}function rD(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}var lD=class extends G{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService,this.filterManager=e.filterManager}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Bn(e.source))})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=s=>n=>{const{column:o,node:r,value:a}=n;let d=o.getColDef().valueFormatter;return d===s.groupSafeValueFormatter&&(d=s.valueFormatter),this.valueService.formatValue(o,r,a,d)};Object.entries(e).forEach(([s,n])=>{const o={...n,groupSafeValueFormatter:this.createGroupSafeValueFormatter(n)};this.dataTypeDefinitions[s]=o,this.formatValueFuncs[s]=t(o)});const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,n])=>{const o=this.processDataTypeDefinition(n,i,[s],e);o&&(this.dataTypeDefinitions[s]=o,n.dataTypeMatcher&&(this.dataTypeMatchers[s]=n.dataTypeMatcher),this.formatValueFuncs[s]=t(o))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(s=>{const n=this.dataTypeMatchers[s];n&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=n??e[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...ha(e.columnTypes),...ha(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let n;const o=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let r=s[o];const a=t[o];if(r&&a&&(r=a),!this.validateDataTypeDefinition(e,r,o))return;n=this.mergeDataTypeDefinitions(r,e)}else{if(i.includes(o)){z('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const r=t[o];if(!this.validateDataTypeDefinition(e,r,o))return;const a=this.processDataTypeDefinition(r,t,[...i,o],s);if(!a)return;n=this.mergeDataTypeDefinitions(a,e)}return{...n,groupSafeValueFormatter:this.createGroupSafeValueFormatter(n)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(z('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(z(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if((i=t.node)!=null&&i.group){const n=(t.colDef.pivotValueColumn??t.column).getAggFunc();if(n){if(n==="first"||n==="last")return e.valueFormatter(t);if(e.baseDataType==="number"&&n!=="count"){if(typeof t.value=="number")return e.valueFormatter(t);if(typeof t.value=="object"){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}return}if((this.gos.get("suppressGroupMaintainValueType")||this.gos.get("groupDisplayType")==="groupRows")&&!this.gos.get("treeData"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()&&typeof t.value=="string"&&!((s=e.dataTypeMatcher)!=null&&s.call(e,t.value)))return;return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:n}=t;if(s===void 0&&(s=e.cellDataType),(s==null||s===!0)&&(s=this.canInferCellDataType(e,t)?this.inferCellDataType(n,i):!1),!s){e.cellDataType=!1;return}const o=this.dataTypeDefinitions[s];if(!o){z(`Missing data type definition - "${s}"`);return}return e.cellDataType=s,o.groupSafeValueFormatter&&(e.valueFormatter=o.groupSafeValueFormatter),o.valueParser&&(e.valueParser=o.valueParser),o.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,o,i),o.columnTypes}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener("columnStateUpdated",i))}canInferCellDataType(e,t){if(!st(this.gos))return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=t.type===null?e.type:t.type;if(s){const n=this.gos.get("columnTypes")??{};if(ha(s).some(r=>{const a=n[r.trim()];return a&&this.doColDefPropsPreventInference(a,i)}))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const n=e[i];return n===null?(t[i]=!1,!1):s===void 0?!!n:n===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const o=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=Fr(s,e,o)}else this.initWaitForRowData(t);if(i==null)return;const[n]=Object.entries(this.dataTypeMatchers).find(([o,r])=>r(i))??["object"];return n}getInitialData(){const e=this.gos.get("rowData");if(e!=null&&e.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t!=null&&t.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:s=>{const{firstRowData:n}=s;n&&(i==null||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations(),this.eventService.dispatchEvent({type:"dataTypesInferred"}))}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},n={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([o,r])=>{const a=this.columnModel.getCol(o);if(!a)return;const d=a.getColDef();if(!this.columnModel.resetColDefIntoCol(a,"cellDataTypeInferred"))return;const h=a.getColDef();if(t&&h.type&&h.type!==d.type){const p=this.getUpdatedColumnState(a,r);p.rowGroup&&p.rowGroupIndex==null&&(s[o]=p),p.pivot&&p.pivotIndex==null&&(n[o]=p),i.push(p)}}),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,n)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach(s=>{delete i[s],s==="rowGroup"?delete i.rowGroupIndex:s==="pivot"&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return(t=this.getDataTypeDefinition(e))==null?void 0:t.baseDataType}checkType(e,t){var s;if(t==null)return!0;const i=(s=this.getDataTypeDefinition(e))==null?void 0:s.dataTypeMatcher;return i?i(t):!0}validateColDef(e){const t=i=>z(`Cell data type is "object" but no Value ${i} has been provided. Please either provide an object data type definition with a Value ${i}, or set "colDef.value${i}"`);e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&t("Formatter"),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&t("Parser"))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){var o;const n=this.formatValueFuncs[t];switch(i.baseDataType){case"number":{e.cellEditor="agNumberCellEditor";break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=r=>!!r.colDef.editable&&r.event.key===B.SPACE;break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=n;break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=n;break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(r,a)=>{const d=this.columnModel.getColDefCol(s),h=d==null?void 0:d.getColDef();if(!d||!h)return 0;const p=r==null?"":n({column:d,node:null,value:r}),f=a==null?"":n({column:d,node:null,value:a});return p===f?0:p>f?1:-1},e.keyCreator=n;break}}(o=this.filterManager)==null||o.setColDefPropertiesForDataType(e,i,n)}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>{var s,n;return((n=(s=i.newValue)==null?void 0:s.trim)==null?void 0:n.call(s))===""?null:Number(i.newValue)},valueFormatter:i=>i.value==null?"":typeof i.value!="number"||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>typeof i=="number"},text:{baseDataType:"text",valueParser:i=>i.newValue===""?null:ea(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>{var s,n;return i.newValue==null?i.newValue:((n=(s=i.newValue)==null?void 0:s.trim)==null?void 0:n.call(s))===""?null:String(i.newValue).toLowerCase()==="true"},valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>ii(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):Di(i.value,!1)??"",dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>ii(i)??void 0,dateFormatter:i=>Di(i??null,!1)??void 0,valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>typeof i=="string"&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>ea(i.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},aD={version:Ce,moduleName:"@ag-grid-community/data-type",beans:[lD]},cD={version:Ce,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef:vP,getColumnDefs:wP,sizeColumnsToFit:SP,setColumnGroupOpened:yP,getColumnGroup:bP,getProvidedColumnGroup:RP,getDisplayNameForColumn:FP,getDisplayNameForColumnGroup:EP,getColumn:xP,getColumns:PP,applyColumnState:DP,getColumnState:TP,resetColumnState:AP,getColumnGroupState:MP,setColumnGroupState:kP,resetColumnGroupState:IP,isPinning:LP,isPinningLeft:_P,isPinningRight:OP,getDisplayedColAfter:VP,getDisplayedColBefore:NP,setColumnVisible:BP,setColumnsVisible:GP,setColumnPinned:HP,setColumnsPinned:WP,getAllGridColumns:zP,getDisplayedLeftColumns:UP,getDisplayedCenterColumns:$P,getDisplayedRightColumns:KP,getAllDisplayedColumns:jP,getAllDisplayedVirtualColumns:ZP,moveColumn:qP,moveColumnByIndex:YP,moveColumns:QP,setColumnWidth:XP,setColumnWidths:JP,getLeftDisplayedColumnGroups:eD,getCenterDisplayedColumnGroups:tD,getRightDisplayedColumnGroups:iD,getAllDisplayedColumnGroups:sD,autoSizeColumn:nD,autoSizeColumns:oD,autoSizeAllColumns:rD}};function dD(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)}function uD(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)}function hD(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}var pD={version:Ce,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone:dD,removeRowDropZone:uD,getRowDropZoneParams:hD}};function gD(e){return e.pinnedRowModel.getPinnedTopRowCount()}function fD(e){return e.pinnedRowModel.getPinnedBottomRowCount()}function mD(e,t){return e.pinnedRowModel.getPinnedTopRow(t)}function CD(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}var vD={version:Ce,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount:gD,getPinnedBottomRowCount:fD,getPinnedTopRow:mD,getPinnedBottomRow:CD}};function wD(e){e.overlayService.showLoadingOverlay()}function SD(e){e.overlayService.showNoRowsOverlay()}function yD(e){e.overlayService.hideOverlay()}var bD={version:Ce,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay:wD,showNoRowsOverlay:SD,hideOverlay:yD}};function RD(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),n=`aria-${t}`;i===null?s.removeAttribute(n):s.setAttribute(n,i)}function FD(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function ED(e,t={}){const i=s=>z(`Since v31.1 api.flashCells parameter '${s}Delay' is deprecated. Please use '${s}Duration' instead.`);q(t.fadeDelay)&&i("fade"),q(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.flashCells(t))}function xD(e){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}function PD(e){return e.animationFrameService.isQueueEmpty()}function DD(e){e.animationFrameService.flushAllFrames()}function TD(e){return{rowHeight:On(e.gos),headerHeight:e.columnModel.getHeaderHeight()}}function AD(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(kr)}var MD={version:Ce,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty:RD,refreshCells:FD,flashCells:ED,refreshHeader:xD,isAnimationFrameQueueEmpty:PD,flushAllAnimationFrames:DD,getSizesForCurrentTheme:TD,getCellRendererInstances:AD}};function kD(e){e.valueCache.expire()}function ID(e,t,i){return xm(e,{colKey:t,rowNode:i})}function xm(e,t){const{colKey:i,rowNode:s,useFormatter:n}=t,o=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(Ve(o))return null;const r=e.valueService.getValueForDisplay(o,s);return n?e.valueService.formatValue(o,s,r)??ps(r,!0):r}function LD(e){return e.context.getGridId()}function _D(e){e.gridDestroyService.destroy()}function OD(e){return e.gridDestroyService.isDestroyCalled()}function VD(e,t){return e.gos.get(t)}function ND(e,t,i){Pm(e,{[t]:i})}function Pm(e,t){e.gos.updateGridOptions({options:t})}function BD(e,t,i){e.apiEventService.addEventListener(t,i)}function GD(e,t,i){e.apiEventService.removeEventListener(t,i)}function HD(e,t){e.apiEventService.addGlobalListener(t)}function WD(e,t){e.apiEventService.removeGlobalListener(t)}function zD(e){return e.focusService.getFocusedCell()}function UD(e){return e.focusService.clearFocusedCell()}function $D(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})}function KD(e,t){return e.navigationService.tabToNextCell(!1,t)}function jD(e,t){return e.navigationService.tabToNextCell(!0,t)}function ZD(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})}function qD(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})}function YD(e,t,i){let s=e.columnModel.getCol(t);if(s||(s=e.columnModel.getColDefCol(t)),!s){We(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"})}function QD(e,t){const i=e.columnModel.getCol(t);if(!i){We(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:i,positionBy:"auto"})}function XD(e){e.menuService.hidePopupMenu()}function JD(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(i))}function eT(e,t,i,s,n){e.expansionService.setRowNodeExpanded(t,i,s,n)}function tT(e,t){return e.rowModel.getRowNode(t)}function iT(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)}function sT(e){return e.rowRenderer.getRenderedNodes()}function nT(e,t,i){e.rowModel.forEachNode(t,i)}function oT(e){return Dm(e)}function Dm(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function rT(e){return Tm(e)}function Tm(e){return e.rowRenderer.getLastVirtualRenderedRow()}function lT(e,t){return e.rowModel.getRow(t)}function aT(e){return e.rowModel.getRowCount()}function cT(e){return e.rowModel}function dT(e,t){if(!t.nodes.every(a=>a.rowPinned?(z("cannot select pinned rows"),!1):a.id===void 0?(z("cannot select node until id for node is known"),!1):!0))return;const{nodes:s,source:n,newValue:o}=t,r=s;e.selectionService.setNodesSelected({nodes:r,source:n??"api",newValue:o})}function uT(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})}function hT(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})}function pT(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})}function gT(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})}function fT(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})}function mT(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})}function CT(e){return e.selectionService.getSelectedNodes()}function vT(e){return e.selectionService.getSelectedRows()}function wT(e){e.sortController.onSortChanged("api")}var ST={version:Ce,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId:LD,destroy:_D,isDestroyed:OD,getGridOption:VD,setGridOption:ND,updateGridOptions:Pm}},yT={version:Ce,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected:dT,selectAll:uT,deselectAll:hT,selectAllFiltered:pT,deselectAllFiltered:gT,selectAllOnCurrentPage:fT,deselectAllOnCurrentPage:mT,getSelectedNodes:CT,getSelectedRows:vT}},bT={version:Ce,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows:JD,setRowNodeExpanded:eT,getRowNode:tT,addRenderedRowListener:iT,getRenderedNodes:sT,forEachNode:nT,getFirstDisplayedRow:oT,getFirstDisplayedRowIndex:Dm,getLastDisplayedRow:rT,getLastDisplayedRowIndex:Tm,getDisplayedRowAtIndex:lT,getDisplayedRowCount:aT,getModel:cT}},RT={version:Ce,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange:l0,getHorizontalPixelRange:a0,ensureColumnVisible:pm,ensureIndexVisible:gm,ensureNodeVisible:c0}},FT={version:Ce,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell:zD,clearFocusedCell:UD,setFocusedCell:$D,setFocusedHeader:ZD,tabToNextCell:KD,tabToPreviousCell:jD}},ET={version:Ce,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener:BD,addGlobalListener:HD,removeEventListener:GD,removeGlobalListener:WD}},xT={version:Ce,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache:kD,getValue:ID,getCellValue:xm}},PT={version:Ce,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick:qD,showColumnMenuAfterMouseClick:YD,showColumnMenu:QD,hidePopupMenu:XD}},DT={version:Ce,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged:wT}},TT={version:Ce,moduleName:"@ag-grid-community/api",dependantModules:[ST,vD,yT,cD,bT,pD,RT,bD,FT,ET,MD,xT,PT,DT]};function AT(e){var t;return((t=e.stateService)==null?void 0:t.getState())??{}}function MT(e){switch(e.version||(e.version="32.1.0"),e.version){case"32.1.0":e=kT(e)}return e}function kT(e){return e.cellSelection=IT(e,"rangeSelection"),e}function IT(e,t){if(e&&typeof e=="object")return e[t]}var LT=class extends G{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Wt(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Wt(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Wt(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel=st(this.gos),this.cachedState=this.getInitialState(),this.ctrlsService.whenReady(this,()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:s})=>{s==="gridInitializing"&&(e(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))},rowCountReady:()=>{t==null||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())},firstDataRendered:()=>{i==null||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())}})}getInitialState(){return MT(this.gos.get("initialState")??{})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.getInitialState();this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState());const t=i=>()=>this.updateColumnState([i]);this.addManagedEventListeners({columnValueChanged:t("aggregation"),columnMoved:t("columnOrder"),columnPinned:t("columnPinning"),columnResized:t("columnSizing"),columnVisible:t("columnVisibility"),columnPivotChanged:t("pivot"),columnPivotModeChanged:t("pivot"),columnRowGroupChanged:t("rowGroup"),sortChanged:t("sort"),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.getInitialState(),n=this.gos.get("advancedFilterModel");(e||n)&&this.setFilterState(e,n),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState());const o=()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState());this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:o,columnRowGroupChanged:o,rowDataUpdated:()=>{this.gos.get("groupDefaultExpanded")!==0&&setTimeout(()=>{o()})},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,cellSelection:t,focusedCell:i,columnOrder:s}=this.getInitialState();i&&this.setFocusedCellState(i),t&&this.setCellSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!(s!=null&&s.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState());const n=this.getRangeSelectionState();this.updateCachedState("rangeSelection",n),this.updateCachedState("cellSelection",n),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),cellSelectionChanged:o=>{if(o.finished){const r=this.getRangeSelectionState();this.updateCachedState("rangeSelection",r),this.updateCachedState("cellSelection",r)}},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],n=[],o=[],r=[],a=[],d=[],h=[];let p=0;const f=this.columnGetStateService.getColumnState();for(let m=0;m<f.length;m++){const{colId:v,sort:w,sortIndex:S,rowGroup:b,rowGroupIndex:R,aggFunc:x,pivot:T,pivotIndex:I,pinned:V,hide:L,width:A,flex:k}=f[m];h.push(v),w&&(t[S??p++]={colId:v,sort:w}),b&&(i[R??0]=v),typeof x=="string"&&s.push({colId:v,aggFunc:x}),T&&(n[I??0]=v),V&&(V==="right"?r:o).push(v),L&&a.push(v),(k||A)&&d.push({colId:v,flex:k??void 0,width:A})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:n.length||e?{pivotMode:e,pivotColIds:n}:void 0,columnPinning:o.length||r.length?{leftColIds:o,rightColIds:r}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:d.length?{columnSizingModel:d}:void 0,columnOrder:h.length?{orderedColIds:h}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:n,columnPinning:o,columnVisibility:r,columnSizing:a,columnOrder:d,partialColumnState:h}=e,p={},f=b=>{let R=p[b];return R||(R={colId:b},p[b]=R,R)},m=h?{}:{sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};t&&(t.sortModel.forEach(({colId:b,sort:R},x)=>{const T=f(b);T.sort=R,T.sortIndex=x}),m.sort=null,m.sortIndex=null),i&&(i.groupColIds.forEach((b,R)=>{const x=f(b);x.rowGroup=!0,x.rowGroupIndex=R}),m.rowGroup=null,m.rowGroupIndex=null),s&&(s.aggregationModel.forEach(({colId:b,aggFunc:R})=>{f(b).aggFunc=R}),m.aggFunc=null),n&&(n.pivotColIds.forEach((b,R)=>{const x=f(b);x.pivot=!0,x.pivotIndex=R}),this.gos.updateGridOptions({options:{pivotMode:n.pivotMode},source:"gridInitializing"}),m.pivot=null,m.pivotIndex=null),o&&(o.leftColIds.forEach(b=>{f(b).pinned="left"}),o.rightColIds.forEach(b=>{f(b).pinned="right"}),m.pinned=null),r&&(r.hiddenColIds.forEach(b=>{f(b).hide=!0}),m.hide=null),a&&(a.columnSizingModel.forEach(({colId:b,flex:R,width:x})=>{const T=f(b);T.flex=R??null,T.width=x}),m.flex=null);const v=d==null?void 0:d.orderedColIds,w=!!(v!=null&&v.length),S=w?v.map(b=>f(b)):Object.values(p);S.length&&(this.columnStates=S,this.columnApplyStateService.applyColumnState({state:S,applyOrder:w,defaultState:m},"gridInitializing"))}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.pivotResultColsService.isPivotResultColsPresent()){if(t){const s=[];for(const n of t)this.pivotResultColsService.getPivotResultCol(n.colId)&&s.push(n);this.columnApplyStateService.applyColumnState({state:s,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:s})=>{s&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var n;if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set((n=e.columnGroup)==null?void 0:n.openColumnGroupIds),s=this.columnGroupStateService.getColumnGroupState().map(({groupId:o})=>{const r=t.has(o);return r&&t.delete(o),{groupId:o,open:r}});t.forEach(o=>{s.push({groupId:o,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnGroupStateService.setColumnGroupState(s,"gridInitializing")}getFilterState(){var i,s;let e=(i=this.filterManager)==null?void 0:i.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const t=((s=this.filterManager)==null?void 0:s.getAdvancedFilterModel())??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){var n,o;const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&((n=this.filterManager)==null||n.setFilterModel(i,"columnFilter")),s&&((o=this.filterManager)==null||o.setAdvancedFilterModel(s))}getRangeSelectionState(){var t;const e=(t=this.rangeService)==null?void 0:t.getCellRanges().map(i=>{const{id:s,type:n,startRow:o,endRow:r,columns:a,startColumn:d}=i;return{id:s,type:n,startRow:o,endRow:r,colIds:a.map(h=>h.getColId()),startColId:d.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeService:i,columnModel:s,visibleColsService:n}=this;if(!ei(t)||!i)return;const o=[];if(e.cellRanges.forEach(r=>{const a=[];if(r.colIds.forEach(h=>{const p=s.getCol(h);p&&a.push(p)}),!a.length)return;let d=s.getCol(r.startColId);if(!d){const h=n.getAllCols(),p=new Set(a);d=h.find(f=>p.has(f))}o.push({...r,columns:a,startColumn:d})}),Tg(t)&&Rr(t)&&o.length>1)return z("cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`");i.setCellRanges(o)}getScrollState(){var s;if(!this.isClientSideRowModel)return;const e=(s=this.ctrlsService.getGridBodyCtrl())==null?void 0:s.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:i}=(e==null?void 0:e.getVScrollPosition())??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){var s;if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;(s=this.ctrlsService.getGridBodyCtrl())==null||s.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){var e,t;return(t=(e=this.sideBarService)==null?void 0:e.getSideBarComp())==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();if(!(!e&&!t))return{page:e,pageSize:t}}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),typeof e.page=="number"&&this.paginationService.setPage(e.page))}getRowSelectionState(){var i;const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!((i=e==null?void 0:e.toggledNodes)!=null&&i.length)?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([s,n])=>{Sr(n,this.cachedState[s])||(i=!0)}),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),Sr(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach(e=>{switch(e){case"rowSelection":this.setCachedStateValue(e,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear(),this.eventService.dispatchEvent({type:"stateUpdated",sources:e,state:this.cachedState})}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}},Am={version:Ce,moduleName:"@ag-grid-community/state-core",beans:[LT]},_T={version:Ce,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState:AT},dependantModules:[Am]},OT={version:Ce,moduleName:"@ag-grid-community/state",dependantModules:[Am,_T]};function VT(e){return e.rowModel.isLastRowIndexKnown()}function NT(e){var t;return((t=e.paginationService)==null?void 0:t.getPageSize())??100}function BT(e){var t;return((t=e.paginationService)==null?void 0:t.getCurrentPage())??0}function GT(e){var t;return((t=e.paginationService)==null?void 0:t.getTotalPages())??1}function HT(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()}function WT(e){var t;(t=e.paginationService)==null||t.goToNextPage()}function zT(e){var t;(t=e.paginationService)==null||t.goToPreviousPage()}function UT(e){var t;(t=e.paginationService)==null||t.goToFirstPage()}function $T(e){var t;(t=e.paginationService)==null||t.goToLastPage()}function KT(e,t){var i;(i=e.paginationService)==null||i.goToPage(t)}var jT=class extends G{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=Math.max(On(this.gos),1),s=Math.floor(e/i);this.paginationService.setPageSize(s,"autoCalculated")};this.isBodyRendered?Wt(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function ZT(e,t,i){e.addManagedElementListeners(t,{keydown:s=>{if(!s.defaultPrevented&&s.key===B.TAB){const n=s.shiftKey;i.findNextFocusableElement(t,!1,n)||i.focusNextGridCoreContainer(n)&&s.preventDefault()}}})}var Gr="paginationPageSizeSelector",qT=class extends ke{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener(Gr,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Lt(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Gr)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);if(i){const n=this.gos.exists("paginationPageSize"),o=this.gos.get(Gr)!==!0;z(`'paginationPageSize=${t}'${n?"":" (default value)"}, but ${t} is not included in${o?"":" the default"} paginationPageSizeSelector=[${e.join(", ")}].`),o||z(`Either set '${Gr}' to an array that includes ${t} or to 'false' to disable the page size selector.`),e.unshift("")}const s=String(i?"":t);this.selectPageSizeComp?(hs(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=i}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const i=this.localeService.getLocaleTextFunc(),s=i("pageSizeSelectorLabel","Page Size:"),n=i("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new pu).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(n).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Gr);return!Array.isArray(t)||Tt(t)?e:[...t].sort((i,s)=>i-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},YT={selector:"AG-PAGE-SIZE-SELECTOR",component:qT},QT=class extends Cm{constructor(){super(),this.btFirst=ee,this.btPrevious=ee,this.btNext=ee,this.btLast=ee,this.lbRecordCount=ee,this.lbFirstRowOnPage=ee,this.lbLastRowOnPage=ee,this.lbCurrent=ee,this.lbTotal=ee,this.pageSizeComp=ee,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.focusService=e.focusService,this.ariaAnnouncementService=e.ariaAnnouncementService}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[YT]);const{btFirst:t,btPrevious:i,btNext:s,btLast:n}=this;this.activateTabIndex([t,i,s,n]),t.insertAdjacentElement("afterbegin",_t(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",_t(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",_t(e?"previous":"next",this.gos)),n.insertAdjacentElement("afterbegin",_t(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:o=>{this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(o):this.focusService.focusGridInnerElement(o)},forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)}),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListeners(t,{click:i,keydown:s=>{(s.key===B.ENTER||s.key===B.SPACE)&&(s.preventDefault(),i())}})}),ZT(this,this.getGui(),this.focusService),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationService.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc(),s=i("thousandSeparator",","),n=i("decimalSeparator",".");return CF(e,s,n)}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),n=e("firstPage","First Page"),o=e("previousPage","Previous Page"),r=e("nextPage","Next Page"),a=e("lastPage","Last Page"),d=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${d}">
167
- <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector>
168
- <span class="ag-paging-row-summary-panel">
169
- <span id="ag-${d}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
170
- <span id="ag-${d}-to">${i}</span>
171
- <span id="ag-${d}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
172
- <span id="ag-${d}-of">${s}</span>
173
- <span id="ag-${d}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
174
- </span>
175
- <span class="ag-paging-page-summary-panel" role="presentation">
176
- <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>
177
- <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>
178
- <span class="ag-paging-description">
179
- <span id="ag-${d}-start-page">${t}</span>
180
- <span id="ag-${d}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span>
181
- <span id="ag-${d}-of-page">${s}</span>
182
- <span id="ag-${d}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span>
183
- </span>
184
- <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>
185
- <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>
186
- </span>
187
- </div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),n=e===i-1;this.nextButtonDisabled=n||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){kb(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=this.paginationService.getMasterRowCount(),s=e?i:null;if(s===1){const x=this.rowModel.getRow(0);if(x&&x.group&&!(x.groupData||x.aggData)){this.setTotalLabelsToZero();return}}const n=this.paginationService.getCurrentPage(),o=this.paginationService.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=o*n+1,a=r+o-1,e&&a>s&&(a=s));const d=r+o-1,h=!e&&i<d,p=this.formatNumber(r);this.lbFirstRowOnPage.textContent=p;let f;const m=this.localeService.getLocaleTextFunc();h?f=m("pageLastRowUnknown","?"):f=this.formatNumber(a),this.lbLastRowOnPage.textContent=f;const w=t>0?n+1:0,S=this.formatNumber(w);this.lbCurrent.textContent=S;let b,R;if(e)b=this.formatNumber(t),R=this.formatNumber(s);else{const x=m("more","more");b=x,R=x}this.lbTotal.textContent=b,this.lbRecordCount.textContent=R,this.announceAriaStatus(p,f,R,S,b)}announceAriaStatus(e,t,i,s,n){const o=this.localeService.getLocaleTextFunc(),r=o("page","Page"),a=o("to","to"),d=o("of","of"),h=`${e} ${a} ${t} ${d} ${i}`,p=`${r} ${s} ${d} ${n}`;h!==this.ariaRowStatus&&(this.ariaRowStatus=h,this.ariaAnnouncementService.announceValue(h,"paginationRow")),p!==this.ariaPageStatus&&(this.ariaPageStatus=p,this.ariaAnnouncementService.announceValue(p,"paginationPage"))}setTotalLabelsToZero(){const e=this.formatNumber(0);this.lbFirstRowOnPage.textContent=e,this.lbCurrent.textContent=e,this.lbLastRowOnPage.textContent=e,this.lbTotal.textContent=e,this.lbRecordCount.textContent=e,this.announceAriaStatus(e,e,e,e,e)}},XT={selector:"AG-PAGINATION",component:QT},JT=class extends G{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return XT}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){!this.active||this.currentPage===e||typeof this.currentPage!="number"||(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return q(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:q(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:q(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:q(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e;this.eventService.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t})}},Mm={version:Ce,moduleName:"@ag-grid-community/pagination-core",beans:[JT,jT]},eA={version:Ce,moduleName:"@ag-grid-community/pagination-api",dependantModules:[Mm],apiFunctions:{paginationIsLastPageFound:VT,paginationGetPageSize:NT,paginationGetCurrentPage:BT,paginationGetTotalPages:GT,paginationGetRowCount:HT,paginationGoToNextPage:WT,paginationGoToPreviousPage:zT,paginationGoToFirstPage:UT,paginationGoToLastPage:$T,paginationGoToPage:KT}},tA={version:Ce,moduleName:"@ag-grid-community/pagination",dependantModules:[Mm,eA]},si="clientSide",Kt="serverSide",Lo="infinite",iA={onGroupExpandedOrCollapsed:[si],refreshClientSideRowModel:[si],isRowDataEmpty:[si],forEachLeafNode:[si],forEachNodeAfterFilter:[si],forEachNodeAfterFilterAndSort:[si],resetRowHeights:[si],applyTransaction:[si],applyTransactionAsync:[si],flushAsyncTransactions:[si],getBestCostNodeSelection:[si],getServerSideSelectionState:[Kt],setServerSideSelectionState:[Kt],applyServerSideTransaction:[Kt],applyServerSideTransactionAsync:[Kt],applyServerSideRowData:[Kt],retryServerSideLoads:[Kt],flushServerSideAsyncTransactions:[Kt],refreshServerSide:[Kt],getServerSideGroupLevelState:[Kt],refreshInfiniteCache:[Lo],purgeInfiniteCache:[Lo],getInfiniteRowCount:[Lo],isLastRowIndexKnown:[Lo,Kt],expandAll:[si,Kt],collapseAll:[si,Kt],onRowHeightChanged:[si,Kt],setRowCount:[Lo,Kt],getCacheBlockState:[Lo,Kt]},sA={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"}};function nA(e,t,i){const s=sA[e];if(s){const{version:o,new:r,old:a,message:d}=s,h=a??e;return(...p)=>{const f=r?`Please use ${r} instead. `:"";return z(`Since ${o} api.${h} is deprecated. ${f}${d??""}`),t.apply(t,p)}}const n=iA[e];return n?(...o)=>{const r=i.rowModel.getType();if(!n.includes(r)){We(`api.${e} can only be called when gridOptions.rowModelType is ${n.join(" or ")}`);return}return t.apply(t,o)}:t}var oA={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."}},nn=(e,t)=>(t.rowModelType??"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null,rA={enableRowGroup:nn,rowGroup:nn,rowGroupIndex:nn,enablePivot:nn,enableValue:nn,pivot:nn,pivotIndex:nn,aggFunc:nn,cellEditor:e=>e.cellEditor==="agRichSelect"||e.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var i;const t=["columnsMenuTab","generalMenuTab"];return(i=e.menuTabs)!=null&&i.some(s=>t.includes(s))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>_o},lA={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0},aA=Object.keys(lA),_o={objectName:"colDef",allProperties:aA,docsUrl:"column-properties/",deprecations:oA,validations:rA},cA=()=>({advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."}}),dA={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1},uA=()=>({sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",validate:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],validate:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":return e.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},paginationPageSizeSelector:{validate:e=>{const t=e.paginationPageSizeSelector;return typeof t=="boolean"||t==null||t.length?null:`'paginationPageSizeSelector' cannot be an empty array.
188
- If you want to hide the page size selector, set paginationPageSizeSelector to false.`}},rowSelection:{validate({rowSelection:e}){return e&&typeof e=="string"?'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.':null}},cellSelection:{module:"@ag-grid-enterprise/range-selection"},columnDefs:()=>_o,defaultColDef:()=>_o,defaultColGroupDef:()=>_o,autoGroupColumnDef:()=>_o,selectionColumnDef:()=>_o}),hA=()=>({objectName:"gridOptions",allProperties:[...Er.ALL_PROPERTIES,...Hi.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:cA(),validations:uA()}),pA=class extends G{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,hA())}validateApiFunction(e,t){return nA(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:n,propertyExceptions:o,objectName:r,docsUrl:a}=t;n&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...o??[],...Object.keys(s)],n,r,a);const d=new Set;Object.keys(e).forEach(p=>{const f=s[p];if(f)if("renamed"in f){const{renamed:T,version:I}=f;d.add(`As of v${I}, ${String(p)} is deprecated. Please use ${String(T)} instead.`),e[T]=e[p]}else{const{message:T,version:I}=f;d.add(`As of v${I}, ${String(p)} is deprecated. ${T??""}`)}const m=e[p];if(m==null||m===!1)return;const v=i[p];let w;if(v)if(typeof v=="function"){const T=v(e,this.gridOptions);if(!T)return;if("objectName"in T){const I=e[p];if(Array.isArray(I)){I.forEach(V=>{this.processOptions(V,T)});return}this.processOptions(e[p],T);return}w=T}else w=v;else return;const{module:S,dependencies:b,validate:R,supportedRowModels:x}=w;if(x){const T=this.gridOptions.rowModelType??"clientSide";if(!x.includes(T)){d.add(`${String(p)} is not supported with the '${T}' row model.`);return}}if(S){const T=Array.isArray(S)?S:[S];let I=!0;if(T.forEach(V=>{this.gos.assertModuleRegistered(V,String(p))||(I=!1,d.add(`${String(p)} is only available when ${V} is loaded.`))}),!I)return}if(b){const T=this.checkForRequiredDependencies(p,b,e);if(T){d.add(T);return}}if(R){const T=R(e,this.gridOptions);if(T){d.add(T);return}}}),d.size>0&&d.forEach(p=>{z(p)})}checkForRequiredDependencies(e,t,i){const n=Object.entries(t).find(([a,d])=>{const h=i[a];return!d.includes(h)});if(!n)return null;const[o,r]=n;return r.length>1?`'${String(e)}' requires '${o}' to be one of [${r.join(", ")}].`:`'${String(e)}' requires '${o}' to be ${r[0]}.`}checkProperties(e,t,i,s,n){const o=["__ob__","__v_skip","__metadata__"],r=yR(Object.getOwnPropertyNames(e),[...o,...t,...i],i);if(Ei(r,(a,d)=>{let h=`invalid ${s} property '${a}' did you mean any of these: ${d.slice(0,8).join(", ")}.`;i.includes("context")&&(h+=`
189
- If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),z(h)}),Object.keys(r).length>0&&n){const a=this.getFrameworkOverrides().getDocLink(n);z(`to see all the valid ${s} properties please check: ${a}`)}}},gA={version:Ce,moduleName:"@ag-grid-community/core"},fA={version:Ce,moduleName:"@ag-grid-community/core-validations",beans:[pA]},mA={version:Ce,moduleName:"@ag-grid-community/core-community-features",dependantModules:[gA,fA,P0,tE,OT,aD,CP,tA,TT]},CA=class extends G{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){var e,t;this.destroyCalled||(this.eventService.dispatchEvent({type:"gridPreDestroyed",state:((e=this.beans.stateService)==null?void 0:e.getState())??{}}),this.destroyCalled=!0,(t=this.beans.ctrlsService.get("gridCtrl"))==null||t.destroyGridUi(),this.beans.context.destroy(),super.destroy())}isDestroyCalled(){return this.destroyCalled}},Hr=new Set(["gridPreDestroyed","fillStart","pasteStart"]),vA=e=>e==="checkboxSelected"||e==="rowClicked"||e==="spaceKey"||e==="uiSelectAll"||e==="uiSelectAllCurrentPage"||e==="uiSelectAllFiltered",wA=new Map([...Er.BOOLEAN_PROPERTIES.map(e=>[e,Ed]),...Er.NUMBER_PROPERTIES.map(e=>[e,Vf]),["groupAggFiltering",e=>typeof e=="function"?e:Ed(e)],["pageSize",ms(1)],["autoSizePadding",ms(0)],["keepDetailRowsCount",ms(1)],["rowBuffer",ms(0)],["infiniteInitialRowCount",ms(1)],["cacheOverflowSize",ms(1)],["cacheBlockSize",ms(1)],["serverSideInitialRowCount",ms(1)],["viewportRowModelPageSize",ms(1)],["viewportRowModelBufferSize",ms(0)]]);function km(e,t){const i=wA.get(e);return i?i(t):t}function SA(e){const t={};return Object.entries(e).forEach(([i,s])=>{const n=km(i,s);t[i]=n}),t}var Im=class Sy extends G{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new So,this.globalEventHandlerFactory=t=>(i,s)=>{if(!this.isAlive())return;const n=Hr.has(i);if(n&&!t||!n&&t)return;const o=Hi.getCallbackForEvent(i),r=this.gridOptions[o];typeof r=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{r(s)})}}wireBeans(t){this.gridOptions=t.gridOptions,this.eGridDiv=t.eGridDiv,this.validationService=t.validationService,this.environment=t.environment,this.api=t.gridApi,this.gridId=t.context.getGridId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const t=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),t),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:i})=>{this.updateGridOptions({options:i,force:!0,source:"gridOptionsUpdated"})}})}get(t){return this.gridOptions[t]??dA[t]}getCallback(t){return this.mergeGridCommonParams(this.gridOptions[t])}exists(t){return q(this.gridOptions[t])}mergeGridCommonParams(t){return t&&(s=>{const n=s;return n.api=this.api,n.context=this.gridOptionsContext,t(n)})}updateGridOptions({options:t,force:i,source:s="api"}){var r;const n={id:Sy.changeSetId++,properties:[]},o=[];Object.entries(t).forEach(([a,d])=>{s==="api"&&Eb[a]&&z(`${a} is an initial property and cannot be updated.`);const h=km(a,d),p=i||typeof h=="object"&&s==="api",f=this.gridOptions[a];if(p||f!==h){this.gridOptions[a]=h;const m={type:a,currentValue:h,previousValue:f,changeSet:n,source:s};o.push(m)}}),(r=this.validationService)==null||r.processGridOptions(this.gridOptions),n.properties=o.map(a=>a.type),o.forEach(a=>{this.gridOptions.debug&&Fi(`Updated property ${a.type} from`,a.previousValue," to ",a.currentValue),this.propertyEventService.dispatchEvent(a)})}addPropertyEventListener(t,i){this.propertyEventService.addEventListener(t,i)}removePropertyEventListener(t,i){this.propertyEventService.removeEventListener(t,i)}getDomDataKey(){return this.domDataKey}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(t){const i=t;return i.api=this.api,i.context=this.gridOptionsContext,i}assertModuleRegistered(t,i){return Is.__assertRegistered(t,i,this.gridId)}isModuleRegistered(t){return Is.__isRegistered(t,this.gridId)}};Im.changeSetId=0;var yA=Im,bA=class extends G{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if(mt(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:n}=e;if(this.getHeaderRowType(n)!=="filter"){const a=[i];for(;i.getParent();)i=i.getParent(),a.push(i);i=a[a.length-1-n]}const{column:o,headerRowIndex:r}=this.getHeaderIndexToFocus(i,n);return{column:o,headerRowIndex:r}}getHeaderIndexToFocus(e,t){let i;if(mt(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let n=i;for(;n!==s;)t++,n=n.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i==="filter",n=i==="column";let o=s?e:e.getParent(),r=t-1,a=r;if(n&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;o&&o.isPadding();)o=o.getParent(),r--;a=r,r<0&&(o=e,r=t,a=void 0)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:a}}getColumnVisibleChild(e,t,i="After"){const s=this.getHeaderRowType(t);let n=e,o=t+1;const r=o;if(s==="group"){const a=e.getDisplayedLeafColumns(),d=i==="After"?a[0]:he(a),h=[];let p=d;for(;p.getParent()!==e;)p=p.getParent(),h.push(p);if(n=d,d.isSpanHeaderHeight())for(let f=h.length-1;f>=0;f--){const m=h[f];if(!m.isPadding()){n=m;break}o++}else n=he(h),n||(n=d)}return{column:n,headerRowIndex:o,headerRowIndexWithoutSpan:r}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i[t==="start"?0:i.length-1];if(!s)return;const n=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()),o=n==null?void 0:n.getRowType(e);if(o=="group"){const r=this.visibleColsService.getColGroupAtLevel(s,e);return{headerRowIndex:e,column:r}}return{headerRowIndex:o==null?-1:e,column:s}}},RA=class extends G{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(i,s,n)=>e({key:i,defaultValue:s,variableValues:n});const t=this.gos.get("localeText");return(i,s,n)=>{let o=t&&t[i];if(o&&n&&n.length){let r=0;for(;!(r>=n.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",n[r++])}return o??s}}},FA=class extends G{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new Vd(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=sa(this.gos)&&!Hr.has(e),n=s?this.asyncEventListeners:this.syncEventListeners;n.has(e)||n.set(e,new Set),n.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var o;const i=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),n=!!(s!=null&&s.delete(i));n||(o=this.syncEventListeners.get(e))==null||o.delete(i),this.eventService.removeEventListener(e,i,n)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(sa(this.gos)){const s=(o,r)=>{Hr.has(o)&&t(o,r)},n=(o,r)=>{Hr.has(o)||t(o,r)};this.globalEventListenerPairs.set(e,{syncListener:s,asyncListener:n}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(n,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:s,asyncListener:n}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(n,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((i,s)=>{i.forEach(n=>this.eventService.removeEventListener(s,n,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}},EA=class extends G{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages(),this.eventService.dispatchEvent({type:"paginationChanged",animate:(e==null?void 0:e.animate)??!1,newData:(e==null?void 0:e.newData)??!1,newPage:(e==null?void 0:e.newPage)??!1,newPageSize:(e==null?void 0:e.newPageSize)??!1,keepRenderedRows:(e==null?void 0:e.keepRenderedRows)??!1})}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},xA=class extends G{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return Ve(this.topRowBounds)||Ve(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const e=this.topRowBounds?this.topRowBounds.rowTop:0,t=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:e,pageLastPixel:t}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=q(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},PA=class extends G{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.updateAnnouncement=Wt(this.updateAnnouncement.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=lt(this.gos),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),qg(t,"polite"),Mb(t,"additions text"),Ab(t,!0),this.eGridDiv.appendChild(t)}announceValue(e,t){this.pendingAnnouncements.set(t,e),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;const e=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50)}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(Lt(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null,this.pendingAnnouncements.clear()}},DA=class extends G{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e,t){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){e(),t();return}const i=s=>{for(;s.length;){const n=s.pop();n&&n()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e(),i(this.executeNextFuncs)},0),window.setTimeout(()=>{t(),i(this.executeLaterFuncs)},200)})}},TA=class extends G{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}updateState(e){this.selectedColumns=e,this.eventService.dispatchEvent({type:"columnHoverChanged"})}},AA=class extends G{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0,this.wrapperPadding=0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}postConstruct(){this.isClientSide=st(this.gos);const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e,gridSizeChanged:this.onGridSizeChanged.bind(this),rowCountReady:()=>{this.showInitialOverlay=!1,this.updateOverlayVisibility()}}),this.addManagedPropertyListener("loading",e)}setOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}isVisible(){return this.state!==0&&!!this.overlayWrapperComp}isExclusive(){return this.state===1&&!!this.overlayWrapperComp}getOverlayWrapper(){return this.overlayWrapperComp}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");!e&&(e!==void 0||this.gos.get("suppressLoadingOverlay"))||this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,!(this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay"))&&this.doShowNoRowsOverlay()}hideOverlay(){if(this.showInitialOverlay=!1,this.gos.get("loading")){z("Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.");return}this.doHideOverlay()}updateOverlayVisibility(){if(!this.overlayWrapperComp){this.state=0;return}let e=this.gos.get("loading");this.showInitialOverlay&&e===void 0&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.isClientSide),e?this.state!==1&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.isClientSide?this.state!==2&&this.doShowNoRowsOverlay():this.state!==0&&this.doHideOverlay())}doShowLoadingOverlay(){this.overlayWrapperComp&&(this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams"),this.updateExclusive())}doShowNoRowsOverlay(){this.overlayWrapperComp&&(this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams"),this.updateExclusive())}doHideOverlay(){this.overlayWrapperComp&&(this.state=0,this.overlayWrapperComp.hideOverlay(),this.updateExclusive())}showOverlay(e,t,i){var n;const s=e.newAgStackInstance();(n=this.overlayWrapperComp)==null||n.showOverlay(s,t,this.isExclusive(),i),this.refreshWrapperPadding()}updateExclusive(){const e=this.exclusive;this.exclusive=this.isExclusive(),this.exclusive!==e&&this.eventService.dispatchEvent({type:"overlayExclusiveChanged"})}onGridSizeChanged(){this.refreshWrapperPadding()}refreshWrapperPadding(){if(!this.overlayWrapperComp)return;let e=0;if(this.state===2){const t=this.ctrlsService.get("gridHeaderCtrl");e=(t==null?void 0:t.getHeaderHeight())||0}else this.wrapperPadding!==0&&(e=0);this.wrapperPadding!==e&&(this.wrapperPadding=e,this.overlayWrapperComp.updateOverlayWrapperPaddingTop(e))}},MA=class extends G{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return q(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),Lg(t,this.processClassesFromGridOptions(e.rowNode)),Lg(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&(e.pinned==="left"&&t.push("ag-cell-last-left-pinned"),e.pinned==="right"&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=o=>{typeof o=="string"?t.push(o):Array.isArray(o)&&o.forEach(r=>t.push(r))},s=this.gos.get("rowClass");if(s){if(typeof s=="function")return z("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const n=this.gos.getCallback("getRowClass");if(n){const o={data:e.data,node:e,rowIndex:e.rowIndex},r=n(o);i(r)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},()=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},kA=class extends G{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=Wb(),this.gos.get("debug")&&Fi("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&Fi(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),i=e/t;return this.maxScrollY*i}},IA=class extends G{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=us(this.gos),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=us(this.gos))}doFullSort(e,t){const i=(n,o)=>({currentPos:o,rowNode:n}),s=e.map(i);return s.sort(this.compareRowNodes.bind(this,t)),s.map(n=>n.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,n=i.rowNode;for(let o=0,r=e.length;o<r;o++){const a=e[o],d=a.sort==="desc",h=this.getValue(s,a.column),p=this.getValue(n,a.column);let f;const m=this.getComparator(a,s);if(m?f=m(h,p,s,n,d):f=Ny(h,p,this.isAccentedSort),!isNaN(f)&&f!==0)return a.sort==="asc"?f:f*-1}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(s!=null)return s;if(!i.getColDef().showRowGroup)return;const n=!t.group&&i.getColDef().field;if(!n)return;const o=this.columnModel.getColDefCol(n);if(o)return o.getColDef().comparator}getValue(e,t){var s,n,o;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(oa(this.gos,this.columnModel.isPivotActive())){const d=(s=e.allLeafChildren)==null?void 0:s[0];return d?this.valueService.getValue(t,d,!1,!1):void 0}const a=(n=this.showRowGroupColsService)==null?void 0:n.getShowRowGroupCol(t.getId());return a?(o=e.groupData)==null?void 0:o[a.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}},Wr=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const n=e.childrenAfterGroup[s];n.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(n)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const s={rowNode:t,children:null};this.mapToItems[t.id]=s,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(s=>this.nodeIdsToColumns[i.id][s.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let s=0;s<t;s++){const n=this.mapToItems[i.id],o=this.mapToItems[i.parent.id];o.children||(o.children=[]),o.children.push(n),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(n=>i[n.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(n=>!i[n.getId()])}},Lm=class extends G{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new O0,this.rowSelectionMode=void 0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){const{gos:e,rowModel:t,onRowSelected:i}=this;this.selectionCtx.init(t),this.rowSelectionMode=la(e),this.groupSelectsChildren=Nn(e),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{const s=Nn(e),n=la(e);(s!==this.groupSelectsChildren||n!==this.rowSelectionMode)&&(this.groupSelectsChildren=s,this.rowSelectionMode=n,this.deselectAllRowNodes({source:"api"}))}),this.addManagedEventListeners({rowSelected:i.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiSelect(){return this.rowSelectionMode==="multiRow"}overrideSelectionValue(e,t){if(!vA(t))return e;const i=this.selectionCtx.getRoot();return i?i.isSelected()??!1:!0}setNodesSelected(e){var f;const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:n,nodes:o,event:r,source:a}=e;if(o.length===0)return 0;if(o.length>1&&!this.isMultiSelect())return z("cannot multi select unless selection mode is 'multiRow'"),0;const d=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,h=o.map(m=>m.footer?m.sibling:m);if(n){if(h.length>1)return z("cannot range select while selecting multiple rows"),0;const m=h[0],v=this.overrideSelectionValue(t,a);if(this.isMultiSelect()){if(this.selectionCtx.isInRange(m)){const w=this.selectionCtx.truncate(m);return v&&this.selectRange(w.discard,!1,a),this.selectRange(w.keep,v,a)}else if(this.selectionCtx.getRoot()!==m){const b=this.selectionCtx.extend(m,this.groupSelectsChildren);return v&&this.selectRange(b.discard,!1,a),this.selectRange(b.keep,v,a)}}}s||this.selectionCtx.setRoot(h[0]);let p=0;for(let m=0;m<h.length;m++){const v=h[m];d&&v.group||v.selectThisNode(t,r,a)&&p++,this.groupSelectsChildren&&((f=v.childrenAfterGroup)!=null&&f.length)&&(p+=this.selectChildren(v,t,d,a))}return s||(t&&(i||!this.isMultiSelect())&&(p+=this.clearOtherNodes(h[0],a)),p>0&&(this.updateGroupsFromChildrenSelections(a),this.dispatchSelectionChanged(a))),p}selectRange(e,t,i){let s=0;return e.forEach(n=>{if(n.group&&this.groupSelectsChildren)return;n.selectThisNode(t,void 0,i)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const n=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return Ve(n)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:n})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||!st(this.gos))return!1;const s=this.rowModel.getRootNode();t||(t=new Wr(!0,s),t.setInactive());let n=!1;return t.forEachChangedNodeDepthFirst(o=>{if(o!==s){const r=o.calculateSelectedFromChildren();n=o.selectThisNode(r===null?!1:r,void 0,e)||n}}),n}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(n=>{if(n&&n.id!==e.id){const o=this.selectedNodes.get(n.id);s+=o.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&n.parent&&i.set(n.parent.id,n.parent)}}),i.forEach(n=>{const o=n.calculateSelectedFromChildren();n.selectThisNode(o===null?!1:o,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(q(t)&&e.id!==t.id&&t){const s=t.id;this.selectedNodes.get(s)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){var e;(e=this.selectedNodes)==null||e.clear()}getBestCostNodeSelection(){if(!st(this.gos))return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function s(n){for(let o=0,r=n.length;o<r;o++){const a=n[o];if(a.isSelected())i.push(a);else{const d=a;d.group&&d.children&&s(d.children)}}}return s(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),e===0}deselectAllRowNodes(e){const t=r=>r.selectThisNode(!1,void 0,s),i=st(this.gos),{source:s,justFiltered:n,justCurrentPage:o}=e;if(o||n){if(!i){We("selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(n,o).forEach(t)}else this.selectedNodes.forEach(r=>{r&&t(r)}),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;const n=o=>{this.groupSelectsChildren&&o.group||(o.isSelected()?i++:o.selectable&&s++)};return this.getNodesToSelect(e,t).forEach(n),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return i===0&&s===0?!1:i>0&&s>0?null:i>0}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){this.validateSelectAllType();const i=[];if(t)return this.forEachNodeOnPage(n=>{if(!n.group){i.push(n);return}if(!n.expanded){const o=r=>{var a;i.push(r),(a=r.childrenAfterFilter)!=null&&a.length&&r.childrenAfterFilter.forEach(o)};o(n);return}this.groupSelectsChildren||i.push(n)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(n=>{i.push(n)}),i):(s.forEachNode(n=>{i.push(n)}),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const n=this.rowModel.getRow(s);n&&e(n)}}selectAllRowNodes(e){if(Wy(this.gos)&&!Md(this.gos))return z("cannot multi select unless selection mode is 'multiRow'");this.validateSelectAllType();const{source:t,justFiltered:i,justCurrentPage:s}=e,n=this.getNodesToSelect(i,s);n.forEach(o=>o.selectThisNode(!0,void 0,t)),this.selectionCtx.setRoot(n[0]??null),this.selectionCtx.setEndRange(he(n)??null),st(this.gos)&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{t!=null&&t.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return We("Invalid selection state. When using client-side row model, the state must conform to `string[]`.");const i=new Set(e),s=[];this.rowModel.forEachNode(n=>{i.has(n.id)&&s.push(n)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){this.eventService.dispatchEvent({type:"selectionChanged",source:e})}validateSelectAllType(){if(!st(this.gos))throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`)}},LA=class extends G{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const{gos:t}=this,i=ia(t),s=Ad(t);if(!i||!s)return;const n=Nn(t),o=st(t)&&n,r=[],a=d=>{if(e&&!d.group)return;if(o&&d.group){const p=d.childrenAfterGroup.some(f=>f.selectable===!0);d.setRowSelectable(p,!0);return}const h=(s==null?void 0:s(d))??!0;d.setRowSelectable(h,!0),!h&&d.isSelected()&&r.push(d)};if(o){const d=this.rowModel;new Wr(!1,d.getRootNode()).forEachChangedNodeDepthFirst(a,!0,!0)}else this.rowModel.forEachNode(a);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof Lm&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},_m=["asc","desc",null],_A=class extends G{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){t!=="asc"&&t!=="desc"&&(t=null);const n=us(this.gos);let o=[e];if(n&&e.getColDef().showRowGroup){const d=this.funcColsService.getSourceColumnsForGroupColumn(e),h=d==null?void 0:d.filter(p=>p.isSortable());h&&(o=[e,...h])}o.forEach(d=>d.setSort(t,s));const r=(i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),a=[];if(!r){const d=this.clearSortBarTheseColumns(o,s);a.push(...d)}this.updateSortIndex(e),a.push(...o),this.dispatchSortChangedEvents(s,a)}updateSortIndex(e){var a;const t=us(this.gos),i=(a=this.showRowGroupColsService)==null?void 0:a.getShowRowGroupCol(e.getId()),s=t&&i||e,n=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach(d=>d.setSortIndex(null));const o=n.filter(d=>t&&d.getColDef().showRowGroup?!1:d!==s);(s.getSort()?[...o,s]:o).forEach((d,h)=>{d.setSortIndex(h)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getAllCols().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gos.get("sortingOrder")?t=this.gos.get("sortingOrder"):t=_m,!Array.isArray(t)||t.length<=0)return z(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,n=i==t.length-1;let o;return s||n?o=t[0]:o=t[i+1],_m.indexOf(o)<0?(z("invalid sort type ",o),null):o}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter(o=>!!o.getSort());if(this.columnModel.isPivotMode()){const o=us(this.gos);e=e.filter(r=>{var p;const a=!!r.getAggFunc(),d=!r.isPrimary(),h=o?(p=this.showRowGroupColsService)==null?void 0:p.getShowRowGroupCol(r.getId()):r.getColDef().showRowGroup;return a||d||h})}const t=this.funcColsService.getRowGroupColumns().filter(o=>!!o.getSort()),i={};e.forEach((o,r)=>i[o.getId()]=r),e.sort((o,r)=>{const a=o.getSortIndex(),d=r.getSortIndex();if(a!=null&&d!=null)return a-d;if(a==null&&d==null){const h=i[o.getId()],p=i[r.getId()];return h>p?1:-1}else return d==null?-1:1});const s=us(this.gos)&&!!t.length;s&&(e=[...new Set(e.map(o=>{var r;return((r=this.showRowGroupColsService)==null?void 0:r.getShowRowGroupCol(o.getId()))??o}))]);const n=new Map;return e.forEach((o,r)=>n.set(o,r)),s&&t.forEach(o=>{const r=this.showRowGroupColsService.getShowRowGroupCol(o.getId());n.set(o,n.get(r))}),n}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=us(this.gos),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(t!=null&&t.length))return e.getSort();const s=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,n=s[0].getSort();return s.every(r=>r.getSort()==n)?n:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},OA=class extends G{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(this,()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.eventService.dispatchEvent({type:"gridReady"});const e=this.gos.isModuleRegistered("@ag-grid-enterprise/core");this.gos.get("debug")&&Fi(`initialised successfully, enterprise = ${e}`)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.columnModel.setColumnDefs(t,Bn(e.source))}}},VA="paste",NA=class extends G{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){st(this.gos)&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){e.source!==VA&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),n=new Wr(s,this.clientSideRowModel.getRootNode());n.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(n),n.forEachChangedNodeDepthFirst(o=>{i.push(o)})}this.rowRenderer.refreshCells({rowNodes:i})}},BA=class extends G{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);We("value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return Fi("Processing of the expression failed"),Fi("Expression = ",e),Fi("Params = ",t),Fi("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},GA=class extends G{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}},HA=class extends G{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=xs(this.gos),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=sa(this.gos);this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener("cellValueChanged",e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValueForDisplay(e,t){const i=t.leafGroup&&this.columnModel.isPivotMode(),s=t.group&&t.expanded&&!t.footer&&!i,n=this.gos.get("groupSuppressBlankHeader");if(!s||n)return this.getValue(e,t);let o=!1;const r=this.gos.get("groupTotalRow")??this.gos.get("groupIncludeFooter");typeof r!="function"?o=!!r:o=!!(this.gos.getCallback("groupTotalRow")??this.gos.getCallback("groupIncludeFooter"))({node:this});const a=s&&o;return this.getValue(e,t,!1,a)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const n=e.getColDef(),o=n.field,r=e.getColId(),a=t.data;let d;const h=t.groupData&&t.groupData[r]!==void 0,p=!s&&t.aggData&&t.aggData[r]!==void 0,f=this.isSsrm&&s&&!!e.getColDef().aggFunc,m=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&n.filterValueGetter?d=this.executeFilterValueGetter(n.filterValueGetter,a,e,t):this.isTreeData&&p?d=t.aggData[r]:this.isTreeData&&n.valueGetter?d=this.executeValueGetter(n.valueGetter,a,e,t):this.isTreeData&&o&&a?d=Fr(a,o,e.isFieldContainsDots()):h?d=t.groupData[r]:p?d=t.aggData[r]:n.valueGetter?d=this.executeValueGetter(n.valueGetter,a,e,t):m?d=Fr(a,t.field,e.isFieldContainsDots()):o&&a&&!f&&(d=Fr(a,o,e.isFieldContainsDots())),this.cellExpressions&&typeof d=="string"&&d.indexOf("=")===0){const v=d.substring(1);d=this.executeValueGetter(v,a,e,t)}if(d==null){const v=this.getOpenedGroup(t,e);if(v!=null)return v}return d}parseValue(e,t,i,s){const n=e.getColDef(),o=n.valueParser;if(q(o)){const r=this.gos.addGridCommonParams({node:t,data:t==null?void 0:t.data,oldValue:s,newValue:i,colDef:n,column:e});return typeof o=="function"?o(r):this.expressionService.evaluate(o,r)}return i}getDeleteValue(e,t){return q(e.getColDef().valueParser)?this.parseValue(e,t,"",this.getValueForDisplay(e,t))??null:null}formatValue(e,t,i,s,n=!0){let o=null,r;const a=e.getColDef();if(s?r=s:n&&(r=a.valueFormatter),r){const d=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});typeof r=="function"?o=r(d):o=this.expressionService.evaluate(r,d)}else if(a.refData)return a.refData[i]||"";return o==null&&Array.isArray(i)&&(o=i.join(", ")),o}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const s=t.getColDef().showRowGroup;let n=e.parent;for(;n!=null;){if(n.rowGroupColumn&&(s===!0||s===n.rowGroupColumn.getColId()))return n.key;n=n.parent}}setValue(e,t,i,s){const n=this.columnModel.getColDefCol(t);if(!e||!n)return!1;Ve(e.data)&&(e.data={});const{field:o,valueSetter:r}=n.getColDef();if(Ve(o)&&Ve(r))return z("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(n,i))return z("Data type of the new value does not match the cell data type of the column"),!1;const a=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(n,e),newValue:i,colDef:n.getColDef(),column:n});a.newValue=i;let d;if(q(r)?typeof r=="function"?d=r(a):d=this.expressionService.evaluate(r,a):d=this.setValueUsingField(e.data,o,i,n.isFieldContainsDots()),d===void 0&&(d=!0),!d)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged();const h=this.getValue(n,e);return this.eventService.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,colDef:a.colDef,data:e.data,node:e,oldValue:a.oldValue,newValue:h,value:h,source:s}),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let n=!1;if(!s)n=e[t]===i,n||(e[t]=i);else{const o=t.split(".");let r=e;for(;o.length>0&&r;){const a=o.shift();o.length===0?(n=r[a]===i,n||(r[a]=i)):r=r[a]}}return!n}executeFilterValueGetter(e,t,i,s){const n=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return typeof e=="function"?e(n):this.expressionService.evaluate(e,n)}executeValueGetter(e,t,i,s){const n=i.getColId(),o=this.valueCache.getValue(s,n);if(o!==void 0)return o;const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let a;return typeof e=="function"?a=e(r):a=this.expressionService.evaluate(e,r),this.valueCache.setValue(s,n,a),a}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let n=i;if(s){const o=this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data});n=s(o)}return typeof n=="string"||n==null||(n=String(n),n==="[object Object]"&&z("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),n}},_u=class vo{static applyGlobalGridOptions(t){if(!vo.gridOptions)return t;let i={};return Ut(i,vo.gridOptions,!0,!0),vo.mergeStrategy==="deep"?Ut(i,t,!0,!0):i={...i,...t},vo.gridOptions.context&&(i.context=vo.gridOptions.context),t.context&&(vo.mergeStrategy==="deep"&&i.context&&Ut(t.context,i.context,!0,!0),i.context=t.context),i}};_u.gridOptions=void 0,_u.mergeStrategy="shallow";var WA=_u;function zA(e,t,i){if(!t)return We("No gridOptions provided to createGrid"),{};const s=new $A().create(e,t,n=>{const o=new fP(e);n.createBean(o)},void 0,i);if(!Object.isFrozen(t)&&!(i!=null&&i.frameworkOverrides)){const n="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{We(`gridOptions.api is no longer supported. See ${n}.`)},configurable:!0})}return s}var UA=1,$A=class{create(e,t,i,s,n){const o=WA.applyGlobalGridOptions(t),r=SA(o),a=r.gridId??String(UA++),d=this.getRegisteredModules(n,a),h=this.createBeansList(r.rowModelType,d,a),p=this.createProvidedBeans(e,r,n);if(!h){We("Failed to create grid.");return}const f={providedBeanInstances:p,beanClasses:h,gridId:a,beanInitComparator:iP,beanDestroyComparator:sP,derivedBeans:[j0]},m=new zR(f);return this.registerModuleUserComponents(m,d),this.registerControllers(m,d),this.registerModuleApiFunctions(m,d),i(m),m.getBean("syncService").start(),s&&s(m),m.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach(s=>{s.controllers&&s.controllers.forEach(n=>i.register(n))})}getRegisteredModules(e,t){const i=e?e.modules:null,s=Is.__getRegisteredModules(t),n=[],o={},r=(a,d,h)=>{(f=>{o[f.moduleName]||(o[f.moduleName]=!0,n.push(f),Is.__register(f,a,h))})(d),d.dependantModules&&d.dependantModules.forEach(f=>r(a,f,h))};return r(!!(i!=null&&i.length)||!Is.__isPackageBased(),mA,void 0),i&&i.forEach(a=>r(!0,a,t)),s&&s.forEach(a=>r(!Is.__isPackageBased(),a,void 0)),n}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,n=>n.userComponents?n.userComponents:[]),s=e.getBean("userComponentRegistry");i.forEach(({name:n,classImp:o,params:r})=>{s.registerDefaultComponent(n,o,r)})}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach(s=>{const n=s.apiFunctions;n&&Object.keys(n).forEach(r=>{i==null||i.addFunction(r,n[r])})})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;Ve(s)&&(s=new vm);const n={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(n,i.providedBeanInstances),n}createBeansList(e="clientSide",t,i){const s=t.filter(d=>!d.rowModel||d.rowModel===e),n={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!n[e]){We("Could not find row model for rowModelType = ",e);return}if(!Is.__assertRegistered(n[e],`rowModelType = '${e}'`,i))return;const o=[aP,rP,bA,CA,K0,RR,J0,eP,Hx,Sf,kA,Bx,RA,k0,KR,bb,uP,yA,W0,Lm,cb,rE,xA,EA,A0,BA,ab,Nx,GA,HA,D0,Gx,UR,hP,Vx,cP,U0,V0,Ox,_A,TA,DA,LA,NA,Wx,Z0,MA,IA,oP,pP,lP,nP,OA,AA,zx,FA,PA,Ux,pb,q0,gb,ub,Y0,Q0,yb,hb,wb,X0,Sb,sb],r=this.extractModuleEntity(s,d=>d.beans?d.beans:[]);o.push(...r);const a=[];return o.forEach(d=>{a.indexOf(d)<0&&a.push(d)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Om=class extends G{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e;break}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};function KA(e){e.expansionService.expandAll(!0)}function jA(e){e.expansionService.expandAll(!1)}function ZA(e){var s,n;const t=(s=e.rowModelHelperService)==null?void 0:s.getClientSideRowModel(),i=(n=e.rowModelHelperService)==null?void 0:n.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}function qA(e,t,i){var o,r;const s=(o=e.rowModelHelperService)==null?void 0:o.getServerSideRowModel();if(s){if(e.funcColsService.isRowGroupEmpty()){s.setRowCount(t,i);return}We("setRowCount cannot be used while using row grouping.");return}const n=(r=e.rowModelHelperService)==null?void 0:r.getInfiniteRowModel();if(n){n.setRowCount(t,i);return}}function YA(e){var t;return((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function QA(e){return e.rowModel.isLastRowIndexKnown()}var XA={version:Ce,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll:KA,collapseAll:jA,onRowHeightChanged:ZA}},JA={version:Ce,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount:qA,getCacheBlockState:YA,isLastRowIndexKnown:QA}},eM=class{wrap(e,t,i=[],s){const n=this.createWrapper(e,s);return t.forEach(o=>{this.createMethod(n,o,!0)}),i.forEach(o=>{this.createMethod(n,o,!1)}),n}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&z("Framework component is missing the method "+t+"()"),null)}}},Oo=typeof global>"u"?{}:global;Oo.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,Oo.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,Oo.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,Oo.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,Oo.Node=typeof Node>"u"?{}:Node,Oo.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var tM=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],s=e[1],n=e[2],o=e[3];i=this.ff(i,s,n,o,t[0],7,-680876936),o=this.ff(o,i,s,n,t[1],12,-389564586),n=this.ff(n,o,i,s,t[2],17,606105819),s=this.ff(s,n,o,i,t[3],22,-1044525330),i=this.ff(i,s,n,o,t[4],7,-176418897),o=this.ff(o,i,s,n,t[5],12,1200080426),n=this.ff(n,o,i,s,t[6],17,-1473231341),s=this.ff(s,n,o,i,t[7],22,-45705983),i=this.ff(i,s,n,o,t[8],7,1770035416),o=this.ff(o,i,s,n,t[9],12,-1958414417),n=this.ff(n,o,i,s,t[10],17,-42063),s=this.ff(s,n,o,i,t[11],22,-1990404162),i=this.ff(i,s,n,o,t[12],7,1804603682),o=this.ff(o,i,s,n,t[13],12,-40341101),n=this.ff(n,o,i,s,t[14],17,-1502002290),s=this.ff(s,n,o,i,t[15],22,1236535329),i=this.gg(i,s,n,o,t[1],5,-165796510),o=this.gg(o,i,s,n,t[6],9,-1069501632),n=this.gg(n,o,i,s,t[11],14,643717713),s=this.gg(s,n,o,i,t[0],20,-373897302),i=this.gg(i,s,n,o,t[5],5,-701558691),o=this.gg(o,i,s,n,t[10],9,38016083),n=this.gg(n,o,i,s,t[15],14,-660478335),s=this.gg(s,n,o,i,t[4],20,-405537848),i=this.gg(i,s,n,o,t[9],5,568446438),o=this.gg(o,i,s,n,t[14],9,-1019803690),n=this.gg(n,o,i,s,t[3],14,-187363961),s=this.gg(s,n,o,i,t[8],20,1163531501),i=this.gg(i,s,n,o,t[13],5,-1444681467),o=this.gg(o,i,s,n,t[2],9,-51403784),n=this.gg(n,o,i,s,t[7],14,1735328473),s=this.gg(s,n,o,i,t[12],20,-1926607734),i=this.hh(i,s,n,o,t[5],4,-378558),o=this.hh(o,i,s,n,t[8],11,-2022574463),n=this.hh(n,o,i,s,t[11],16,1839030562),s=this.hh(s,n,o,i,t[14],23,-35309556),i=this.hh(i,s,n,o,t[1],4,-1530992060),o=this.hh(o,i,s,n,t[4],11,1272893353),n=this.hh(n,o,i,s,t[7],16,-155497632),s=this.hh(s,n,o,i,t[10],23,-1094730640),i=this.hh(i,s,n,o,t[13],4,681279174),o=this.hh(o,i,s,n,t[0],11,-358537222),n=this.hh(n,o,i,s,t[3],16,-722521979),s=this.hh(s,n,o,i,t[6],23,76029189),i=this.hh(i,s,n,o,t[9],4,-640364487),o=this.hh(o,i,s,n,t[12],11,-421815835),n=this.hh(n,o,i,s,t[15],16,530742520),s=this.hh(s,n,o,i,t[2],23,-995338651),i=this.ii(i,s,n,o,t[0],6,-198630844),o=this.ii(o,i,s,n,t[7],10,1126891415),n=this.ii(n,o,i,s,t[14],15,-1416354905),s=this.ii(s,n,o,i,t[5],21,-57434055),i=this.ii(i,s,n,o,t[12],6,1700485571),o=this.ii(o,i,s,n,t[3],10,-1894986606),n=this.ii(n,o,i,s,t[10],15,-1051523),s=this.ii(s,n,o,i,t[1],21,-2054922799),i=this.ii(i,s,n,o,t[8],6,1873313359),o=this.ii(o,i,s,n,t[15],10,-30611744),n=this.ii(n,o,i,s,t[6],15,-1560198380),s=this.ii(s,n,o,i,t[13],21,1309151649),i=this.ii(i,s,n,o,t[4],6,-145523070),o=this.ii(o,i,s,n,t[11],10,-1120210379),n=this.ii(n,o,i,s,t[2],15,718787259),s=this.ii(s,n,o,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(n,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,i,s,n,o){return t=this.add32(this.add32(t,e),this.add32(s,o)),this.add32(t<<n|t>>>32-n,i)}ff(e,t,i,s,n,o,r){return this.cmn(t&i|~t&s,e,t,n,o,r)}gg(e,t,i,s,n,o,r){return this.cmn(t&s|i&~s,e,t,n,o,r)}hh(e,t,i,s,n,o,r){return this.cmn(t^i^s,e,t,n,o,r)}ii(e,t,i,s,n,o,r){return this.cmn(i^(t|~s),e,t,n,o,r)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)n[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=t*8,this.md5cycle(i,n),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>s*8+4&15]+t[e>>s*8&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(i>>16)<<16|i&65535}},Oa={"01":"GRID","02":"CHARTS","0102":"BOTH"},Vm="https://ag-grid.com/licensing/",Nm=class ci{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new tM,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(ci.licenseKey),i=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,s=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const n=ci.getGridReleaseDate(),o=ci.formatDate(n);this.outputExpiredKey(t.expiry,o,i,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(ci.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),o=i.substring(0,s),[r,a,d]=ci.extractBracketedInformation(i);return{md5:n,license:o,version:r,isTrial:a,type:d}}getLicenseDetails(t){const i=ci.chartsLicenseManager?"BOTH":"GRID";if(Tt(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:i};const s=ci.getGridReleaseDate(),{md5:n,license:o,version:r,isTrial:a,type:d}=ci.extractLicenseComponents(t);let h=n===this.md5.md5(o)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,p,f,m=null,v=!1,w;function S(){p=m<new Date,f=void 0}if(h&&(m=ci.extractExpiry(o),h=!isNaN(m.getTime()),h))switch(f=s>m,r){case"legacy":case"2":{a&&S();break}case"3":Tt(d)?h=!1:(w=d,d!==Oa["01"]&&d!==Oa["0102"]||i==="BOTH"&&w!=="BOTH"?(h=!1,v=!0):a&&S())}return h?{licenseKey:t,valid:h,expiry:ci.formatDate(m),expired:f,version:r,isTrial:a,trialExpired:p,incorrectLicenseType:v,currentLicenseType:i,suppliedLicenseType:w}:{licenseKey:t,valid:h,incorrectLicenseType:v,currentLicenseType:i,suppliedLicenseType:w}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!Tt(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const i=(this.document.defaultView||window).location,{hostname:s=""}=i;return s}isForceWatermark(){const i=(this.document.defaultView||window).location,{pathname:s}=i;return s?s.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),n=t.getMonth(),o=t.getFullYear();return s+" "+i[n]+" "+o}static getGridReleaseDate(){return new Date(parseInt(ci.decode(ci.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,o,r,a,d,h,p,f=0;const m=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;f<m.length;)a=i.indexOf(m.charAt(f++)),d=i.indexOf(m.charAt(f++)),h=i.indexOf(m.charAt(f++)),p=i.indexOf(m.charAt(f++)),n=a<<2|d>>4,o=(d&15)<<4|h>>2,r=(h&3)<<6|p,s=s+String.fromCharCode(n),h!=64&&(s=s+String.fromCharCode(o)),p!=64&&(s=s+String.fromCharCode(r));return s=ci.utf8_decode(s),s}static utf8_decode(t){t=t.replace(/rn/g,"n");let i="";for(let s=0;s<t.length;s++){const n=t.charCodeAt(s);n<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(n&63|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(n&63|128))}return i}static setChartsLicenseManager(t){this.chartsLicenseManager=t}static setLicenseKey(t){this.licenseKey=t,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(a=>a.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(a=>a==="TRIAL").length===1,n=i.filter(a=>a.indexOf("v")===0)[0],o=n?n.replace("v",""):"legacy",r=Oa[i.filter(a=>Oa[a])[0]];return[o,s,r]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Vm}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Vm}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s,n){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};Nm.RELEASE_INFORMATION="MTcyODA1NzY1NzgzNA==";var Va=Nm,iM=class extends ke{constructor(){super(`<div class="ag-watermark">
190
- <div data-ref="eLicenseTextRef" class="ag-watermark-text"></div>
191
- </div>`),this.eLicenseTextRef=ee}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},sM={selector:"AG-WATERMARK",component:iM},Bm=class extends G{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new Va(lt(this.gos)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new Va(null).getLicenseDetails(e)}getWatermarkSelector(){return sM}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Va.setLicenseKey(e)}static setChartsLicenseManager(e){Va.setChartsLicenseManager(e)}},nM="32.2.2",oM=class extends ke{constructor(){super(),this.setTemplate("<div></div>")}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=ks(`<span data-ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`),{checked:t,icon:i}=this.params;t?e.appendChild(_t("check",this.gos)):i&&(ba(i)?e.appendChild(i):typeof i=="string"?e.innerHTML=i:z("menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=ks(`<span data-ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=ks(`<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=ks(`<span data-ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";Dr(t,!1),e.appendChild(_t(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},Gm={version:nM,moduleName:Rt.EnterpriseCoreModule,beans:[Bm],userComponents:[{name:"agMenuItem",classImp:oM}]};function rM(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">
192
- <div data-ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">
193
- <span data-ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>
194
- <div data-ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>
195
- </div>
196
- <div data-ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>
197
- </div>`}var lM=class yy extends ke{constructor(t){super(rM(t)),this.config=t,this.closable=!0,this.eContentWrapper=ee,this.eTitleBar=ee,this.eTitleBarButtons=ee,this.eTitle=ee}postConstruct(){const{component:t,closable:i,hideTitleBar:s,title:n,minWidth:o=250,width:r,minHeight:a=250,height:d,centered:h,popup:p,x:f,y:m}=this.config;this.positionableFeature=new Ef(this.getGui(),{minWidth:o,width:r,minHeight:a,height:d,centered:h,x:f,y:m,popup:p,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const v=this.getGui();t&&this.setBodyComponent(t),s?et(this.eTitleBar,!1):(n&&this.setTitle(n),this.setClosable(i??this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:w=>{if(v.contains(w.relatedTarget)||v.contains(Je(this.gos))||this.eTitleBarButtons.contains(w.target)){w.preventDefault();return}const S=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");S&&S.focus()}}),!(p&&this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const t=this.getGui();t.focus(),this.close=()=>{t.parentElement.removeChild(t),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(t){this.positionableFeature.setHeight(t)}getWidth(){return this.positionableFeature.getWidth()}setWidth(t){this.positionableFeature.setWidth(t)}setClosable(t){if(t!==this.closable&&(this.closable=t),t){const i=this.closeButtonComp=new ke(yy.CLOSE_BTN_TEMPLATE);this.createBean(i);const s=i.getGui(),n=_t("close",this.gos);n.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(n),this.addTitleBarButton(i),i.addManagedElementListeners(s,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp){const i=this.closeButtonComp.getGui();i.parentElement.removeChild(i),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(t){t.setParentComponent(this),this.eContentWrapper.appendChild(t.getGui())}addTitleBarButton(t,i){const s=this.eTitleBarButtons,n=s.children,o=n.length;i==null&&(i=o),i=Math.max(0,Math.min(i,o)),t.addCssClass("ag-panel-title-bar-button");const r=t.getGui();i===0?s.insertAdjacentElement("afterbegin",r):i===o?s.insertAdjacentElement("beforeend",r):n[i-1].insertAdjacentElement("afterend",r),t.setParentComponent(this)}getBodyHeight(){return ma(this.eContentWrapper)}getBodyWidth(){return Do(this.eContentWrapper)}setTitle(t){this.eTitle.innerText=t}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const t=this.getGui();t&&di(t)&&this.close(),super.destroy()}};lM.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>';var $e;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function i(n){throw new Error}e.assertNever=i,e.arrayToEnum=n=>{const o={};for(const r of n)o[r]=r;return o},e.getValidEnumValues=n=>{const o=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),r={};for(const a of o)r[a]=n[a];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const o=[];for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&o.push(r);return o},e.find=(n,o)=>{for(const r of n)if(o(r))return r},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,o=" | "){return n.map(r=>typeof r=="string"?`'${r}'`:r).join(o)}e.joinValues=s,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})($e||($e={}));var Ou;(function(e){e.mergeShapes=(t,i)=>({...t,...i})})(Ou||(Ou={}));const re=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),on=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},X=$e.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=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class hi extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const i=t||function(o){return o.message},s={_errors:[]},n=o=>{for(const r of o.issues)if(r.code==="invalid_union")r.unionErrors.map(n);else if(r.code==="invalid_return_type")n(r.returnTypeError);else if(r.code==="invalid_arguments")n(r.argumentsError);else if(r.path.length===0)s._errors.push(i(r));else{let a=s,d=0;for(;d<r.path.length;){const h=r.path[d];d===r.path.length-1?(a[h]=a[h]||{_errors:[]},a[h]._errors.push(i(r))):a[h]=a[h]||{_errors:[]},a=a[h],d++}}};return n(this),s}static assert(t){if(!(t instanceof hi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=i=>i.message){const i={},s=[];for(const n of this.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}hi.create=e=>new hi(e);const Vo=(e,t)=>{let i;switch(e.code){case X.invalid_type:e.received===re.undefined?i="Required":i=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,$e.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:i=`Unrecognized key(s) in object: ${$e.joinValues(e.keys,", ")}`;break;case X.invalid_union:i="Invalid input";break;case X.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${$e.joinValues(e.options)}`;break;case X.invalid_enum_value:i=`Invalid enum value. Expected ${$e.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:i="Invalid function arguments";break;case X.invalid_return_type:i="Invalid function return type";break;case X.invalid_date:i="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:$e.assertNever(e.validation):e.validation!=="regex"?i=`Invalid ${e.validation}`:i="Invalid";break;case X.too_small:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:i="Invalid input";break;case X.too_big:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?i=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:i="Invalid input";break;case X.custom:i="Invalid input";break;case X.invalid_intersection_types:i="Intersection results could not be merged";break;case X.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:i="Number must be finite";break;default:i=t.defaultError,$e.assertNever(e)}return{message:i}};let Hm=Vo;function cM(e){Hm=e}function Na(){return Hm}const Ba=e=>{const{data:t,path:i,errorMaps:s,issueData:n}=e,o=[...i,...n.path||[]],r={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="";const d=s.filter(h=>!!h).slice().reverse();for(const h of d)a=h(r,{data:t,defaultError:a}).message;return{...n,path:o,message:a}},dM=[];function ne(e,t){const i=Na(),s=Ba({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===Vo?void 0:Vo].filter(n=>!!n)});e.common.issues.push(s)}class Ot{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,i){const s=[];for(const n of i){if(n.status==="aborted")return Fe;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,i){const s=[];for(const n of i){const o=await n.key,r=await n.value;s.push({key:o,value:r})}return Ot.mergeObjectSync(t,s)}static mergeObjectSync(t,i){const s={};for(const n of i){const{key:o,value:r}=n;if(o.status==="aborted"||r.status==="aborted")return Fe;o.status==="dirty"&&t.dirty(),r.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof r.value<"u"||n.alwaysSet)&&(s[o.value]=r.value)}return{status:t.value,value:s}}}const Fe=Object.freeze({status:"aborted"}),No=e=>({status:"dirty",value:e}),jt=e=>({status:"valid",value:e}),Vu=e=>e.status==="aborted",Nu=e=>e.status==="dirty",zr=e=>e.status==="valid",Ur=e=>typeof Promise<"u"&&e instanceof Promise;function Ga(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Wm(e,t,i,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}typeof SuppressedError=="function"&&SuppressedError;var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ge||(ge={}));var $r,Kr;class Cs{constructor(t,i,s,n){this._cachedPath=[],this.parent=t,this.data=i,this._path=s,this._key=n}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 zm=(e,t)=>{if(zr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new hi(e.common.issues);return this._error=i,this._error}}};function Te(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:s,description:n}=e;if(t&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(r,a)=>{var d,h;const{message:p}=e;return r.code==="invalid_enum_value"?{message:p??a.defaultError}:typeof a.data>"u"?{message:(d=p??s)!==null&&d!==void 0?d:a.defaultError}:r.code!=="invalid_type"?{message:a.defaultError}:{message:(h=p??i)!==null&&h!==void 0?h:a.defaultError}},description:n}}class Le{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return on(t.data)}_getOrReturnCtx(t,i){return i||{common:t.parent.common,data:t.data,parsedType:on(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ot,ctx:{common:t.parent.common,data:t.data,parsedType:on(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const i=this._parse(t);if(Ur(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(t){const i=this._parse(t);return Promise.resolve(i)}parse(t,i){const s=this.safeParse(t,i);if(s.success)return s.data;throw s.error}safeParse(t,i){var s;const n={common:{issues:[],async:(s=i==null?void 0:i.async)!==null&&s!==void 0?s:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:on(t)},o=this._parseSync({data:t,path:n.path,parent:n});return zm(n,o)}async parseAsync(t,i){const s=await this.safeParseAsync(t,i);if(s.success)return s.data;throw s.error}async safeParseAsync(t,i){const s={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:on(t)},n=this._parse({data:t,path:s.path,parent:s}),o=await(Ur(n)?n:Promise.resolve(n));return zm(s,o)}refine(t,i){const s=n=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(n):i;return this._refinement((n,o)=>{const r=t(n),a=()=>o.addIssue({code:X.custom,...s(n)});return typeof Promise<"u"&&r instanceof Promise?r.then(d=>d?!0:(a(),!1)):r?!0:(a(),!1)})}refinement(t,i){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof i=="function"?i(s,n):i),!1))}_refinement(t){return new Ki({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ws.create(this,this._def)}nullable(){return cn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $i.create(this,this._def)}promise(){return Wo.create(this,this._def)}or(t){return Yr.create([this,t],this._def)}and(t){return Qr.create(this,t,this._def)}transform(t){return new Ki({...Te(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const i=typeof t=="function"?t:()=>t;return new il({...Te(this._def),innerType:this,defaultValue:i,typeName:be.ZodDefault})}brand(){return new Hu({typeName:be.ZodBranded,type:this,...Te(this._def)})}catch(t){const i=typeof t=="function"?t:()=>t;return new sl({...Te(this._def),innerType:this,catchValue:i,typeName:be.ZodCatch})}describe(t){const i=this.constructor;return new i({...this._def,description:t})}pipe(t){return nl.create(this,t)}readonly(){return ol.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uM=/^c[^\s-]{8,}$/i,hM=/^[0-9a-z]+$/,pM=/^[0-9A-HJKMNP-TV-Z]{26}$/,gM=/^[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)?)??$/,CM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Bu;const wM=/^(?:(?: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})))$/,yM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Um="((\\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])))",bM=new RegExp(`^${Um}$`);function $m(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function RM(e){return new RegExp(`^${$m(e)}$`)}function Km(e){let t=`${Um}T${$m(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,new RegExp(`^${t}$`)}function FM(e,t){return!!((t==="v4"||!t)&&wM.test(e)||(t==="v6"||!t)&&SM.test(e))}class Ui extends Le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.string,received:o.parsedType}),Fe}const s=new Ot;let n;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),s.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),s.dirty());else if(o.kind==="length"){const r=t.data.length>o.value,a=t.data.length<o.value;(r||a)&&(n=this._getOrReturnCtx(t,n),r?ne(n,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&ne(n,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),s.dirty())}else if(o.kind==="email")CM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"email",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="emoji")Bu||(Bu=new RegExp(vM,"u")),Bu.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"emoji",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="uuid")gM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"uuid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="nanoid")fM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"nanoid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="cuid")uM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"cuid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="cuid2")hM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"cuid2",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="ulid")pM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"ulid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),ne(n,{validation:"url",code:X.invalid_string,message:o.message}),s.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"regex",code:X.invalid_string,message:o.message}),s.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),s.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:{startsWith:o.value},message:o.message}),s.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:{endsWith:o.value},message:o.message}),s.dirty()):o.kind==="datetime"?Km(o).test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:"datetime",message:o.message}),s.dirty()):o.kind==="date"?bM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:"date",message:o.message}),s.dirty()):o.kind==="time"?RM(o).test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:"time",message:o.message}),s.dirty()):o.kind==="duration"?mM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"duration",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="ip"?FM(t.data,o.version)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"ip",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="base64"?yM.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"base64",code:X.invalid_string,message:o.message}),s.dirty()):$e.assertNever(o);return{status:s.value,value:t.data}}_regex(t,i,s){return this.refinement(n=>t.test(n),{validation:i,code:X.invalid_string,...ge.errToObj(s)})}_addCheck(t){return new Ui({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}datetime(t){var i,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(i=t==null?void 0:t.offset)!==null&&i!==void 0?i:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...ge.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ge.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,i){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(i)})}includes(t,i){return this._addCheck({kind:"includes",value:t,position:i==null?void 0:i.position,...ge.errToObj(i==null?void 0:i.message)})}startsWith(t,i){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(i)})}endsWith(t,i){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(i)})}min(t,i){return this._addCheck({kind:"min",value:t,...ge.errToObj(i)})}max(t,i){return this._addCheck({kind:"max",value:t,...ge.errToObj(i)})}length(t,i){return this._addCheck({kind:"length",value:t,...ge.errToObj(i)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new Ui({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ui({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ui({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxLength(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}Ui.create=e=>{var t;return new Ui({checks:[],typeName:be.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Te(e)})};function EM(e,t){const i=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=i>s?i:s,o=parseInt(e.toFixed(n).replace(".","")),r=parseInt(t.toFixed(n).replace(".",""));return o%r/Math.pow(10,n)}class rn extends Le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.number,received:o.parsedType}),Fe}let s;const n=new Ot;for(const o of this._def.checks)o.kind==="int"?$e.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),ne(s,{code:X.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?EM(t.data,o.value)!==0&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),ne(s,{code:X.not_finite,message:o.message}),n.dirty()):$e.assertNever(o);return{status:n.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,ge.toString(i))}gt(t,i){return this.setLimit("min",t,!1,ge.toString(i))}lte(t,i){return this.setLimit("max",t,!0,ge.toString(i))}lt(t,i){return this.setLimit("max",t,!1,ge.toString(i))}setLimit(t,i,s,n){return new rn({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:ge.toString(n)}]})}_addCheck(t){return new rn({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(i)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&$e.isInteger(t.value))}get isFinite(){let t=null,i=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(i)&&Number.isFinite(t)}}rn.create=e=>new rn({checks:[],typeName:be.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Te(e)});class ln extends Le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==re.bigint){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.bigint,received:o.parsedType}),Fe}let s;const n=new Ot;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):$e.assertNever(o);return{status:n.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,ge.toString(i))}gt(t,i){return this.setLimit("min",t,!1,ge.toString(i))}lte(t,i){return this.setLimit("max",t,!0,ge.toString(i))}lt(t,i){return this.setLimit("max",t,!1,ge.toString(i))}setLimit(t,i,s,n){return new ln({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:ge.toString(n)}]})}_addCheck(t){return new ln({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(i)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}ln.create=e=>{var t;return new ln({checks:[],typeName:be.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Te(e)})};class jr extends Le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.boolean,received:s.parsedType}),Fe}return jt(t.data)}}jr.create=e=>new jr({typeName:be.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Te(e)});class jn extends Le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.date,received:o.parsedType}),Fe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_date}),Fe}const s=new Ot;let n;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),s.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),s.dirty()):$e.assertNever(o);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new jn({...this._def,checks:[...this._def.checks,t]})}min(t,i){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(i)})}max(t,i){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(i)})}get minDate(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t!=null?new Date(t):null}}jn.create=e=>new jn({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:be.ZodDate,...Te(e)});class Ha extends Le{_parse(t){if(this._getType(t)!==re.symbol){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.symbol,received:s.parsedType}),Fe}return jt(t.data)}}Ha.create=e=>new Ha({typeName:be.ZodSymbol,...Te(e)});class Zr extends Le{_parse(t){if(this._getType(t)!==re.undefined){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.undefined,received:s.parsedType}),Fe}return jt(t.data)}}Zr.create=e=>new Zr({typeName:be.ZodUndefined,...Te(e)});class qr extends Le{_parse(t){if(this._getType(t)!==re.null){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.null,received:s.parsedType}),Fe}return jt(t.data)}}qr.create=e=>new qr({typeName:be.ZodNull,...Te(e)});class Bo extends Le{constructor(){super(...arguments),this._any=!0}_parse(t){return jt(t.data)}}Bo.create=e=>new Bo({typeName:be.ZodAny,...Te(e)});class Zn extends Le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return jt(t.data)}}Zn.create=e=>new Zn({typeName:be.ZodUnknown,...Te(e)});class _s extends Le{_parse(t){const i=this._getOrReturnCtx(t);return ne(i,{code:X.invalid_type,expected:re.never,received:i.parsedType}),Fe}}_s.create=e=>new _s({typeName:be.ZodNever,...Te(e)});class Wa extends Le{_parse(t){if(this._getType(t)!==re.undefined){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.void,received:s.parsedType}),Fe}return jt(t.data)}}Wa.create=e=>new Wa({typeName:be.ZodVoid,...Te(e)});class $i extends Le{_parse(t){const{ctx:i,status:s}=this._processInputParams(t),n=this._def;if(i.parsedType!==re.array)return ne(i,{code:X.invalid_type,expected:re.array,received:i.parsedType}),Fe;if(n.exactLength!==null){const r=i.data.length>n.exactLength.value,a=i.data.length<n.exactLength.value;(r||a)&&(ne(i,{code:r?X.too_big:X.too_small,minimum:a?n.exactLength.value:void 0,maximum:r?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&i.data.length<n.minLength.value&&(ne(i,{code:X.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&i.data.length>n.maxLength.value&&(ne(i,{code:X.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((r,a)=>n.type._parseAsync(new Cs(i,r,i.path,a)))).then(r=>Ot.mergeArray(s,r));const o=[...i.data].map((r,a)=>n.type._parseSync(new Cs(i,r,i.path,a)));return Ot.mergeArray(s,o)}get element(){return this._def.type}min(t,i){return new $i({...this._def,minLength:{value:t,message:ge.toString(i)}})}max(t,i){return new $i({...this._def,maxLength:{value:t,message:ge.toString(i)}})}length(t,i){return new $i({...this._def,exactLength:{value:t,message:ge.toString(i)}})}nonempty(t){return this.min(1,t)}}$i.create=(e,t)=>new $i({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Te(t)});function Go(e){if(e instanceof ct){const t={};for(const i in e.shape){const s=e.shape[i];t[i]=ws.create(Go(s))}return new ct({...e._def,shape:()=>t})}else return e instanceof $i?new $i({...e._def,type:Go(e.element)}):e instanceof ws?ws.create(Go(e.unwrap())):e instanceof cn?cn.create(Go(e.unwrap())):e instanceof vs?vs.create(e.items.map(t=>Go(t))):e}class ct extends Le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),i=$e.objectKeys(t);return this._cached={shape:t,keys:i}}_parse(t){if(this._getType(t)!==re.object){const h=this._getOrReturnCtx(t);return ne(h,{code:X.invalid_type,expected:re.object,received:h.parsedType}),Fe}const{status:s,ctx:n}=this._processInputParams(t),{shape:o,keys:r}=this._getCached(),a=[];if(!(this._def.catchall instanceof _s&&this._def.unknownKeys==="strip"))for(const h in n.data)r.includes(h)||a.push(h);const d=[];for(const h of r){const p=o[h],f=n.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Cs(n,f,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof _s){const h=this._def.unknownKeys;if(h==="passthrough")for(const p of a)d.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(h==="strict")a.length>0&&(ne(n,{code:X.unrecognized_keys,keys:a}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const p of a){const f=n.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Cs(n,f,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const p of d){const f=await p.key,m=await p.value;h.push({key:f,value:m,alwaysSet:p.alwaysSet})}return h}).then(h=>Ot.mergeObjectSync(s,h)):Ot.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new ct({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(i,s)=>{var n,o,r,a;const d=(r=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,i,s).message)!==null&&r!==void 0?r:s.defaultError;return i.code==="unrecognized_keys"?{message:(a=ge.errToObj(t).message)!==null&&a!==void 0?a:d}:{message:d}}}:{}})}strip(){return new ct({...this._def,unknownKeys:"strip"})}passthrough(){return new ct({...this._def,unknownKeys:"passthrough"})}extend(t){return new ct({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ct({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:be.ZodObject})}setKey(t,i){return this.augment({[t]:i})}catchall(t){return new ct({...this._def,catchall:t})}pick(t){const i={};return $e.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new ct({...this._def,shape:()=>i})}omit(t){const i={};return $e.objectKeys(this.shape).forEach(s=>{t[s]||(i[s]=this.shape[s])}),new ct({...this._def,shape:()=>i})}deepPartial(){return Go(this)}partial(t){const i={};return $e.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?i[s]=n:i[s]=n.optional()}),new ct({...this._def,shape:()=>i})}required(t){const i={};return $e.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])i[s]=this.shape[s];else{let o=this.shape[s];for(;o instanceof ws;)o=o._def.innerType;i[s]=o}}),new ct({...this._def,shape:()=>i})}keyof(){return jm($e.objectKeys(this.shape))}}ct.create=(e,t)=>new ct({shape:()=>e,unknownKeys:"strip",catchall:_s.create(),typeName:be.ZodObject,...Te(t)}),ct.strictCreate=(e,t)=>new ct({shape:()=>e,unknownKeys:"strict",catchall:_s.create(),typeName:be.ZodObject,...Te(t)}),ct.lazycreate=(e,t)=>new ct({shape:e,unknownKeys:"strip",catchall:_s.create(),typeName:be.ZodObject,...Te(t)});class Yr extends Le{_parse(t){const{ctx:i}=this._processInputParams(t),s=this._def.options;function n(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return i.common.issues.push(...a.ctx.common.issues),a.result;const r=o.map(a=>new hi(a.ctx.common.issues));return ne(i,{code:X.invalid_union,unionErrors:r}),Fe}if(i.common.async)return Promise.all(s.map(async o=>{const r={...i,common:{...i.common,issues:[]},parent:null};return{result:await o._parseAsync({data:i.data,path:i.path,parent:r}),ctx:r}})).then(n);{let o;const r=[];for(const d of s){const h={...i,common:{...i.common,issues:[]},parent:null},p=d._parseSync({data:i.data,path:i.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:h}),h.common.issues.length&&r.push(h.common.issues)}if(o)return i.common.issues.push(...o.ctx.common.issues),o.result;const a=r.map(d=>new hi(d));return ne(i,{code:X.invalid_union,unionErrors:a}),Fe}}get options(){return this._def.options}}Yr.create=(e,t)=>new Yr({options:e,typeName:be.ZodUnion,...Te(t)});const Os=e=>e instanceof Jr?Os(e.schema):e instanceof Ki?Os(e.innerType()):e instanceof el?[e.value]:e instanceof an?e.options:e instanceof tl?$e.objectValues(e.enum):e instanceof il?Os(e._def.innerType):e instanceof Zr?[void 0]:e instanceof qr?[null]:e instanceof ws?[void 0,...Os(e.unwrap())]:e instanceof cn?[null,...Os(e.unwrap())]:e instanceof Hu||e instanceof ol?Os(e.unwrap()):e instanceof sl?Os(e._def.innerType):[];class za extends Le{_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==re.object)return ne(i,{code:X.invalid_type,expected:re.object,received:i.parsedType}),Fe;const s=this.discriminator,n=i.data[s],o=this.optionsMap.get(n);return o?i.common.async?o._parseAsync({data:i.data,path:i.path,parent:i}):o._parseSync({data:i.data,path:i.path,parent:i}):(ne(i,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Fe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,i,s){const n=new Map;for(const o of i){const r=Os(o.shape[t]);if(!r.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of r){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,o)}}return new za({typeName:be.ZodDiscriminatedUnion,discriminator:t,options:i,optionsMap:n,...Te(s)})}}function Gu(e,t){const i=on(e),s=on(t);if(e===t)return{valid:!0,data:e};if(i===re.object&&s===re.object){const n=$e.objectKeys(t),o=$e.objectKeys(e).filter(a=>n.indexOf(a)!==-1),r={...e,...t};for(const a of o){const d=Gu(e[a],t[a]);if(!d.valid)return{valid:!1};r[a]=d.data}return{valid:!0,data:r}}else if(i===re.array&&s===re.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let o=0;o<e.length;o++){const r=e[o],a=t[o],d=Gu(r,a);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return i===re.date&&s===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Qr extends Le{_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=(o,r)=>{if(Vu(o)||Vu(r))return Fe;const a=Gu(o.value,r.value);return a.valid?((Nu(o)||Nu(r))&&i.dirty(),{status:i.value,value:a.data}):(ne(s,{code:X.invalid_intersection_types}),Fe)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([o,r])=>n(o,r)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Qr.create=(e,t,i)=>new Qr({left:e,right:t,typeName:be.ZodIntersection,...Te(i)});class vs extends Le{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.array)return ne(s,{code:X.invalid_type,expected:re.array,received:s.parsedType}),Fe;if(s.data.length<this._def.items.length)return ne(s,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Fe;!this._def.rest&&s.data.length>this._def.items.length&&(ne(s,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const o=[...s.data].map((r,a)=>{const d=this._def.items[a]||this._def.rest;return d?d._parse(new Cs(s,r,s.path,a)):null}).filter(r=>!!r);return s.common.async?Promise.all(o).then(r=>Ot.mergeArray(i,r)):Ot.mergeArray(i,o)}get items(){return this._def.items}rest(t){return new vs({...this._def,rest:t})}}vs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vs({items:e,typeName:be.ZodTuple,rest:null,...Te(t)})};class Xr extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.object)return ne(s,{code:X.invalid_type,expected:re.object,received:s.parsedType}),Fe;const n=[],o=this._def.keyType,r=this._def.valueType;for(const a in s.data)n.push({key:o._parse(new Cs(s,a,s.path,a)),value:r._parse(new Cs(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Ot.mergeObjectAsync(i,n):Ot.mergeObjectSync(i,n)}get element(){return this._def.valueType}static create(t,i,s){return i instanceof Le?new Xr({keyType:t,valueType:i,typeName:be.ZodRecord,...Te(s)}):new Xr({keyType:Ui.create(),valueType:t,typeName:be.ZodRecord,...Te(i)})}}class Ua extends Le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.map)return ne(s,{code:X.invalid_type,expected:re.map,received:s.parsedType}),Fe;const n=this._def.keyType,o=this._def.valueType,r=[...s.data.entries()].map(([a,d],h)=>({key:n._parse(new Cs(s,a,s.path,[h,"key"])),value:o._parse(new Cs(s,d,s.path,[h,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const d of r){const h=await d.key,p=await d.value;if(h.status==="aborted"||p.status==="aborted")return Fe;(h.status==="dirty"||p.status==="dirty")&&i.dirty(),a.set(h.value,p.value)}return{status:i.value,value:a}})}else{const a=new Map;for(const d of r){const h=d.key,p=d.value;if(h.status==="aborted"||p.status==="aborted")return Fe;(h.status==="dirty"||p.status==="dirty")&&i.dirty(),a.set(h.value,p.value)}return{status:i.value,value:a}}}}Ua.create=(e,t,i)=>new Ua({valueType:t,keyType:e,typeName:be.ZodMap,...Te(i)});class qn extends Le{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.set)return ne(s,{code:X.invalid_type,expected:re.set,received:s.parsedType}),Fe;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(ne(s,{code:X.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),i.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(ne(s,{code:X.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),i.dirty());const o=this._def.valueType;function r(d){const h=new Set;for(const p of d){if(p.status==="aborted")return Fe;p.status==="dirty"&&i.dirty(),h.add(p.value)}return{status:i.value,value:h}}const a=[...s.data.values()].map((d,h)=>o._parse(new Cs(s,d,s.path,h)));return s.common.async?Promise.all(a).then(d=>r(d)):r(a)}min(t,i){return new qn({...this._def,minSize:{value:t,message:ge.toString(i)}})}max(t,i){return new qn({...this._def,maxSize:{value:t,message:ge.toString(i)}})}size(t,i){return this.min(t,i).max(t,i)}nonempty(t){return this.min(1,t)}}qn.create=(e,t)=>new qn({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...Te(t)});class Ho extends Le{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==re.function)return ne(i,{code:X.invalid_type,expected:re.function,received:i.parsedType}),Fe;function s(a,d){return Ba({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Na(),Vo].filter(h=>!!h),issueData:{code:X.invalid_arguments,argumentsError:d}})}function n(a,d){return Ba({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Na(),Vo].filter(h=>!!h),issueData:{code:X.invalid_return_type,returnTypeError:d}})}const o={errorMap:i.common.contextualErrorMap},r=i.data;if(this._def.returns instanceof Wo){const a=this;return jt(async function(...d){const h=new hi([]),p=await a._def.args.parseAsync(d,o).catch(v=>{throw h.addIssue(s(d,v)),h}),f=await Reflect.apply(r,this,p);return await a._def.returns._def.type.parseAsync(f,o).catch(v=>{throw h.addIssue(n(f,v)),h})})}else{const a=this;return jt(function(...d){const h=a._def.args.safeParse(d,o);if(!h.success)throw new hi([s(d,h.error)]);const p=Reflect.apply(r,this,h.data),f=a._def.returns.safeParse(p,o);if(!f.success)throw new hi([n(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ho({...this._def,args:vs.create(t).rest(Zn.create())})}returns(t){return new Ho({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,i,s){return new Ho({args:t||vs.create([]).rest(Zn.create()),returns:i||Zn.create(),typeName:be.ZodFunction,...Te(s)})}}class Jr extends Le{get schema(){return this._def.getter()}_parse(t){const{ctx:i}=this._processInputParams(t);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Jr.create=(e,t)=>new Jr({getter:e,typeName:be.ZodLazy,...Te(t)});class el extends Le{_parse(t){if(t.data!==this._def.value){const i=this._getOrReturnCtx(t);return ne(i,{received:i.data,code:X.invalid_literal,expected:this._def.value}),Fe}return{status:"valid",value:t.data}}get value(){return this._def.value}}el.create=(e,t)=>new el({value:e,typeName:be.ZodLiteral,...Te(t)});function jm(e,t){return new an({values:e,typeName:be.ZodEnum,...Te(t)})}class an extends Le{constructor(){super(...arguments),$r.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const i=this._getOrReturnCtx(t),s=this._def.values;return ne(i,{expected:$e.joinValues(s),received:i.parsedType,code:X.invalid_type}),Fe}if(Ga(this,$r)||Wm(this,$r,new Set(this._def.values)),!Ga(this,$r).has(t.data)){const i=this._getOrReturnCtx(t),s=this._def.values;return ne(i,{received:i.data,code:X.invalid_enum_value,options:s}),Fe}return jt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const i of this._def.values)t[i]=i;return t}get Values(){const t={};for(const i of this._def.values)t[i]=i;return t}get Enum(){const t={};for(const i of this._def.values)t[i]=i;return t}extract(t,i=this._def){return an.create(t,{...this._def,...i})}exclude(t,i=this._def){return an.create(this.options.filter(s=>!t.includes(s)),{...this._def,...i})}}$r=new WeakMap,an.create=jm;class tl extends Le{constructor(){super(...arguments),Kr.set(this,void 0)}_parse(t){const i=$e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==re.string&&s.parsedType!==re.number){const n=$e.objectValues(i);return ne(s,{expected:$e.joinValues(n),received:s.parsedType,code:X.invalid_type}),Fe}if(Ga(this,Kr)||Wm(this,Kr,new Set($e.getValidEnumValues(this._def.values))),!Ga(this,Kr).has(t.data)){const n=$e.objectValues(i);return ne(s,{received:s.data,code:X.invalid_enum_value,options:n}),Fe}return jt(t.data)}get enum(){return this._def.values}}Kr=new WeakMap,tl.create=(e,t)=>new tl({values:e,typeName:be.ZodNativeEnum,...Te(t)});class Wo extends Le{unwrap(){return this._def.type}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==re.promise&&i.common.async===!1)return ne(i,{code:X.invalid_type,expected:re.promise,received:i.parsedType}),Fe;const s=i.parsedType===re.promise?i.data:Promise.resolve(i.data);return jt(s.then(n=>this._def.type.parseAsync(n,{path:i.path,errorMap:i.common.contextualErrorMap})))}}Wo.create=(e,t)=>new Wo({type:e,typeName:be.ZodPromise,...Te(t)});class Ki extends Le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:r=>{ne(s,r),r.fatal?i.abort():i.dirty()},get path(){return s.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){const r=n.transform(s.data,o);if(s.common.async)return Promise.resolve(r).then(async a=>{if(i.value==="aborted")return Fe;const d=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return d.status==="aborted"?Fe:d.status==="dirty"||i.value==="dirty"?No(d.value):d});{if(i.value==="aborted")return Fe;const a=this._def.schema._parseSync({data:r,path:s.path,parent:s});return a.status==="aborted"?Fe:a.status==="dirty"||i.value==="dirty"?No(a.value):a}}if(n.type==="refinement"){const r=a=>{const d=n.refinement(a,o);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Fe:(a.status==="dirty"&&i.dirty(),r(a.value),{status:i.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Fe:(a.status==="dirty"&&i.dirty(),r(a.value).then(()=>({status:i.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const r=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!zr(r))return r;const a=n.transform(r.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(r=>zr(r)?Promise.resolve(n.transform(r.value,o)).then(a=>({status:i.value,value:a})):r);$e.assertNever(n)}}Ki.create=(e,t,i)=>new Ki({schema:e,typeName:be.ZodEffects,effect:t,...Te(i)}),Ki.createWithPreprocess=(e,t,i)=>new Ki({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...Te(i)});class ws extends Le{_parse(t){return this._getType(t)===re.undefined?jt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ws.create=(e,t)=>new ws({innerType:e,typeName:be.ZodOptional,...Te(t)});class cn extends Le{_parse(t){return this._getType(t)===re.null?jt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}cn.create=(e,t)=>new cn({innerType:e,typeName:be.ZodNullable,...Te(t)});class il extends Le{_parse(t){const{ctx:i}=this._processInputParams(t);let s=i.data;return i.parsedType===re.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}il.create=(e,t)=>new il({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});class sl extends Le{_parse(t){const{ctx:i}=this._processInputParams(t),s={...i,common:{...i.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Ur(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new hi(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new hi(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}sl.create=(e,t)=>new sl({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});class $a extends Le{_parse(t){if(this._getType(t)!==re.nan){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.nan,received:s.parsedType}),Fe}return{status:"valid",value:t.data}}}$a.create=e=>new $a({typeName:be.ZodNaN,...Te(e)});const xM=Symbol("zod_brand");class Hu extends Le{_parse(t){const{ctx:i}=this._processInputParams(t),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}}class nl extends Le{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?Fe:o.status==="dirty"?(i.dirty(),No(o.value)):this._def.out._parseAsync({data:o.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Fe:n.status==="dirty"?(i.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,i){return new nl({in:t,out:i,typeName:be.ZodPipeline})}}class ol extends Le{_parse(t){const i=this._def.innerType._parse(t),s=n=>(zr(n)&&(n.value=Object.freeze(n.value)),n);return Ur(i)?i.then(n=>s(n)):s(i)}unwrap(){return this._def.innerType}}ol.create=(e,t)=>new ol({innerType:e,typeName:be.ZodReadonly,...Te(t)});function Zm(e,t={},i){return e?Bo.create().superRefine((s,n)=>{var o,r;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,d=(r=(o=a.fatal)!==null&&o!==void 0?o:i)!==null&&r!==void 0?r:!0,h=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...h,fatal:d})}}):Bo.create()}const PM={object:ct.lazycreate};var be;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(be||(be={}));const DM=(e,t={message:`Input not instance of ${e.name}`})=>Zm(i=>i instanceof e,t),qm=Ui.create,Ym=rn.create,TM=$a.create,AM=ln.create,Qm=jr.create,MM=jn.create,kM=Ha.create,IM=Zr.create,LM=qr.create,_M=Bo.create,OM=Zn.create,VM=_s.create,NM=Wa.create,BM=$i.create,GM=ct.create,HM=ct.strictCreate,WM=Yr.create,zM=za.create,UM=Qr.create,$M=vs.create,KM=Xr.create,jM=Ua.create,ZM=qn.create,qM=Ho.create,YM=Jr.create,QM=el.create,XM=an.create,JM=tl.create,ek=Wo.create,Xm=Ki.create,tk=ws.create,ik=cn.create,sk=Ki.createWithPreprocess,nk=nl.create;var Ka=Object.freeze({__proto__:null,defaultErrorMap:Vo,setErrorMap:cM,getErrorMap:Na,makeIssue:Ba,EMPTY_PATH:dM,addIssueToContext:ne,ParseStatus:Ot,INVALID:Fe,DIRTY:No,OK:jt,isAborted:Vu,isDirty:Nu,isValid:zr,isAsync:Ur,get util(){return $e},get objectUtil(){return Ou},ZodParsedType:re,getParsedType:on,ZodType:Le,datetimeRegex:Km,ZodString:Ui,ZodNumber:rn,ZodBigInt:ln,ZodBoolean:jr,ZodDate:jn,ZodSymbol:Ha,ZodUndefined:Zr,ZodNull:qr,ZodAny:Bo,ZodUnknown:Zn,ZodNever:_s,ZodVoid:Wa,ZodArray:$i,ZodObject:ct,ZodUnion:Yr,ZodDiscriminatedUnion:za,ZodIntersection:Qr,ZodTuple:vs,ZodRecord:Xr,ZodMap:Ua,ZodSet:qn,ZodFunction:Ho,ZodLazy:Jr,ZodLiteral:el,ZodEnum:an,ZodNativeEnum:tl,ZodPromise:Wo,ZodEffects:Ki,ZodTransformer:Ki,ZodOptional:ws,ZodNullable:cn,ZodDefault:il,ZodCatch:sl,ZodNaN:$a,BRAND:xM,ZodBranded:Hu,ZodPipeline:nl,ZodReadonly:ol,custom:Zm,Schema:Le,ZodSchema:Le,late:PM,get ZodFirstPartyTypeKind(){return be},coerce:{string:e=>Ui.create({...e,coerce:!0}),number:e=>rn.create({...e,coerce:!0}),boolean:e=>jr.create({...e,coerce:!0}),bigint:e=>ln.create({...e,coerce:!0}),date:e=>jn.create({...e,coerce:!0})},any:_M,array:BM,bigint:AM,boolean:Qm,date:MM,discriminatedUnion:zM,effect:Xm,enum:XM,function:qM,instanceof:DM,intersection:UM,lazy:YM,literal:QM,map:jM,nan:TM,nativeEnum:JM,never:VM,null:LM,nullable:ik,number:Ym,object:GM,oboolean:()=>Qm().optional(),onumber:()=>Ym().optional(),optional:tk,ostring:()=>qm().optional(),pipeline:nk,preprocess:sk,promise:ek,record:KM,set:ZM,strictObject:HM,string:qm,symbol:kM,transformer:Xm,tuple:$M,undefined:IM,union:WM,unknown:OM,void:NM,NEVER:Fe,ZodIssueCode:X,quotelessJson:aM,ZodError:hi});function ok(e){throw new Error("Unexpected object: "+e)}const rk=-2147483648,Jm=-9007199254740991n,lk=NaN,ak=NaN,ck=null,dk=null;function eC(e,t){switch(t){case"Int":return e===rk;case"Long":return e===Number(Jm)||e===Jm;case"Float":return e===lk;case"Double":return e===ak;case"String":return e===ck;case"Bytes":return e===dk;default:throw Error(`unsupported data type: ${t}`)}}function uk(e,t){const i=Math.floor(t/8),s=1<<7-t%8;return(e[i]&s)>0}function tC(e){const{type:t,name:i,domain:s}=e;return{type:t,name:i,...s&&{domain:s}}}function Wu(e){return e.map(tC)}function ja(e,t){switch(e.type){case"column":return{type:"column",column:t(e.column)};case"inner":case"full":return{type:e.type,entries:e.entries.map(i=>ja(i,t))};case"outer":return{type:"outer",primary:ja(e.primary,t),secondary:e.secondary.map(i=>ja(i,t))};default:ok(e)}}Ka.object({__isRef:Ka.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Ka.string().describe("Upstream block id"),name:Ka.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 hk(e){if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function pk(){return hk()}function gk(e){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(e)}function iC(){const e=gk("AGGRID_LICENSE");e?(Bm.setLicenseKey(e),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const sC=Symbol("sdk-vue");function zu(){return l.inject(sC)}function fk(e,t){let i;iC();const s=()=>{e.loadBlockState().then(o=>{n.loaded=!0;const r=Iy(o,e),a=t(r);i=Object.assign(r,{...a,routes:Object.fromEntries(Object.entries(a.routes).map(([d,h])=>[d,l.markRaw(h)]))})}).catch(o=>{console.error("load initial state error",o),n.error=o})},n=l.reactive({loaded:!1,error:void 0,useApp(){return ft(i,"App is not loaded")},install(o){o.provide(sC,this),s()}});return n}var mk=Object.defineProperty,Ck=(e,t,i)=>t in e?mk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,vk=(e,t,i)=>Ck(e,t+"",i);const wk=10,Sk=30,yk=[{text:"Delete row",value:"delete:row"},{text:"Update value",value:"update:value"}],bk=[{text:"Delete column",value:"delete:column"},{text:"Fit content",value:"expand:column"}],Rk=["^data-row-index"],Fk=["value"],Ek=l.defineComponent({__name:"TdCell",props:{cell:{},showContextOptions:{type:Function},cellEvents:{}},emits:["delete:row","update:value"],setup(e,{emit:t}){const i=t,s=e,n=l.reactive({edit:!1});function o(h){i("update:value",{rowIndex:s.cell.rowIndex,name:s.cell.colName,value:h.target.value}),n.edit=!1}function r(){const h=s.cellEvents??[];if(!s.showContextOptions){console.warn("inject showContextOptions interface for the table");return}const p=yk.filter(f=>h.includes(f.value));p.length&&s.showContextOptions(p,f=>{i(f,s.cell.rowIndex)})}const a=l.ref();function d(){s.cell.editable&&(n.edit=!0,requestAnimationFrame(()=>{var h,p;(p=(h=a.value)==null?void 0:h.querySelector("input"))==null||p.focus()}))}return(h,p)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"cellRef",ref:a,class:l.normalizeClass(["cell",{[h.cell.class]:!0,edit:n.edit}]),"^data-row-index":h.cell.rowIndex,onContextmenu:r,onClick:l.withModifiers(d,["stop"])},[n.edit?(l.openBlock(),l.createElementBlock("input",{key:0,value:h.cell.value,onFocusout:p[0]||(p[0]=f=>n.edit=!1),onChange:o},null,40,Fk)):l.renderSlot(h.$slots,"default",{key:1})],42,Rk))}});function dt(e,t,i,s=!1){l.onMounted(()=>{var n;return(n=l.unref(e))==null?void 0:n.addEventListener(t,i,s)}),l.onUnmounted(()=>{var n;return(n=l.unref(e))==null?void 0:n.removeEventListener(t,i,s)})}function xk(e){l.onMounted(()=>window.addEventListener("mouseup",e)),l.onUnmounted(()=>window.removeEventListener("mouseup",e))}function nC(e){let t=!1;return function(...i){t?console.log("handle pressure"):(requestAnimationFrame(()=>{e(...i),t=!1}),t=!0)}}function Pk(e,t){let i;function s(o){i={...o}}xk(()=>{i=void 0,t()});const n=nC(e);return dt(window,"mousemove",o=>{i&&n({x:i.x,width:i.width,diff:o.x-i.x})}),{start:s}}var Dk=Object.defineProperty,Tk=(e,t,i)=>t in e?Dk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Uu=(e,t,i)=>Tk(e,typeof t!="symbol"?t+"":t,i);function $u(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function Ak(e,t){if(e===void 0)throw Error(t??"Undefined value");return e}function Mk(e=void 0){return e}function kk(e){return e}function Ik(e){return[...new Set(e)]}function Lk(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value")}function _k(e,t){if(e===void 0)throw Error(t??"Undefined value")}function oC(e,t,i){const s=Math.min(t,i),n=Math.max(t,i);return e>=s&&e<=n}function Ok(e){return e.map(t=>({text:String(t),value:t}))}function Vk(e){return function(...t){const i=e(...t);async function s(n){return n.done?Promise.resolve(n.value):Promise.resolve(n.value).then(o=>s(i.next(o))).catch(o=>s(i.throw(o)))}try{return s(i.next())}catch(n){return Promise.reject(n)}}}class Nk{constructor(){Uu(this,"promise"),Uu(this,"resolve",()=>{}),Uu(this,"reject",()=>{}),this.promise=new Promise((t,i)=>{this.resolve=t,this.reject=i})}}function Za(e){return new Promise(t=>setTimeout(t,e))}function Bk(){return new Promise(e=>queueMicrotask(e))}function Gk(){const e=new Date().getTime();return function(){return new Date().getTime()-e}}function Hk(){const e=performance.now();return function(){return performance.now()-e}}function rC(e){return e()}function rl(e,t,i){return t>e?t:e>i?i:e}function Ku(e,t){return t(e)}function dn(e,t){if(e!=null)return t(e)}function Wk(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function*lC(e,t,i=1){for(let s=e;s<t;s+=i)yield s}function aC(e){const t=[];for(const i of e)t.push(i);return t}function zk(e,t){return aC(lC(0,e)).map(t)}class Uk{constructor(t){this._delay=t}async*generate(){let t=0;for(;;)await Za(this._delay),yield t++}async*[Symbol.asyncIterator](){let t=0;for(;;)await Za(this._delay),yield t++}}function $k(e,t){return Array.from({length:e},(i,s)=>t(s))}function Kk(e,t){throw Error(t)}function jk(e){return t=>e[t]()}function cC(e){if(e&&e.ok)return e.value}function Zk(e){if(e&&!e.ok)return e.error}function qk(e){if(e.ok)return e.value;throw Error(e.error)}function Yk(e){return Array.isArray(e)?e:[e]}async function dC(e){return Object.fromEntries(await Promise.all(Object.entries(e).map(async([t,i])=>[t,await i])))}function Qk(e,t){return Object.keys(t).every(i=>e[i]===t[i])}const ju=e=>e;function Xk(e){return e}function Jk(e){return Object.entries(e).map(([t,i])=>({key:t,value:i}))}const qa=Object.freeze(Object.defineProperty({__proto__:null,Deferred:Nk,Interval:Uk,alike:Qk,arrayFrom:$k,asConst:Xk,async:Vk,between:oC,bool:kk,call:rC,checkIfDefined:_k,checkIfNotEmpty:Lk,clamp:rl,delay:Za,errorOptional:Zk,exhaustive:Kk,flatValue:Yk,identity:ju,listToOptions:Ok,match:jk,notEmpty:$u,notUndef:Ak,okOptional:cC,performanceTimer:Hk,randomInt:Wk,range:lC,resolveAwaited:dC,tap:Ku,tapIf:dn,tear:Bk,timer:Gk,times:zk,toList:aC,undef:Mk,unionize:Jk,uniqueValues:Ik,unwrap:qk},Symbol.toStringTag,{value:"Module"}));function eI(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function tI(e){return e=e.replace(" ","-"),(e[0]||"").toLowerCase()+e.slice(1).replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function iI(e,t=[]){for(e=e?String(e):"";t.includes(e.charAt(0));)e=e.substr(1);for(;t.includes(e.charAt(e.length-1));)e=e.substr(0,e.length-1);return e}function uC(e){return e.replace(/^.*[\\/]/,"")}function hC(e){return e.replace(/^.*?[.]/,"")}function sI(e,t){const i=[];if(e.dataTransfer)for(let s=0;s<e.dataTransfer.items.length;s++){if(e.dataTransfer.items[s].kind!=="file")continue;const n=e.dataTransfer.items[s].getAsFile();n&&n.path&&i.push(n.path)}return t?i.filter(s=>t.includes(hC(uC(s)))):i}const nI=(e,t,i="s")=>`${e} ${t}${e!==1?i:""}`;function oI(e){try{return new RegExp(e),!0}catch{return!1}}function rI(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function lI(e){return e?e.charAt(0).toLowerCase()+e.slice(1):""}function pC(e){let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(eI(65,91));return t}function gC(){return pC(42)}function aI(e,t){return e.substring(0,e.indexOf(t))}function cI(e,t){return e.substring(0,e.lastIndexOf(t))}function dI(e,t){return e.substring(e.indexOf(t)+t.length,e.length)}function uI(e){if(typeof e!="string")throw Error("Expect string value, got: "+typeof e)}function hI(e){let t=0,i,s;if(e.length===0)return t;for(i=0;i<e.length;i++)s=e.charCodeAt(i),t=(t<<5)-t+s,t|=0;return t}const pI=Object.freeze(Object.defineProperty({__proto__:null,after:dI,assertString:uI,before:aI,beforeLast:cI,camelToKebab:tI,extractExtension:hC,extractFileName:uC,extractPaths:sI,hashCode:hI,isRegexpValid:oI,lcFirst:lI,pluralize:nI,randomString:pC,trimChars:iI,ucFirst:rI,uniqueId:gC},Symbol.toStringTag,{value:"Module"}));function ll(e){return e!==null&&typeof e=="object"}function gI(e,t){return Object.keys(e).map(i=>t(e[i],i))}function Zu(e,t){return ll(e)&&ll(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>Zu(e[i],t[i])):e===t}function al(e){if(Array.isArray(e)){const t=[];for(let i=0;i<e.length;i++)t[i]=al(e[i]);return t}else if(ll(e)){const t={};return Object.keys(e).forEach(i=>{t[i]=al(e[i])}),t}else return e}function fI(e){return Array.isArray(e)?Object.assign([],e):ll(e)?Object.assign({},e):e}function mI(e,t){const i={};for(const s in t)t[s]!==e[s]&&(i[s]=e[s]);return i}function CI(e,t,i){return Object.assign({},e,{[t]:i})}function vI(e){return Object.entries(e).forEach(([t,i])=>{i instanceof Function&&(e[t]=i.bind(e))}),e}function wI(e,t,i){return e[t]=i,e}function SI(e,t){return e[t]}function yI(e,t){e={...e};const i=e[t];return delete e[t],[i,e]}function bI(e,...t){return Object.assign({},...t.map(i=>({[i]:e[i]})))}function RI(e,...t){return t.map(i=>e[i])}function FI(e,...t){const i=Object.assign({},e);return t.forEach(s=>delete i[s]),i}const qu=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:vI,deepClone:al,deepEqual:Zu,getProp:SI,iSet:CI,isObject:ll,map:gI,omit:FI,pick:bI,pickValues:RI,setProp:wI,shallowClone:fI,shallowDiff:mI,shiftProp:yI},Symbol.toStringTag,{value:"Module"}));function EI(e,t){const i=e.findIndex(t);if(i<0)return[];const s=(()=>{for(let n=i;n<e.length;n++)if(!t(e[n],n))return n;return e.length})();return e.slice(i,s)}function fC(e,t,i){let s;return function(...n){s&&clearTimeout(s),s=setTimeout(()=>{s=void 0,e.apply(this,n)},t)}}const xI=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],PI=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],DI=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],TI=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],mC=(e,t)=>{let i=String(e);return typeof t=="string"||Array.isArray(t)?i=e.toLocaleString(t):t===!0&&(i=e.toLocaleString(void 0)),i};function Yu(e,t){if(e=typeof e=="bigint"?Number(e):e,!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);Object.assign(t,{bits:!1,binary:!1});const i=t.bits?t.binary?TI:DI:t.binary?PI:xI;if(t.signed&&e===0)return` 0 ${i[0]}`;const s=e<0,n=s?"-":t.signed?"+":"";if(s&&(e=-e),e<1){const d=mC(e,t.locale);return n+d+" "+i[0]}const o=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),i.length-1);e/=(t.binary?1024:1e3)**o,e=Number(e.toPrecision(3));const r=mC(Number(e),t.locale),a=i[o];return n+r+" "+a}function AI(e){var t;const i=qa.tapIf((t=l.unref(e))==null?void 0:t.querySelectorAll(".th-cell"),s=>[...s])??[];return i.map((s,n)=>{const{width:o,x:r}=s.getBoundingClientRect();return{index:n,width:o,x:r,right:r+o}}).slice(0,i.length-1)}function Qu(){const e=l.reactive({x:0,y:0});function t(i){e.x=i.pageX,e.y=i.pageY}return l.onMounted(()=>window.addEventListener("mousemove",t)),l.onUnmounted(()=>window.removeEventListener("mousemove",t)),e}function Xu(e,t={}){const{delayEnter:i=0,delayLeave:s=0}=t,n=l.ref(!1);let o;const r=a=>{const d=a?i:s;o&&(clearTimeout(o),o=void 0),d?o=setTimeout(()=>n.value=a,d):n.value=a};return window&&(dt(e,"mouseenter",()=>r(!0)),dt(e,"mouseleave",()=>r(!1))),n}const{tapIf:MI,clamp:kI}=qa;function II(e,t){const i=Qu(),s=Xu(t,{}),n=Pk(r=>{MI(e.resizeTh,a=>{e.columnsMeta[a.index]={width:kI(r.width+r.diff,Sk,1e4)}})},()=>{e.resize=!1,e.resizeTh=void 0,document.body.style.cursor=""});function o(r){e.resizeTh&&(e.resize=!0,n.start({x:r.x,width:e.resizeTh.width}))}return l.watchEffect(()=>{if(!s.value){document.body.style.cursor="";return}if(e.resize)return;const r=AI(t).find(a=>Math.abs(i.x-a.right)<wk);r?(document.body.style.cursor="col-resize",e.resizeTh=r):(e.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:o}}const Yn=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},LI={},_I={class:"add-column-btn"};function OI(e,t){return l.openBlock(),l.createElementBlock("div",_I,t[0]||(t[0]=[l.createElementVNode("div",null,null,-1)]))}const VI=Yn(LI,[["render",OI]]),NI={},BI={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GI(e,t){return l.openBlock(),l.createElementBlock("svg",BI,t[0]||(t[0]=[l.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),l.createTextVNode(),l.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 HI=Yn(NI,[["render",GI]]),WI=l.defineComponent({__name:"ThCell",props:{col:{},showContextOptions:{type:Function},columnEvents:{}},emits:["delete:column","expand:column","change:sort"],setup(e,{emit:t}){const i=t,s=e;function n(a,d){const h=d.indexOf(a)+1;return d[h>=d.length?0:h]}function o(){const a=s.columnEvents??[];if(!s.showContextOptions){console.warn("inject showContextOptions interface for the table");return}const d=bk.filter(h=>a.includes(h.value));d.length&&s.showContextOptions(d,h=>{i(h,s.col.name)})}function r(a,d){i("change:sort",{colName:a,direction:n(d??"DESC",["DESC","ASC"])})}return(a,d)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["cell th-cell",{"justify-center":a.col.justify}]),onContextmenu:o},[a.col.valueType?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(a.col.valueType)},null,2)):l.createCommentVNode("",!0),l.createTextVNode(" "+l.toDisplayString(a.col.text)+" ",1),a.col.sort?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["sort",a.col.sort.direction]),onClick:d[0]||(d[0]=l.withModifiers(()=>{var h;return r(a.col.name,(h=a.col.sort)==null?void 0:h.direction)},["stop"]))},null,2)):l.createCommentVNode("",!0)],34))}}),zI=l.defineComponent({__name:"TRow",props:{index:{},visible:{type:Boolean},height:{}},setup(e){return(t,i)=>(l.openBlock(),l.createElementBlock("div",{class:"t-row",style:l.normalizeStyle(`height: ${t.height}px`)},[t.visible?l.renderSlot(t.$slots,"default",{key:0}):l.createCommentVNode("",!0)],4))}});function CC(e){return typeof e=="number"||typeof e=="string"?e:String(e)}function UI(e,t,i){for(const[s,n]of Object.entries(e)){const o=CC(t[s]),r=CC(i[s]),a=n==="DESC"?-1:1;if(o!==r)return(o>r?1:-1)*a}return 0}function vC(e){return e()}function Ju(e,t){if(e==null)throw Error(t);return e}function eh(e){let t=!1;return function(...i){t||(requestAnimationFrame(()=>{e(...i),t=!1}),t=!0)}}function wC(e){return new Promise(t=>setTimeout(t,e))}function SC(e,t){const i=setTimeout(e,t);return()=>{clearTimeout(i)}}function yC(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function $I(e){let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(yC(65,91));return t}function bC(e){return function(t){return 1-e(1-t)}}function KI(e){return function(t){return t<.5?e(2*t)/2:(2-e(2*(1-t)))/2}}function RC(e){const{duration:t,draw:i,timing:s}=e,n=performance.now();let o=!1;return requestAnimationFrame(function r(a){let d=(a-n)/t;(d>1||o)&&(d=1);const h=s(d);i(h),d<1&&requestAnimationFrame(r)}),function(){o=!0}}function jI(e){const{getFraction:t,draw:i,timing:s}=e,n=performance.now();let o=!1;return requestAnimationFrame(function r(a){let d=t(a-n);if(o)return;d>1&&(d=1);const h=s(d);i(h),d<1&&requestAnimationFrame(r)}),function(){o=!0}}function FC(e,t){let i=-1;return(...s)=>{i!==-1&&(clearTimeout(i),i=-1),i=window.setTimeout(()=>e(...s),t)}}function th(e,t,i=!0){let s=0,n;return function(...o){n=()=>{e.apply(this,o),s=new Date().getTime()+t,n=null,i&&setTimeout(()=>{n&&n()},t)},new Date().getTime()>s&&n()}}function ZI(e){return e.map(t=>({text:String(t),value:t}))}function zo(e){return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value}))}const ih=40,qI=l.defineComponent({__name:"index",props:{settings:{}},emits:["click:cell","delete:row","delete:column","change:sort","update:value"],setup(e){const{tapIf:t,tap:i}=qa,{uniqueId:s}=pI,n=e,o=l.reactive({rowIndex:-1,columnsMeta:{},resize:!1,resizeTh:void 0,bodyHeight:0,scrollTop:0}),r=l.ref(),a=l.ref(),d=l.ref(),h=()=>{t(d.value,I=>{o.bodyHeight=I.getBoundingClientRect().height})},p=l.computed(()=>n.settings.autoLastColumn?[...n.settings.columns,{name:s(),text:"_"}]:n.settings.columns),f=l.computed(()=>{const{columnsMeta:I}=o,V=l.unref(p),L=Object.keys(I).length;return V.map((A,k)=>k==V.length-1?L?"minmax(100px, 1fr)":A.width??"minmax(100px, 1fr)":I[k]?I[k].width+"px":A.width??"140px").join(" ")}),m=l.computed(()=>({gridColumn:"1 / "+l.unref(p).length+1})),v=l.computed(()=>l.unref(p).reduce((I,V)=>(I[V.name]=V.justify?"justify-"+V.justify:"",I),{})),w=l.computed(()=>{const I=l.unref(p),V=n.settings.rows.slice(),{bodyHeight:L,scrollTop:A}=o;if(n.settings.selfSort){const $=I.reduce((U,Q)=>{var ce;return(ce=Q.sort)!=null&&ce.direction&&(U[Q.name]=Q.sort.direction),U},{});Object.keys($).length&&V.sort((U,Q)=>UI($,U,Q))}const k=160;let N=0;return V.map(($,U)=>{const Q=i($.__height?Number($.__height):ih,ue=>!Number.isFinite(ue)||ue<ih?ih:ue),ce=I.map(ue=>{const ie=ue.name;return{colName:ie,rowIndex:U,value:$[ie],class:v.value[ie]+(U===o.rowIndex?" hovered":""),slot:ue.slot,editable:ue.editable}}),me=L?A<N+Q+k&&N<L+A+k:!1;return N+=Q+1,{visible:me,height:Q,cells:ce}})}),{mouseDown:S}=II(o,r);function b(){t(a.value,I=>{var V;I.scrollLeft=((V=d.value)==null?void 0:V.scrollLeft)??0})}const R=th(()=>{var I;o.scrollTop=((I=d.value)==null?void 0:I.scrollTop)??0},10),x=()=>{b(),R()};function T(I){const V=p.value.findIndex(A=>A.name===I);if(V<0)return;const L=n.settings.rows.reduce((A,k)=>{const N=9.52*qa.call(()=>{const $=k[I];return $&&typeof $=="object"&&"segments"in $?$.segments.map(U=>U.sequence).join("").length:String($??"").length});return N>A?N:A},0);o.columnsMeta[V]={width:L}}return l.onMounted(()=>{l.nextTick(h)}),l.watchPostEffect(()=>{l.unref(n.settings),l.nextTick(h)}),dt(window,"resize",()=>l.nextTick(h)),(I,V)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"tableRef",ref:r,class:"grid-table",onMousedown:V[5]||(V[5]=(...L)=>l.unref(S)&&l.unref(S)(...L))},[I.settings.addColumn?(l.openBlock(),l.createBlock(VI,{key:0,onClick:l.withModifiers(I.settings.addColumn,["stop"])},null,8,["onClick"])):l.createCommentVNode("",!0),V[9]||(V[9]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"headRef",ref:a,class:"table-head",style:l.normalizeStyle({gridTemplateColumns:f.value})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,(L,A)=>(l.openBlock(),l.createBlock(WI,{key:A,col:L,"show-context-options":I.settings.showContextOptions,"column-events":I.settings.columnEvents,"onDelete:column":V[0]||(V[0]=k=>I.$emit("delete:column",k)),"onChange:sort":V[1]||(V[1]=k=>I.$emit("change:sort",k)),"onExpand:column":V[2]||(V[2]=k=>T(k))},null,8,["col","show-context-options","column-events"]))),128))],4),V[10]||(V[10]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"bodyRef",ref:d,class:"table-body",onScroll:x},[w.value.length===0?(l.openBlock(),l.createElementBlock("div",{key:0,class:"table-body__no-data",style:l.normalizeStyle(m.value)},[l.createElementVNode("div",null,[l.createVNode(HI),V[6]||(V[6]=l.createTextVNode()),V[7]||(V[7]=l.createElementVNode("div",null,"No Data To Show",-1))])],4)):l.createCommentVNode("",!0),V[8]||(V[8]=l.createTextVNode()),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,(L,A)=>(l.openBlock(),l.createBlock(zI,{key:A,visible:L.visible,height:L.height,index:A,style:l.normalizeStyle({gridTemplateColumns:f.value})},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(L.cells,(k,N)=>(l.openBlock(),l.createBlock(Ek,{key:N,cell:k,"show-context-options":I.settings.showContextOptions,"cell-events":I.settings.cellEvents,onClick:l.withModifiers($=>I.$emit("click:cell",k),["stop"]),"onDelete:row":V[3]||(V[3]=$=>I.$emit("delete:row",$)),"onUpdate:value":V[4]||(V[4]=$=>I.$emit("update:value",$))},{default:l.withCtx(()=>[k.slot?l.renderSlot(I.$slots,k.colName,l.mergeProps({key:0,ref_for:!0},k),()=>[l.createTextVNode(l.toDisplayString(k.value),1)]):l.renderSlot(I.$slots,"default",l.mergeProps({key:1,ref_for:!0},k),()=>[l.createTextVNode(l.toDisplayString(k.value),1)])]),_:2},1032,["cell","show-context-options","cell-events","onClick"]))),128))]),_:2},1032,["visible","height","index","style"]))),128))],544)],544))}}),YI={class:"context-menu"},QI=["onClick"],XI=l.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(e,{emit:t}){const i=t,s=n=>{n.cb(),i("close")};return(n,o)=>(l.openBlock(),l.createElementBlock("div",YI,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.options,(r,a)=>(l.openBlock(),l.createElementBlock("div",{key:a,onClick:l.withModifiers(d=>s(r),["stop"])},[l.createElementVNode("span",null,l.toDisplayString(r.text),1)],8,QI))),128))]))}}),JI=Yn(XI,[["__scopeId","data-v-12530966"]]);function sh(e,t){e.preventDefault();const i=()=>{l.render(null,document.body)},s=l.h(JI,{options:t,onClose:()=>{i()}});l.render(s,document.body);const n=s.el;return n.style.top=e.clientY+"px",n.style.left=e.clientX+"px",document.addEventListener("click",o=>{n.contains(o.target)||i()}),i}const EC=Symbol(),Ya=()=>l.inject(EC),eL=["value"],tL={key:1},iL=l.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=l.reactive({edit:!1}),o=l.computed(()=>s.valueType),r=h=>{var p;let f=(p=h.target)==null?void 0:p.value;const m=l.unref(o),v=rC(()=>m==="integer"?parseInt(f,10):m==="float"?Number(f):f);i("update:modelValue",v),n.edit=!1},a=l.ref(),d=h=>{!h.metaKey&&s.editable&&(n.edit=!0,requestAnimationFrame(()=>{var p,f;(f=(p=a.value)==null?void 0:p.querySelector("input"))==null||f.focus()}))};return(h,p)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"baseRef",ref:a,class:l.normalizeClass(["base-cell",{"base-cell__edit":n.edit}]),onClick:d},[n.edit?(l.openBlock(),l.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:p[0]||(p[0]=f=>n.edit=!1),onChange:r},null,40,eL)):(l.openBlock(),l.createElementBlock("div",tL,l.toDisplayString(h.modelValue),1))],2))}}),sL=["^data-row-index"],nL={key:0,class:"control-cell"},oL=l.defineComponent({__name:"TdCell",props:{cell:{}},setup(e){const t=e,i=Ya(),s=l.computed(()=>t.cell.column.valueType),n=h=>{dn(i.settings.value.onUpdatedRow,p=>{const f=t.cell.row,m={...f.dataRow,[t.cell.id]:h};p({...f,dataRow:m})})},o=h=>{h.metaKey&&i.selectRow(t.cell.row.primaryKey)},r=(h,p)=>{if(h.type==="contextmenu")h.preventDefault();else return;const f=i.settings??{},m=[],{onSelectedRows:v,onSelectedColumns:w}=f.value,S=i.data.selectedRows.has(p.primaryKey);v&&v.length&&(S?m.push({text:"Deselect row",cb(){i.data.selectedRows.delete(t.cell.row.primaryKey)}}):m.push({text:"Select row",cb(){i.selectRow(t.cell.row.primaryKey)}})),w&&w.length&&(m.push({text:"Select column",cb(){i.selectColumn(t.cell.column.id)}}),m.push({text:"Unselect column",cb(){i.unselectColumn(t.cell.column.id)}})),m.length&&sh(h,m)},a=l.ref(),d=l.computed(()=>t.cell.column.component?t.cell.column.component():void 0);return(h,p)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"cellRef",ref:a,class:l.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:o,onContextmenu:p[0]||(p[0]=f=>r(f,h.cell.row))},[h.cell.control?(l.openBlock(),l.createElementBlock("div",nL,l.toDisplayString(h.cell.row.index),1)):d.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":n},null,8,["model-value"])):(l.openBlock(),l.createBlock(iL,{key:2,"model-value":h.cell.value,"value-type":s.value,editable:h.cell.column.editable,"onUpdate:modelValue":n},null,8,["model-value","value-type","editable"]))],42,sL))}}),rL={},lL={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function aL(e,t){return l.openBlock(),l.createElementBlock("svg",lL,t[0]||(t[0]=[l.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),l.createTextVNode(),l.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 cL=Yn(rL,[["render",aL]]),dL={class:"tr-head"},uL=l.defineComponent({__name:"TrHead",setup(e){return(t,i)=>(l.openBlock(),l.createElementBlock("div",dL,[l.renderSlot(t.$slots,"default")]))}});function hL(e,t){const i=t.indexOf(e)+1;return t[i>=t.length?0:i]}function pL(e,t){const i=e.findIndex(t);if(i<0)return[];const s=(()=>{for(let n=i;n<e.length;n++)if(!t(e[n],n))return n;return e.length})();return e.slice(i,s)}const gL=["^data-col-id"],fL=l.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(e,{emit:t}){const i=t;function s(o){o.preventDefault();const r=[];r.length&&sh(o,r)}function n(o){var r;const a=((r=o.sort)==null?void 0:r.direction)??"DESC";i("change:sort",{colId:o.id,direction:hL(a,["DESC","ASC"])})}return(o,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["cell th-cell",{"justify-center":o.col.justify,frozen:o.col.frozen}]),"^data-col-id":o.col.id,onContextmenu:s},[o.col.valueType?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(o.col.valueType)},null,2)):l.createCommentVNode("",!0),l.createTextVNode(" "+l.toDisplayString(o.col.label)+" ",1),o.col.sort?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["sort",o.col.sort.direction]),onClick:r[0]||(r[0]=l.withModifiers(()=>n(o.col),["stop"]))},null,2)):l.createCommentVNode("",!0)],42,gL))}}),mL=l.defineComponent({__name:"TrBody",props:{row:{}},setup(e){const t=l.ref(),i=()=>{l.nextTick().then(()=>{dn(t.value,s=>s.scrollLeft=0)})};return(s,n)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"trRef",ref:t,class:l.normalizeClass(["tr-body",{selected:s.row.selected}]),scroll:"no",style:l.normalizeStyle(s.row.style),onScroll:i},[l.renderSlot(s.$slots,"default")],38))}}),CL=l.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(e){const t=Ya(),i=e,s=l.computed(()=>t.data.selectedColumns.has(i.column.id));return(n,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["column-caret",{selected:s.value,frozen:n.column.frozen}])},null,2))}});function vL(e){l.onMounted(()=>window.addEventListener("mouseup",e)),l.onUnmounted(()=>window.removeEventListener("mouseup",e))}function wL(e,t){let i;function s(o){i={...o}}vL(()=>{i=void 0,t()});const n=nC(e);return dt(window,"mousemove",o=>{i&&n({x:i.x,width:i.width,diff:o.x-i.x})}),{start:s}}const Uo=1,SL=10,yL=30,xC=60;function bL(e){var t;const i=dn((t=l.unref(e))==null?void 0:t.querySelectorAll(".th-cell"),s=>[...s])??[];return i.map(s=>{const{width:n,x:o}=s.getBoundingClientRect(),r=s.getAttribute("data-col-id");return ju({colId:r,width:n,x:o,right:o+n})}).slice(0,i.length-1)}function RL(e,t){const i=Qu(),s=Xu(t,{}),{data:n}=e,o=wL(a=>{dn(n.resizeTh,d=>{const h=n.columns.find(p=>p.id===d.colId);h&&(h.width=rl(a.width+a.diff,yL,1e4),e.adjustWidth())})},()=>{n.resize=!1,n.resizeTh=void 0,document.body.style.cursor=""}),r=a=>{n.resizeTh&&(n.resize=!0,o.start({x:a.x,width:n.resizeTh.width}))};return l.watchEffect(()=>{if(!s.value){document.body.style.cursor="";return}if(n.resize)return;const a=bL(t).find(d=>Math.abs(i.x-d.right)<SL);a?(document.body.style.cursor="col-resize",n.resizeTh=a):(n.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:r}}const FL={key:0,class:"command-menu"},EL={key:0},xL=["onClick"],PL=l.defineComponent({__name:"RowsCommandMenu",setup(e){const t=Ya(),i=l.computed(()=>t.getSelectedRows()),s=l.computed(()=>i.value.length>0),n=l.computed(()=>{var r;return((r=t.settings)==null?void 0:r.value.onSelectedRows)??[]}),o=l.computed(()=>n.value.map(r=>({label:r.label,cb:()=>{r.cb(i.value),t.data.selectedRows.clear(),t.data.rows=[]}})));return(r,a)=>s.value?(l.openBlock(),l.createElementBlock("div",FL,[i.value.length?(l.openBlock(),l.createElementBlock("span",EL,l.toDisplayString(i.value.length)+" rows selected",1)):l.createCommentVNode("",!0),a[0]||(a[0]=l.createTextVNode()),a[1]||(a[1]=l.createElementVNode("hr",null,null,-1)),a[2]||(a[2]=l.createTextVNode()),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(d,h)=>(l.openBlock(),l.createElementBlock("span",{key:h,class:"command",onClick:l.withModifiers(d.cb,["stop"])},l.toDisplayString(d.label),9,xL))),128))])):l.createCommentVNode("",!0)}}),DL={key:0,class:"command-menu"},TL={key:0},AL=["onClick"],ML=l.defineComponent({__name:"ColumnsCommandMenu",setup(e){const t=Ya(),i=l.computed(()=>t.getSelectedColumns()),s=l.computed(()=>i.value.length>0),n=l.computed(()=>{var r;return((r=t.settings)==null?void 0:r.value.onSelectedColumns)??[]}),o=l.computed(()=>n.value.map(r=>({label:r.label,cb:()=>{r.cb(i.value),t.data.selectedColumns.clear()}})));return(r,a)=>s.value?(l.openBlock(),l.createElementBlock("div",DL,[i.value.length?(l.openBlock(),l.createElementBlock("span",TL,"selected columns "+l.toDisplayString(i.value.length),1)):l.createCommentVNode("",!0),a[0]||(a[0]=l.createTextVNode()),a[1]||(a[1]=l.createElementVNode("hr",null,null,-1)),a[2]||(a[2]=l.createTextVNode()),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(d,h)=>(l.openBlock(),l.createElementBlock("span",{key:h,class:"command",onClick:l.withModifiers(d.cb,["stop"])},l.toDisplayString(d.label),9,AL))),128))])):l.createCommentVNode("",!0)}});function un(e,t){const i={el:void 0,x:0,y:0},s=n=>({x:n.x,y:n.y,dx:n.x-i.x,dy:n.y-i.y});dt(document,"mousedown",n=>{n.target===l.unref(e)&&(n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),i.el=l.unref(e),i.x=n.x,i.y=n.y)}),dt(document,"mouseup",n=>{i.el&&(i.el=void 0,t({...s(n),stop:!0},i))}),dt(document,"mousemove",n=>{i.el&&t(s(n),i)})}const kL=l.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(e,{emit:t}){const i=t,s=e,n=l.ref(),o=l.computed(()=>s.windowSize-12),r=l.computed(()=>s.windowSize<s.dataSize),a=l.computed(()=>Math.ceil(s.offset*(o.value/s.dataSize))),d=l.computed(()=>Math.ceil(o.value*o.value/s.dataSize)),h=l.computed(()=>({top:`${a.value}px`,height:`${d.value}px`}));return un(n,(p,f)=>{const m=(a.value+p.dy)*s.dataSize/o.value;i("change:offset",m),f.x=p.x,f.y=p.y}),(p,f)=>(l.openBlock(),l.createElementBlock("div",{class:"t-scroll",style:l.normalizeStyle({height:`${p.windowSize}px`})},[l.createElementVNode("div",null,[r.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"handleRef",ref:n,class:"t-scroll__handle",style:l.normalizeStyle(h.value)},null,4)):l.createCommentVNode("",!0)])],4))}});function IL(e){return l.computed(()=>{const{data:t,settings:i}=e,{bodyWidth:s,scrollLeft:n}=t,o=[...t.columns],r=gC();i.value.controlColumn&&o.unshift({id:r,label:"#",width:60,frozen:!0});let a=0;const d=o.map(p=>{const f={...p,offset:a};return a+=p.width+Uo,f}),h=d.filter(p=>p.frozen);return EI(d,p=>p.frozen?!1:n<p.offset+p.width&&p.offset<s+n).concat(h).map(p=>({...p,style:{left:p.frozen?`${p.offset}px`:`${p.offset-t.scrollLeft}px`,width:`${p.width}px`},control:p.id===r}))})}function LL(e,t){const i=l.computed(()=>t.value.reduce((s,n)=>(s[n.id]=n.justify?"justify-"+n.justify:"",s),{}));return l.computed(()=>e.rows.map(s=>{const n=i.value,{primaryKey:o,offset:r,dataRow:a,height:d}=s,h=t.value.map(p=>({id:p.id,column:p,row:s,value:a[p.id],class:n[p.id],editable:p.editable,width:p.width,style:p.style,control:p.control}));return ju({style:{top:`${r-e.scrollTop}px`,height:`${s.height}px`},primaryKey:o,offset:r,height:d,cells:h,selected:e.selectedRows.has(o)})}))}const _L=async(e,t)=>{const{scrollTop:i,bodyHeight:s}=e;return await Za(0),dC({rows:t.getRows(i,s),dataWindow:e})};function OL(e){const t=l.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:e.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});l.watch(()=>e.settings,p=>{t.columns=al(p.columns),t.currentWindow=void 0,p.dataSource.getHeight().then(f=>{t.dataHeight=f,h.updateBodyHeight()}).catch(f=>t.error=f)},{immediate:!0});const i=l.computed(()=>e.settings),s=l.computed(()=>t.columns.reduce((p,f)=>p+f.width+Uo,0)),n=l.computed(()=>Ku(h.data.dataHeight-h.data.bodyHeight,p=>p>0?p:0)),o=l.computed(()=>Ku(s.value-h.data.bodyWidth,p=>p>0?p:0)),r=l.computed(()=>({bodyHeight:t.bodyHeight,scrollTop:t.scrollTop,current:t.currentWindow})),a=IL({data:t,settings:i}),d=LL(t,a),h={data:t,settings:i,tableColumns:a,tableRows:d,adjustWidth:()=>{const p=t.columns.reduce((m,v)=>m+v.width+Uo,0),f=t.bodyWidth+t.scrollLeft;if(p<f){const m=t.columns[t.columns.length-1];m.width=m.width+(f-p)}},updateOffsets(p){this.updateScrollTop(t.scrollTop+p.deltaY),this.updateScrollLeft(t.scrollLeft+p.deltaX)},getSelectedRows(){return t.rows.filter(p=>t.selectedRows.has(p.primaryKey))},getSelectedColumns(){return t.columns.filter(p=>t.selectedColumns.has(p.id))},selectRow(p){t.selectedRows.add(p)},unselectRow(p){t.selectedRows.delete(p)},selectColumn(p){t.selectedColumns.add(p)},unselectColumn(p){t.selectedColumns.delete(p)},updateScrollTop(p){t.scrollTop=rl(p,0,n.value)},updateScrollLeft(p){t.scrollLeft=rl(p,0,o.value)},updateBodyHeight(){const{height:p}=e.settings,{dataHeight:f}=t,m=p>f?f:p;t.bodyHeight=m},updateDimensions(p){this.updateBodyHeight(),h.data.bodyWidth=p.width,h.adjustWidth(),t.rows=[],t.currentWindow=void 0}};return l.watch(r,(p,f)=>{const m=p.current;(!m||p.scrollTop<m.scrollTop||p.scrollTop+p.bodyHeight>m.bodyHeight+m.scrollTop)&&(t.currentWindow={scrollTop:p.scrollTop-xC,bodyHeight:p.bodyHeight+xC*2},_L(al(t.currentWindow),i.value.dataSource).then(({rows:v,dataWindow:w})=>{Zu(t.currentWindow,w)&&(t.rows=v)}))},{deep:!0,immediate:!0}),l.provide(EC,h),h}const VL={class:"command-menu__container"},NL={key:0,class:"table-body__no-data"},BL={class:"carets"},nh=l.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(e,{emit:t}){const i=t,s=e,n=OL(s),o=l.computed(()=>n.data.rows.length===0),r=l.computed(()=>({height:o.value?"212px":n.data.bodyHeight+"px"}));l.watch(n.data,S=>i("update:data",S),{deep:!0}),l.watch(s,()=>p);const a=l.ref(),d=l.ref(),h=l.ref(),p=()=>{dn(h.value,S=>{n.updateDimensions(S.getBoundingClientRect())})},f=n.tableColumns,m=n.tableRows,{mouseDown:v}=RL(n,a);l.onMounted(()=>{l.nextTick(p)}),l.watchPostEffect(()=>{l.unref(s.settings),l.nextTick(p)}),dt(window,"resize",()=>l.nextTick(p));const w=S=>{S.preventDefault(),n.updateOffsets(S)};return(S,b)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"tableRef",ref:a,class:"data-table",onMousedown:b[2]||(b[2]=(...R)=>l.unref(v)&&l.unref(v)(...R))},[l.createElementVNode("div",VL,[l.createVNode(PL),b[3]||(b[3]=l.createTextVNode()),l.createVNode(ML)]),b[7]||(b[7]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"headRef",ref:d,class:"table-head"},[l.createVNode(uL,null,{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(f),(R,x)=>(l.openBlock(),l.createBlock(fL,{key:x,col:R,style:l.normalizeStyle(R.style),"onChange:sort":b[0]||(b[0]=T=>S.$emit("change:sort",T))},null,8,["col","style"]))),128))]),_:1})],512),b[8]||(b[8]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:l.normalizeStyle(r.value),onWheel:w},[o.value?(l.openBlock(),l.createElementBlock("div",NL,[l.createElementVNode("div",null,[l.createVNode(cL),b[4]||(b[4]=l.createTextVNode()),b[5]||(b[5]=l.createElementVNode("div",null,"No Data To Show",-1))])])):l.createCommentVNode("",!0),b[6]||(b[6]=l.createTextVNode()),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(m),(R,x)=>(l.openBlock(),l.createBlock(mL,{key:x,row:R},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(R.cells,T=>(l.openBlock(),l.createBlock(oL,{key:T.column.id+":"+x,cell:T,style:l.normalizeStyle(T.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),b[9]||(b[9]=l.createTextVNode()),l.createElementVNode("div",BL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(f),(R,x)=>(l.openBlock(),l.createBlock(CL,{key:x,column:R,style:l.normalizeStyle(R.style),"onChange:sort":b[1]||(b[1]=T=>S.$emit("change:sort",T))},null,8,["column","style"]))),128))]),b[10]||(b[10]=l.createTextVNode()),l.createVNode(kL,{offset:l.unref(n).data.scrollTop,"window-size":l.unref(n).data.bodyHeight,"data-size":l.unref(n).data.dataHeight,"onChange:offset":l.unref(n).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),PC=new WeakMap;class GL{constructor(t,i,s){vk(this,"dataHeight"),this.datum=t,this.resolveHeight=i,this.resolvePrimaryKey=s;const n=t.reduce((r,a,d)=>(r.indices.set(d,r.total),r.total+=this.resolveHeight(a,d)+Uo,r),{total:0,indices:new Map});this.dataHeight=n.total;const o=t.map((r,a)=>({dataRow:r,index:a,primaryKey:this.resolvePrimaryKey(r,a),offset:$u(n.indices.get(a)),height:this.resolveHeight(r,a)}));PC.set(this,o)}get rows(){return PC.get(this)}async getHeight(){return this.dataHeight}async getRows(t,i){return pL(this.rows,s=>{const n=s.offset;return t<n+s.height&&n<i+t})}}class HL{constructor(t,i,s){this.api=t,this.rowHeight=i,this.resolvePrimaryKey=s}get height(){return this.rowHeight+Uo}async getHeight(){return await this.api.count()*this.height}async getRows(t,i){const s=rl(Math.floor(t/this.height),0,Number.POSITIVE_INFINITY),n=Math.ceil(i+40/this.height);return(await this.api.query({offset:s,limit:n})).map((o,r)=>({dataRow:o,index:s+r,primaryKey:this.resolvePrimaryKey(o,s+r),offset:(s+r)*(this.rowHeight+Uo),height:this.rowHeight}))}}function WL(e){return Object.freeze(e)}function zL(e){return l.h(nh,{settings:Object.freeze(e)})}function oh(e,t){const i=new GL(e,t.resolveRowHeight,t.resolvePrimaryKey);return{...t,dataSource:i}}function UL(e,t){return l.computed(()=>{const i=l.unref(e);return oh(i,l.unref(t))})}function $L(e,t){const i=l.computed(()=>{const n=l.unref(e);return oh(n,l.unref(t))}),s=l.reactive({settings:i});return l.computed(()=>l.h(nh,s))}const KL=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:HL,Component:nh,factory:zL,rawDataSettings:oh,settings:WL,useRawData:UL,useRawDataComponent:$L},Symbol.toStringTag,{value:"Module"}));function*jL(e,t){for(const i of e)yield t(i)}function ZL(e){const t=[];for(const i of e)t.push(i);return t}const rh=new Map;function qL(e){return rh.has(e)||rh.set(e,l.ref(localStorage.getItem(e))),Ju(rh.get(e),"...")}function YL(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,t)}function DC(e){const t=qL(e);return l.watch(t,i=>YL(e,i)),t}const lh=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{ZL(jL(lh.values(),t=>t(e.matches?"dark":"light")))});const QL=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",TC=l.ref(QL),ah=DC("theme");function AC(e){const t=l.computed(()=>ah.value?ah.value:TC.value),i=n=>{TC.value=n,e&&e(n)};function s(){ah.value=t.value==="light"?"dark":(t.value,"light")}return l.watch(t,n=>{e&&e(l.unref(n))}),l.onMounted(()=>{lh.add(i)}),l.onUnmounted(()=>{lh.delete(i)}),[t,s]}const XL=l.defineComponent({__name:"ThemeSwitcher",setup(e){const[t,i]=AC();return(s,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["ui-theme-switcher",l.unref(t)]),onClick:n[0]||(n[0]=(...o)=>l.unref(i)&&l.unref(i)(...o))},n[1]||(n[1]=[l.createElementVNode("div",null,null,-1)]),2))}}),JL={class:"pl-layout-component pl-block-page"},e_={key:0,class:"pl-block-page__title"},t_={class:"pl-block-page__title__append"},i_={key:1},s_={class:"pl-block-page__body"},n_={name:"PlBlockPage"},o_=l.defineComponent({...n_,setup(e){const t=l.useSlots();return(i,s)=>(l.openBlock(),l.createElementBlock("div",JL,[l.unref(t).title?(l.openBlock(),l.createElementBlock("div",e_,[l.createElementVNode("h1",null,[l.renderSlot(i.$slots,"title")]),s[0]||(s[0]=l.createTextVNode()),l.createElementVNode("div",t_,[l.renderSlot(i.$slots,"append")])])):(l.openBlock(),l.createElementBlock("div",i_)),s[1]||(s[1]=l.createTextVNode()),l.createElementVNode("div",s_,[l.renderSlot(i.$slots,"default")])]))}}),r_={name:"PlContainer"},l_=l.defineComponent({...r_,props:{width:{}},setup(e){const t=e,i=l.computed(()=>({width:t.width}));return(s,n)=>(l.openBlock(),l.createElementBlock("div",{class:"pl-container pl-layout-component",style:l.normalizeStyle(i.value)},[l.renderSlot(s.$slots,"default")],4))}}),a_={name:"PlRow"},c_=l.defineComponent({...a_,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(e){return(t,i)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["pl-layout-component pl-row",{wrap:t.wrap,"align-center":t.alignCenter}])},[l.renderSlot(t.$slots,"default")],2))}}),d_={class:"pl-layout-component",style:{"flex-grow":"1"}},u_={name:"PlSpacer"},h_=l.defineComponent({...u_,setup(e){return(t,i)=>(l.openBlock(),l.createElementBlock("div",d_))}}),p_={name:"PlGrid"},g_=l.defineComponent({...p_,props:{columns:{}},setup(e){const t=e,i=l.computed(()=>({gridTemplateColumns:`repeat(${t.columns}, minmax(0, 1fr))`}));return(s,n)=>(l.openBlock(),l.createElementBlock("div",{class:"pl-layout-component pl-grid",style:l.normalizeStyle(i.value)},[l.renderSlot(s.$slots,"default")],4))}}),f_={key:0,class:"pl-alert__icon"},m_={class:"pl-alert__main"},C_={key:0},v_={class:"pl-alert__main__text"},w_={name:"PlAlert"},S_=l.defineComponent({...w_,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(e){const t={success:"success",warn:"warning",info:"edit",error:"error"};return(i,s)=>i.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["pl-alert",[{monospace:i.monospace,whiteSpacePre:i.whiteSpacePre},i.type?`pl-alert__${i.type}`:""]]),style:l.normalizeStyle({maxHeight:i.maxHeight})},[i.icon&&i.type?(l.openBlock(),l.createElementBlock("div",f_,[l.createElementVNode("div",{class:l.normalizeClass(`icon-24 icon-${t[i.type]}`)},null,2)])):l.createCommentVNode("",!0),s[2]||(s[2]=l.createTextVNode()),l.createElementVNode("div",m_,[i.label?(l.openBlock(),l.createElementBlock("label",C_,l.toDisplayString(i.label),1)):l.createCommentVNode("",!0),s[1]||(s[1]=l.createTextVNode()),l.createElementVNode("div",v_,[l.renderSlot(i.$slots,"default")])]),s[3]||(s[3]=l.createTextVNode()),i.closeable?(l.openBlock(),l.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:s[0]||(s[0]=n=>i.$emit("update:modelValue",!1))})):l.createCommentVNode("",!0)],6)):l.createCommentVNode("",!0)}}),cl=l.defineComponent({__name:"MaskIcon16",props:{name:{},size:{}},setup(e){const t=e,i=l.computed(()=>t.size==="large"?"--mask-size: 24px":""),s=l.computed(()=>`mask-16 mask-${t.name}`);return(n,o)=>(l.openBlock(),l.createElementBlock("i",{style:l.normalizeStyle(i.value),class:l.normalizeClass(s.value)},null,6))}});function MC(e){function t(i){const s=i.currentTarget,n=document.createElement("span"),o=Math.max(s.clientWidth,s.clientHeight),r=o/2;n.style.width=n.style.height=`${o}px`,n.style.left=`${i.clientX-s.offsetLeft-r}px`,n.style.top=`${i.clientY-s.offsetTop-r}px`,n.classList.add("ripple");const a=s.getElementsByClassName("ripple")[0];a&&a.remove(),s.appendChild(n)}l.onMounted(()=>{var i;(i=e.value)==null||i.addEventListener("click",t)})}const y_={key:0},b_={inheritAttrs:!1},ch=l.defineComponent({...b_,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e,i=l.ref(),s=l.computed(()=>t.small||t.size==="small"),n=l.computed(()=>t.large||t.size==="large");return MC(i),(o,r)=>(l.openBlock(),l.createElementBlock("button",l.mergeProps({ref_key:"btn",ref:i,tabindex:"0",class:{loading:o.loading,small:s.value,large:n.value,round:o.round,reverse:o.reverse,justifyCenter:o.justifyCenter,[o.$attrs.class+""]:!0}},{...o.$attrs,disabled:!!o.$attrs.disabled||o.loading}),[o.round?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",y_,[l.renderSlot(o.$slots,"default")])),r[0]||(r[0]=l.createTextVNode()),o.loading?(l.openBlock(),l.createBlock(cl,{key:1,name:"loading",size:o.size},null,8,["size"])):o.icon?(l.openBlock(),l.createBlock(cl,{key:2,name:o.icon,size:o.size},null,8,["name","size"])):l.createCommentVNode("",!0)],16))}}),R_={name:"PlBtnPrimary"},kC=l.defineComponent({...R_,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(i,s)=>(l.openBlock(),l.createBlock(ch,l.mergeProps({class:"pl-btn-primary"},t),{default:l.withCtx(()=>[l.renderSlot(i.$slots,"default")]),_:3},16))}}),F_={name:"PlBtnAccent"},E_=l.defineComponent({...F_,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(i,s)=>(l.openBlock(),l.createBlock(ch,l.mergeProps({class:"ui-btn-accent"},t),{default:l.withCtx(()=>[l.renderSlot(i.$slots,"default")]),_:3},16))}}),x_={name:"PlBtnSecondary"},dh=l.defineComponent({...x_,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(i,s)=>(l.openBlock(),l.createBlock(ch,l.mergeProps(t,{class:"pl-btn-secondary"}),{default:l.withCtx(()=>[l.renderSlot(i.$slots,"default")]),_:3},16))}}),P_={key:0},D_={name:"PlBtnGhost"},IC=l.defineComponent({...D_,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!0}},setup(e){const t=e,i=l.computed(()=>t.size==="small"),s=l.computed(()=>t.size==="large"),n=l.ref(),o=l.useSlots();return MC(n),(r,a)=>(l.openBlock(),l.createElementBlock("button",l.mergeProps({ref_key:"btnRef",ref:n,tabindex:"0",class:["ui-btn-ghost",{loading:r.loading,small:i.value,large:s.value,round:r.round,reverse:r.reverse,justifyCenter:r.justifyCenter,[r.$attrs.class+""]:!0}]},{...r.$attrs,disabled:!!r.$attrs.disabled||r.loading}),[l.unref(o).default&&!r.round?(l.openBlock(),l.createElementBlock("span",P_,[l.renderSlot(r.$slots,"default")])):l.createCommentVNode("",!0),a[0]||(a[0]=l.createTextVNode()),r.loading?(l.openBlock(),l.createBlock(cl,{key:1,name:"loading",size:r.size},null,8,["size"])):r.icon?(l.openBlock(),l.createBlock(cl,{key:2,name:r.icon,size:r.size},null,8,["name","size"])):l.createCommentVNode("",!0)],16))}}),T_=l.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,i=l.ref(!1);return(s,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["ui-btn-link",{disabled:s.disabled,loading:s.loading,hover:i.value}]),onMouseover:n[0]||(n[0]=o=>i.value=!0),onMouseleave:n[1]||(n[1]=o=>i.value=!1)},[l.createVNode(dh,l.mergeProps({round:"",hover:i.value},t),null,16,["hover"]),n[2]||(n[2]=l.createTextVNode()),l.renderSlot(s.$slots,"default")],34))}});function LC(e,t){const i=eh(()=>{if(e.value){const{scrollTop:s,scrollLeft:n,scrollHeight:o,scrollWidth:r,clientHeight:a,clientWidth:d}=document.documentElement,h=e.value.getBoundingClientRect();t({scrollTop:s,scrollLeft:n,scrollHeight:o,scrollWidth:r,clientHeight:a,clientWidth:d,offsetY:s+h.y,offsetX:n+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});l.onMounted(i),dt(window,"scroll",i,!0),dt(window,"resize",i,!0),dt(window,"adjust",i,!0)}function A_(e,t){const i=l.ref();return LC(e,s=>{i.value=s}),l.computed(()=>{const s=l.unref(i),n=l.unref(t),o=n.position??"top",r=n.gap??8;if(!s)return"";const a=s.offsetY+Math.floor(s.height/2),d=s.offsetX+Math.floor(s.width/2);return o==="top-left"?`left: ${s.offsetX}px; top: ${s.offsetY-r}px;`:o==="top"?`left: ${d}px; top: ${s.offsetY-r}px;`:o==="right"?`left: ${s.offsetX+s.width+r}px; top: ${a}px;`:o==="left"?`right: ${s.scrollWidth-s.x+r}px; top: ${a}px;`:""})}function Qa(e,t){return t(e)}function Et(e,t){if(e!=null)return t(e)}function M_(e){return Array.isArray(e)?e:[e]}function k_(e,t,...i){i.forEach(s=>{e[s]=t[s]})}function Xa(e,t){dt(document,"click",i=>{document.contains(i.target)&&(M_(e).map(s=>s.value).filter(s=>!!s).some(s=>s==null?void 0:s.contains(i.target))||t())})}const I_={},L_={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function __(e,t){return l.openBlock(),l.createElementBlock("svg",L_,t[0]||(t[0]=[l.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const O_=Yn(I_,[["render",__]]),uh=new Map,V_={name:"PlTooltip"},Ti=l.defineComponent({...V_,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(e,{emit:t}){const i=t,s=Symbol(),n=e,o=l.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});uh.set(s,()=>h()),l.watch(()=>o.open,S=>{requestAnimationFrame(()=>{o.tooltipOpen=S})});let r=()=>{};const a=th(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),d=()=>{o.open=!0;for(let[S,b]of uh.entries())S!==s&&b()},h=()=>{o.open=!1,i("tooltip:close")},p=async()=>{n.hide||(a(),o.over=!0,r(),await wC(100),o.over&&d())},f=()=>{o.over=!1,r=SC(()=>{o.over||h()},n.closeDelay)};l.watch(()=>n.hide,S=>{S&&h()});const m=l.ref(),v=l.ref(),w=A_(m,l.toRef(n));return Xa([m,v],()=>h()),l.onUnmounted(()=>{uh.delete(s)}),(S,b)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(S.element),l.mergeProps(S.$attrs,{ref_key:"rootRef",ref:m,onClick:p,onMouseover:p,onMouseleave:f}),{default:l.withCtx(()=>[l.renderSlot(S.$slots,"default"),b[1]||(b[1]=l.createTextVNode()),S.$slots.tooltip&&o.open?(l.openBlock(),l.createBlock(l.Teleport,{key:0,to:"body"},[l.createVNode(l.Transition,{name:"tooltip-transition"},{default:l.withCtx(()=>[o.tooltipOpen?(l.openBlock(),l.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:l.normalizeStyle(l.unref(w))},[l.createElementVNode("div",{ref_key:"tooltip",ref:v,class:l.normalizeClass(["pl-tooltip",S.position]),onMouseover:p,onMouseleave:f},[l.createElementVNode("div",null,[l.renderSlot(S.$slots,"tooltip")]),b[0]||(b[0]=l.createTextVNode()),l.createVNode(O_)],34)],4)):l.createCommentVNode("",!0)]),_:3})])):l.createCommentVNode("",!0)]),_:3},16))}}),N_={},B_={class:"inner-border"};function G_(e,t,i,s,n,o){return l.openBlock(),l.createElementBlock("div",B_,[l.renderSlot(e.$slots,"default")])}const H_=Yn(N_,[["render",G_]]),W_={key:0},z_=["tabindex","onKeydown","onClick"],U_={key:1,class:"ui-btn-group__helper"},$_={key:2,class:"ui-btn-group__error"},K_={name:"PlBtnGroup"},j_=l.defineComponent({...K_,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(e,{emit:t}){const i=l.useSlots(),s=t,n=o=>s("update:modelValue",o);return(o,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["ui-btn-group",{disabled:o.disabled}])},[o.label?(l.openBlock(),l.createElementBlock("label",W_,[l.createElementVNode("span",null,l.toDisplayString(o.label),1),r[0]||(r[0]=l.createTextVNode()),l.unref(i).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:0,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(o.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r[1]||(r[1]=l.createTextVNode()),l.createVNode(H_,{class:"ui-btn-group__container"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.options,(a,d)=>(l.openBlock(),l.createElementBlock("div",{key:d,class:l.normalizeClass(["ui-btn-group__option",{active:o.modelValue===a.value}]),tabindex:o.modelValue===a.value||o.disabled?void 0:0,onKeydown:l.withKeys(h=>n(a.value),["enter"]),onClick:h=>n(a.value)},l.toDisplayString(a.text),43,z_))),128))]),_:1}),r[2]||(r[2]=l.createTextVNode()),o.helper?(l.openBlock(),l.createElementBlock("div",U_,l.toDisplayString(o.helper),1)):o.error?(l.openBlock(),l.createElementBlock("div",$_,l.toDisplayString(o.error),1)):l.createCommentVNode("",!0)],2))}}),Z_={inheritAttrs:!1},q_={class:"double-contour"};function Y_(e,t,i,s,n,o){return l.openBlock(),l.createElementBlock("div",q_,[l.createElementVNode("div",l.normalizeProps(l.guardReactiveProps(e.$attrs)),[l.renderSlot(e.$slots,"default")],16)])}const $o=Yn(Z_,[["render",Y_]]);function _C(e){l.onMounted(e),l.onUpdated(e)}const hh=new WeakMap,ph=new ResizeObserver(e=>{for(const t of e)Et(hh.get(t.target),i=>i(t))});function OC(e,t){hh.set(e,t),ph.unobserve(e),ph.observe(e)}function VC(e){ph.unobserve(e),hh.delete(e)}const Q_=8,NC=4;function Qn(e,t="label"){const i=new Set;_C(()=>{Et(e==null?void 0:e.value,s=>{const n=s.querySelector(t);n&&(i.add(n),OC(n,()=>{const o=vC(()=>n.getBoundingClientRect().width+Qa(Q_,r=>Number.isNaN(r)?NC:r+NC));s.style.getPropertyValue("--label-offset-right-x")!==`${o}px`&&s.style.setProperty("--label-offset-right-x",`${o}px`)}))})}),l.onBeforeUnmount(()=>{Array.from(i.values()).map(s=>VC(s))})}function X_(e,t){const i=[];return t&&t.length>0&&t.forEach(s=>{const n=s(e);typeof n=="string"&&i.push(n)}),{isValid:i.length===0,errors:i}}function BC(e,t){return l.computed(()=>X_(e.value,t))}const J_={class:"ui-text-field__envelope"},eO={key:0,ref:"label"},tO={key:0,class:"required-icon"},iO={key:1,class:"ui-text-field__prefix"},sO=["disabled","placeholder"],nO={class:"ui-text-field__append"},oO={key:0,class:"ui-text-field__error"},rO={key:1,class:"ui-text-field__helper"},lO={name:"PlTextField"},GC=l.defineComponent({...lO,props:{modelValue:{},label:{},clearable:{type:[Boolean,Function]},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{}},emits:["update:modelValue"],setup(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.ref(void 0),r=l.ref(),a=l.computed({get(){return n.modelValue??""},set(w){s("update:modelValue",w)}}),d=()=>{n.clearable&&s("update:modelValue",n.clearable===!0?"":n.clearable())},h=BC(a,n.rules||[]),p=l.computed(()=>n.clearable?n.clearable===!0?n.modelValue==="":n.modelValue===n.clearable():n.modelValue===""),f=l.computed(()=>!p.value),m=l.computed(()=>{const w=[];return n.error&&w.push(n.error),h.value.isValid||w.push(...h.value.errors),w}),v=l.computed(()=>m.value.length>0);return Qn(o),(w,S)=>(l.openBlock(),l.createElementBlock("div",J_,[l.createElementVNode("div",{ref_key:"rootRef",ref:o,class:l.normalizeClass(["ui-text-field",{error:v.value,disabled:w.disabled,dashed:w.dashed,nonEmpty:f.value}])},[w.label?(l.openBlock(),l.createElementBlock("label",eO,[w.required?(l.openBlock(),l.createElementBlock("i",tO)):l.createCommentVNode("",!0),S[1]||(S[1]=l.createTextVNode()),l.createElementVNode("span",null,l.toDisplayString(w.label),1),S[2]||(S[2]=l.createTextVNode()),l.unref(i).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:1,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(w.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)],512)):l.createCommentVNode("",!0),S[4]||(S[4]=l.createTextVNode()),w.prefix?(l.openBlock(),l.createElementBlock("div",iO,l.toDisplayString(w.prefix),1)):l.createCommentVNode("",!0),S[5]||(S[5]=l.createTextVNode()),l.withDirectives(l.createElementVNode("input",{ref_key:"inputRef",ref:r,"onUpdate:modelValue":S[0]||(S[0]=b=>a.value=b),disabled:w.disabled,placeholder:w.placeholder||"...",type:"text",spellcheck:"false"},null,8,sO),[[l.vModelText,a.value]]),S[6]||(S[6]=l.createTextVNode()),l.createElementVNode("div",nO,[w.clearable&&f.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"icon icon--clear",onClick:d})):l.createCommentVNode("",!0),S[3]||(S[3]=l.createTextVNode()),l.renderSlot(w.$slots,"append")]),S[7]||(S[7]=l.createTextVNode()),l.createVNode($o,{class:"ui-text-field__contour"})],2),S[8]||(S[8]=l.createTextVNode()),v.value?(l.openBlock(),l.createElementBlock("div",oO,l.toDisplayString(m.value.join(" ")),1)):w.helper?(l.openBlock(),l.createElementBlock("div",rO,l.toDisplayString(w.helper),1)):l.createCommentVNode("",!0)]))}}),aO={class:"ui-text-area__envelope"},cO={key:0,ref:"label"},dO={key:0,class:"required-icon"},uO=["readonly","rows","disabled","placeholder"],hO={class:"ui-text-area__append"},pO={key:0,class:"ui-text-area__error"},gO={key:1,class:"ui-text-area__helper"},fO={name:"PlTextArea"},mO=l.defineComponent({...fO,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(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.ref(),r=l.ref(),a=l.computed({get(){return n.modelValue??""},set(v){s("update:modelValue",v)}}),d=l.computed(()=>!!n.modelValue),h=BC(a,n.rules||[]);Qn(o);const p=l.computed(()=>{const v=[];return n.error&&v.push(n.error),v.push(...h.value.errors),v}),f=l.computed(()=>p.value.length>0),m=()=>{if(!n.autogrow)return;const v=r.value;v&&(v.style.height="auto",v.style.height=`${v.scrollHeight}px`)};return l.onMounted(()=>{m()}),(v,w)=>(l.openBlock(),l.createElementBlock("div",aO,[l.createElementVNode("div",{ref_key:"root",ref:o,class:l.normalizeClass(["ui-text-area",{error:f.value,disabled:v.disabled,dashed:v.dashed,nonEmpty:d.value}])},[v.label?(l.openBlock(),l.createElementBlock("label",cO,[v.required?(l.openBlock(),l.createElementBlock("i",dO)):l.createCommentVNode("",!0),w[1]||(w[1]=l.createTextVNode()),l.createElementVNode("span",null,l.toDisplayString(v.label),1),w[2]||(w[2]=l.createTextVNode()),l.unref(i).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:1,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(v.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)],512)):l.createCommentVNode("",!0),w[3]||(w[3]=l.createTextVNode()),l.withDirectives(l.createElementVNode("textarea",{ref_key:"input",ref:r,"onUpdate:modelValue":w[0]||(w[0]=S=>a.value=S),readonly:v.readonly,rows:v.rows,disabled:v.disabled,placeholder:v.placeholder??"...",spellcheck:"false",onInput:m},null,40,uO),[[l.vModelText,a.value]]),w[4]||(w[4]=l.createTextVNode()),l.createElementVNode("div",hO,[l.renderSlot(v.$slots,"append")]),w[5]||(w[5]=l.createTextVNode()),l.createVNode($o,{class:"ui-text-area__contour"})],2),w[6]||(w[6]=l.createTextVNode()),f.value?(l.openBlock(),l.createElementBlock("div",pO,l.toDisplayString(p.value.join(" ")),1)):v.helper?(l.openBlock(),l.createElementBlock("div",gO,l.toDisplayString(v.helper),1)):l.createCommentVNode("",!0)]))}});function HC(e,t){const i=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,o=t.getBoundingClientRect().height;return n+o<s+i&&n>i}function WC(e,t){const i=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,o=t.getBoundingClientRect().height;return n+o<s+i?"ceil":n>i?"floor":"visible"}function Ja(e,t,i={}){const s=e.scrollTop,n=e.getBoundingClientRect().height,o=t.getBoundingClientRect().height,r=t.offsetTop,a=WC(e,t);if(a==="visible")return;const d=h=>{const p=a==="floor"?r-(n-o):r;e.scrollTop=s+h*(p-s)};HC(e,t)||RC({duration:i.duration||100,timing:bC(h=>h),draw:d})}function gh(e,t,i,s){return e.addEventListener(t,i,s),function(){e.removeEventListener(t,i)}}function CO(e,t){const i=t.getBoundingClientRect();return e.x<i.x||e.x>i.x+i.width||e.y<i.y||e.y>i.y+i.height}function zC(e){return e!==null&&typeof e=="object"}function ji(e,t){return zC(e)&&zC(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>ji(e[i],t[i])):e===t}function fh(e,t){return e.some(i=>ji(i,t))}const vO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ (function(A,n){typeof exports=="object"&&typeof module<"u"?n(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-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/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-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/vue3"],n):(A=typeof globalThis<"u"?globalThis:A||self,n(A.SdkVueLib={},A.Vue,A.core$1,A.core,A.clientSideRowModel,A.infiniteRowModel,A.csvExport,A.clipboard,A.rangeSelection,A.richSelect,A.menu,A.excelExport,A.vue3))})(this,function(A,n,Qe,_r,Mo,$c,lh,zc,Zc,ch,dh,uh,fh){"use strict";var W2=Object.defineProperty;var ah=A=>{throw TypeError(A)};var H2=(A,n,Qe)=>n in A?W2(A,n,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):A[n]=Qe;var Le=(A,n,Qe)=>H2(A,typeof n!="symbol"?n+"":n,Qe),Ic=(A,n,Qe)=>n.has(A)||ah("Cannot "+Qe);var w=(A,n,Qe)=>(Ic(A,n,"read from private field"),Qe?Qe.call(A):n.get(A)),Me=(A,n,Qe)=>n.has(A)?ah("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(A):n.set(A,Qe),fe=(A,n,Qe,_r)=>(Ic(A,n,"write to private field"),_r?_r.call(A,Qe):n.set(A,Qe),Qe),ie=(A,n,Qe)=>(Ic(A,n,"access private method"),Qe);var as=(A,n,Qe,_r)=>({set _(Mo){fe(A,n,Mo,Qe)},get _(){return w(A,n,_r)}});var Eu,ri,Su,Tu,on,At,an,sn,ii,oi,rt,ln,nt,Ue,we,bt,Rt,mt,st,cn,lt,dn,un,Dt,fn,ir,kt,Y,Mc,Nr,An,uo,It,sh,Br,ai,fo,mr,gr,Pc,ss,ls,We,Lc,Io,yr,Fc;function ph(i,e){if(i==null)throw Error(e??"Empty (null | undefined) value");return i}function hh(i){return i!==null&&typeof i=="object"}function Vn(i){if(Array.isArray(i)){const e=[];for(let t=0;t<i.length;t++)e[t]=Vn(i[t]);return e}else if(hh(i)){const e={};return Object.keys(i).forEach(t=>{e[t]=Vn(i[t])}),e}else return i}function cs(i,e,t=!0){let a=0,s;return function(...c){s=()=>{i.apply(this,c),a=new Date().getTime()+e,s=null,t&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>a&&s()}}function mh(i){let e=0n,t;return async function(...a){const s=++e;try{await t}catch{}if(e!==s)return{ok:!1};const c=i(...a);return t=c,{ok:!0,value:await c}}}var vi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var yh=function i(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?i(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,c,d)=>`${s}${d===0?"":","}${i(c===void 0||typeof c=="symbol"?null:c)}`,"")}]`:`{${Object.keys(e).sort().reduce((a,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return a;const c=a.length===0?"":",";return`${a}${c}${i(s)}:${i(e[s])}`},"")}}`};const Ci=gh(yh);class ds extends Error{}class us extends Error{constructor(e){super(),this.errors=e}toString(){return this.errors.join(",")}}function _h(i){return{ok:!0,value:i}}function Uc(i){if(!i)throw new ds;if(!i.ok)throw Error(i.errors.join(";"));return i.value}function jc(i){return{value:i,errors:void 0}}function wh(i){if(i.errors)throw new us(i.errors);if(!i.value)throw new ds;return i.value}function bh(i){return i!==void 0}function fs(i,e){return Ci(i)===Ci(e)}const ps=i=>i,hs=i=>i instanceof Error?i:Error(String(i)),ms=i=>i.name==="ZodError",gs=i=>{const{formErrors:e,fieldErrors:t}=i.flatten(),a=Object.entries(t).map(([s,c])=>s+":"+(c==null?void 0:c.join(",")));return e.concat(a).join("; ")};function ys(i){const e=i.validate??ps,{autoSave:t}=i,a=n.ref(),s=n.ref(),c=C=>{s.value={model:Vn(C)}};n.watch(()=>i.get(),C=>c(C),{immediate:!0});const d=()=>{var C;i.onSave(e(Vn((C=s.value)==null?void 0:C.model)))},u=()=>{c(i.get()),a.value=void 0},p=C=>{const k=hs(C);ms(k)?a.value=Error(gs(k)):a.value=k},h=C=>{a.value=void 0;try{e(C),t&&d()}catch(k){p(k)}},g=n.computed({get:()=>{var C;return(C=s.value)==null?void 0:C.model},set(C){c(C),h(C)}});n.watch(s,(C,k)=>{C&&C===k&&h(C.model)},{deep:!0});const x=n.computed(()=>!a.value),R=n.computed(()=>!fs(i.get(),n.unref(s))),T=n.computed(()=>a.value?a.value.message:"");return n.reactive({model:g,valid:x,isChanged:R,error:a,errorString:T,save:d,revert:u,setError:p})}function kh(i,e){const t=i.validate??ps,{autoSave:a}=i,s=n.ref(),c=n.ref(),d=k=>{c.value={model:Object.assign(Vn(k),e??{}),stage:Symbol()}};n.watch(()=>i.get(),k=>d(k),{immediate:!0});const u=()=>{var k;i.onSave(t(Vn((k=c.value)==null?void 0:k.model)))},p=()=>{d(i.get()),s.value=void 0},h=k=>{const S=hs(k);ms(S)?s.value=Error(gs(S)):s.value=S},g=k=>{s.value=void 0;try{t(k),a&&u()}catch(S){h(S)}},x=n.computed({get:()=>{var k;return(k=c.value)==null?void 0:k.model},set(){throw Error("Cannot replace base model")}});n.watch([()=>({args:x.value.args,ui:x.value.ui}),()=>{var k;return(k=c.value)==null?void 0:k.stage}],([k,S],[v,I])=>{S===I&&g(k)},{deep:!0});const R=n.computed(()=>!s.value),T=n.computed(()=>!fs(i.get(),n.unref(c))),C=n.computed(()=>s.value?s.value.message:"");return n.reactive({model:x,valid:R,isChanged:T,error:s,errorString:C,save:u,revert:p,setError:h})}const xh=i=>Object.fromEntries(new URL(i,"http://dummy").searchParams);function vh(i,e){const a=cs(e.setBlockArgs,100),s=cs(e.setBlockUiState,100),c=cs(e.setBlockArgsAndUiState,100),d=n.reactive({args:Object.freeze(i.args),outputs:Object.freeze(i.outputs),ui:Object.freeze(i.ui),navigationState:Object.freeze(i.navigationState)});e.onStateUpdates(async k=>{k.forEach(S=>{S.key==="args"&&(d.args=Object.freeze(S.value)),S.key==="ui"&&(d.ui=Object.freeze(S.value)),S.key==="outputs"&&(d.outputs=Object.freeze(S.value)),S.key==="navigationState"&&(d.navigationState=Object.freeze(S.value))}),await n.nextTick()});const u=()=>Vn(d.args),p=()=>Vn(d.ui),h=()=>Vn(d.navigationState),g={createArgsModel(k={}){return ys({get(){return k.transform?k.transform(d.args):d.args},validate:k.validate,autoSave:!0,onSave(S){a(S)}})},createUiModel(k={},S){return ys({get(){return k.transform?k.transform(d.ui):d.ui??S()},validate:k.validate,autoSave:!0,onSave(v){s(v)}})},useOutputs(...k){const S=n.reactive({errors:void 0,value:void 0});return n.watch(()=>d.outputs,()=>{try{Object.assign(S,{value:this.unwrapOutputs(...k),errors:void 0})}catch(v){Object.assign(S,{value:void 0,errors:[String(v)]})}},{immediate:!0,deep:!0}),S},unwrapOutputs(...k){const S=d.outputs,v=k.map(I=>[I,Uc(S[I])]);return Object.fromEntries(v)},getOutputField(k){return d.outputs[k]},getOutputFieldOkOptional(k){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const S=this.getOutputField(k);if(S&&S.ok)return S.value},getOutputFieldErrorsOptional(k){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const S=this.getOutputField(k);if(S&&!S.ok)return S.errors},updateArgs(k){const S=u();return k(S),e.setBlockArgs(S)},updateUiState(k){const S=p();return e.setBlockUiState(k(S))},updateNavigationState(k){const S=h();return k(S),e.setNavigationState(S)},navigateTo(k){const S=h();return S.href=k,e.setNavigationState(S)}},x=n.computed(()=>{const k=Object.entries(d.outputs).map(([S,v])=>[S,v.ok&&v.value!==void 0?v.value:void 0]);return Object.fromEntries(k)}),R=n.computed(()=>{const k=Object.entries(d.outputs).map(([S,v])=>[S,v&&!v.ok?new us(v.errors):void 0]);return Object.fromEntries(k)}),T={snapshot:d,queryParams:n.computed(()=>xh(d.navigationState.href)),href:n.computed(()=>d.navigationState.href),hasErrors:n.computed(()=>Object.values(d.outputs).some(k=>!(k!=null&&k.ok))),outputValues:n.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),x.value)),outputErrors:n.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),R.value)),args:n.computed(()=>(console.warn("Change app.args to app.snapshot.args"),d.args)),outputs:n.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),d.outputs)),ui:n.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),d.ui)),navigationState:n.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),d.navigationState))},C=kh({get(){return{args:d.args,ui:d.ui}},autoSave:!0,onSave(k){c(k.args,k.ui)}},{outputs:x,outputErrors:R});return n.reactive(Object.assign(C,g,T))}var De;(function(i){i.assertEqual=s=>s;function e(s){}i.assertIs=e;function t(s){throw new Error}i.assertNever=t,i.arrayToEnum=s=>{const c={};for(const d of s)c[d]=d;return c},i.getValidEnumValues=s=>{const c=i.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),d={};for(const u of c)d[u]=s[u];return i.objectValues(d)},i.objectValues=s=>i.objectKeys(s).map(function(c){return s[c]}),i.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const c=[];for(const d in s)Object.prototype.hasOwnProperty.call(s,d)&&c.push(d);return c},i.find=(s,c)=>{for(const d of s)if(c(d))return d},i.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,c=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(c)}i.joinValues=a,i.jsonStringifyReplacer=(s,c)=>typeof c=="bigint"?c.toString():c})(De||(De={}));var _s;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(_s||(_s={}));const te=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Un=i=>{switch(typeof i){case"undefined":return te.undefined;case"string":return te.string;case"number":return isNaN(i)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(i)?te.array:i===null?te.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?te.promise:typeof Map<"u"&&i instanceof Map?te.map:typeof Set<"u"&&i instanceof Set?te.set:typeof Date<"u"&&i instanceof Date?te.date:te.object;default:return te.unknown}},q=De.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"]),Ch=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Bt extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(c){return c.message},a={_errors:[]},s=c=>{for(const d of c.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)a._errors.push(t(d));else{let u=a,p=0;for(;p<d.path.length;){const h=d.path[p];p===d.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(d))):u[h]=u[h]||{_errors:[]},u=u[h],p++}}};return s(this),a}static assert(e){if(!(e instanceof Bt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}Bt.create=i=>new Bt(i);const Zr=(i,e)=>{let t;switch(i.code){case q.invalid_type:i.received===te.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case q.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,De.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:t=`Unrecognized key(s) in object: ${De.joinValues(i.keys,", ")}`;break;case q.invalid_union:t="Invalid input";break;case q.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${De.joinValues(i.options)}`;break;case q.invalid_enum_value:t=`Invalid enum value. Expected ${De.joinValues(i.options)}, received '${i.received}'`;break;case q.invalid_arguments:t="Invalid function arguments";break;case q.invalid_return_type:t="Invalid function return type";break;case q.invalid_date:t="Invalid date";break;case q.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:De.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case q.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case q.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case q.custom:t="Invalid input";break;case q.invalid_intersection_types:t="Intersection results could not be merged";break;case q.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case q.not_finite:t="Number must be finite";break;default:t=e.defaultError,De.assertNever(i)}return{message:t}};let Wc=Zr;function Eh(i){Wc=i}function Po(){return Wc}const Lo=i=>{const{data:e,path:t,errorMaps:a,issueData:s}=i,c=[...t,...s.path||[]],d={...s,path:c};if(s.message!==void 0)return{...s,path:c,message:s.message};let u="";const p=a.filter(h=>!!h).slice().reverse();for(const h of p)u=h(d,{data:e,defaultError:u}).message;return{...s,path:c,message:u}},Sh=[];function Q(i,e){const t=Po(),a=Lo({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===Zr?void 0:Zr].filter(s=>!!s)});i.common.issues.push(a)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if(s.status==="aborted")return ye;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const s of t){const c=await s.key,d=await s.value;a.push({key:c,value:d})}return ft.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:c,value:d}=s;if(c.status==="aborted"||d.status==="aborted")return ye;c.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),c.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(a[c.value]=d.value)}return{status:e.value,value:a}}}const ye=Object.freeze({status:"aborted"}),Ur=i=>({status:"dirty",value:i}),_t=i=>({status:"valid",value:i}),ws=i=>i.status==="aborted",bs=i=>i.status==="dirty",Ei=i=>i.status==="valid",Si=i=>typeof Promise<"u"&&i instanceof Promise;function Fo(i,e,t,a){if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(i)}function Hc(i,e,t,a,s){if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(i,t),t}typeof SuppressedError=="function"&&SuppressedError;var le;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(le||(le={}));var Ti,Vi;class wn{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 qc=(i,e)=>{if(Ei(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Bt(i.common.issues);return this._error=t,this._error}}};function xe(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:s}=i;if(e&&(t||a))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:(d,u)=>{var p,h;const{message:g}=i;return d.code==="invalid_enum_value"?{message:g??u.defaultError}:typeof u.data>"u"?{message:(p=g??a)!==null&&p!==void 0?p:u.defaultError}:d.code!=="invalid_type"?{message:u.defaultError}:{message:(h=g??t)!==null&&h!==void 0?h:u.defaultError}},description:s}}class Se{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 Un(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Un(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:Un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Si(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const s={common:{issues:[],async:(a=t==null?void 0:t.async)!==null&&a!==void 0?a:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Un(e)},c=this._parseSync({data:e,path:s.path,parent:s});return qc(s,c)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Un(e)},s=this._parse({data:e,path:a.path,parent:a}),c=await(Si(s)?s:Promise.resolve(s));return qc(a,c)}refine(e,t){const a=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,c)=>{const d=e(s),u=()=>c.addIssue({code:q.custom,...a(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,t){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof t=="function"?t(a,s):t),!1))}_refinement(e){return new Qt({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return kn.create(this,this._def)}nullable(){return qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xt.create(this,this._def)}promise(){return qr.create(this,this._def)}or(e){return Ai.create([this,e],this._def)}and(e){return Ri.create(this,e,this._def)}transform(e){return new Qt({...xe(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Li({...xe(this._def),innerType:this,defaultValue:t,typeName:me.ZodDefault})}brand(){return new vs({typeName:me.ZodBranded,type:this,...xe(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Fi({...xe(this._def),innerType:this,catchValue:t,typeName:me.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return $i.create(this,e)}readonly(){return zi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Th=/^c[^\s-]{8,}$/i,Vh=/^[0-9a-z]+$/,Nh=/^[0-9A-HJKMNP-TV-Z]{26}$/,Bh=/^[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,Oh=/^[a-z0-9_-]{21}$/i,Ah=/^[-+]?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)?)??$/,Rh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ks;const Ih=/^(?:(?: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])$/,Mh=/^(([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})))$/,Ph=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Gc="((\\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])))",Lh=new RegExp(`^${Gc}$`);function Kc(i){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Fh(i){return new RegExp(`^${Kc(i)}$`)}function Yc(i){let e=`${Gc}T${Kc(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function $h(i,e){return!!((e==="v4"||!e)&&Ih.test(i)||(e==="v6"||!e)&&Mh.test(i))}class Jt extends Se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==te.string){const c=this._getOrReturnCtx(e);return Q(c,{code:q.invalid_type,expected:te.string,received:c.parsedType}),ye}const a=new ft;let s;for(const c of this._def.checks)if(c.kind==="min")e.data.length<c.value&&(s=this._getOrReturnCtx(e,s),Q(s,{code:q.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="max")e.data.length>c.value&&(s=this._getOrReturnCtx(e,s),Q(s,{code:q.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="length"){const d=e.data.length>c.value,u=e.data.length<c.value;(d||u)&&(s=this._getOrReturnCtx(e,s),d?Q(s,{code:q.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):u&&Q(s,{code:q.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),a.dirty())}else if(c.kind==="email")Rh.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"email",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="emoji")ks||(ks=new RegExp(Dh,"u")),ks.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"emoji",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="uuid")Bh.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"uuid",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="nanoid")Oh.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"nanoid",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid")Th.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"cuid",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid2")Vh.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"cuid2",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="ulid")Nh.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"ulid",code:q.invalid_string,message:c.message}),a.dirty());else if(c.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Q(s,{validation:"url",code:q.invalid_string,message:c.message}),a.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"regex",code:q.invalid_string,message:c.message}),a.dirty())):c.kind==="trim"?e.data=e.data.trim():c.kind==="includes"?e.data.includes(c.value,c.position)||(s=this._getOrReturnCtx(e,s),Q(s,{code:q.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),a.dirty()):c.kind==="toLowerCase"?e.data=e.data.toLowerCase():c.kind==="toUpperCase"?e.data=e.data.toUpperCase():c.kind==="startsWith"?e.data.startsWith(c.value)||(s=this._getOrReturnCtx(e,s),Q(s,{code:q.invalid_string,validation:{startsWith:c.value},message:c.message}),a.dirty()):c.kind==="endsWith"?e.data.endsWith(c.value)||(s=this._getOrReturnCtx(e,s),Q(s,{code:q.invalid_string,validation:{endsWith:c.value},message:c.message}),a.dirty()):c.kind==="datetime"?Yc(c).test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{code:q.invalid_string,validation:"datetime",message:c.message}),a.dirty()):c.kind==="date"?Lh.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{code:q.invalid_string,validation:"date",message:c.message}),a.dirty()):c.kind==="time"?Fh(c).test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{code:q.invalid_string,validation:"time",message:c.message}),a.dirty()):c.kind==="duration"?Ah.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"duration",code:q.invalid_string,message:c.message}),a.dirty()):c.kind==="ip"?$h(e.data,c.version)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"ip",code:q.invalid_string,message:c.message}),a.dirty()):c.kind==="base64"?Ph.test(e.data)||(s=this._getOrReturnCtx(e,s),Q(s,{validation:"base64",code:q.invalid_string,message:c.message}),a.dirty()):De.assertNever(c);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(s=>e.test(s),{validation:t,code:q.invalid_string,...le.errToObj(a)})}_addCheck(e){return new Jt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...le.errToObj(e)})}url(e){return this._addCheck({kind:"url",...le.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...le.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...le.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...le.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...le.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...le.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...le.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...le.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...le.errToObj(e)})}datetime(e){var t,a;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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!1,...le.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,...le.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...le.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...le.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...le.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...le.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...le.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...le.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...le.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...le.errToObj(t)})}nonempty(e){return this.min(1,le.errToObj(e))}trim(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jt({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Jt.create=i=>{var e;return new Jt({checks:[],typeName:me.ZodString,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...xe(i)})};function zh(i,e){const t=(i.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=t>a?t:a,c=parseInt(i.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return c%d/Math.pow(10,s)}class jn extends Se{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)!==te.number){const c=this._getOrReturnCtx(e);return Q(c,{code:q.invalid_type,expected:te.number,received:c.parsedType}),ye}let a;const s=new ft;for(const c of this._def.checks)c.kind==="int"?De.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Q(a,{code:q.invalid_type,expected:"integer",received:"float",message:c.message}),s.dirty()):c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(a=this._getOrReturnCtx(e,a),Q(a,{code:q.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),s.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(a=this._getOrReturnCtx(e,a),Q(a,{code:q.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),s.dirty()):c.kind==="multipleOf"?zh(e.data,c.value)!==0&&(a=this._getOrReturnCtx(e,a),Q(a,{code:q.not_multiple_of,multipleOf:c.value,message:c.message}),s.dirty()):c.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Q(a,{code:q.not_finite,message:c.message}),s.dirty()):De.assertNever(c);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,le.toString(t))}gt(e,t){return this.setLimit("min",e,!1,le.toString(t))}lte(e,t){return this.setLimit("max",e,!0,le.toString(t))}lt(e,t){return this.setLimit("max",e,!1,le.toString(t))}setLimit(e,t,a,s){return new jn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:le.toString(s)}]})}_addCheck(e){return new jn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:le.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:le.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:le.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:le.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:le.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:le.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&De.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}jn.create=i=>new jn({checks:[],typeName:me.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...xe(i)});class Wn extends Se{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)!==te.bigint){const c=this._getOrReturnCtx(e);return Q(c,{code:q.invalid_type,expected:te.bigint,received:c.parsedType}),ye}let a;const s=new ft;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(a=this._getOrReturnCtx(e,a),Q(a,{code:q.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),s.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(a=this._getOrReturnCtx(e,a),Q(a,{code:q.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),s.dirty()):c.kind==="multipleOf"?e.data%c.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Q(a,{code:q.not_multiple_of,multipleOf:c.value,message:c.message}),s.dirty()):De.assertNever(c);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,le.toString(t))}gt(e,t){return this.setLimit("min",e,!1,le.toString(t))}lte(e,t){return this.setLimit("max",e,!0,le.toString(t))}lt(e,t){return this.setLimit("max",e,!1,le.toString(t))}setLimit(e,t,a,s){return new Wn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:le.toString(s)}]})}_addCheck(e){return new Wn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:le.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:le.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Wn.create=i=>{var e;return new Wn({checks:[],typeName:me.ZodBigInt,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...xe(i)})};class Ni extends Se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==te.boolean){const a=this._getOrReturnCtx(e);return Q(a,{code:q.invalid_type,expected:te.boolean,received:a.parsedType}),ye}return _t(e.data)}}Ni.create=i=>new Ni({typeName:me.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...xe(i)});class wr extends Se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==te.date){const c=this._getOrReturnCtx(e);return Q(c,{code:q.invalid_type,expected:te.date,received:c.parsedType}),ye}if(isNaN(e.data.getTime())){const c=this._getOrReturnCtx(e);return Q(c,{code:q.invalid_date}),ye}const a=new ft;let s;for(const c of this._def.checks)c.kind==="min"?e.data.getTime()<c.value&&(s=this._getOrReturnCtx(e,s),Q(s,{code:q.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),a.dirty()):c.kind==="max"?e.data.getTime()>c.value&&(s=this._getOrReturnCtx(e,s),Q(s,{code:q.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),a.dirty()):De.assertNever(c);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:le.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:le.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}wr.create=i=>new wr({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:me.ZodDate,...xe(i)});class $o extends Se{_parse(e){if(this._getType(e)!==te.symbol){const a=this._getOrReturnCtx(e);return Q(a,{code:q.invalid_type,expected:te.symbol,received:a.parsedType}),ye}return _t(e.data)}}$o.create=i=>new $o({typeName:me.ZodSymbol,...xe(i)});class Bi extends Se{_parse(e){if(this._getType(e)!==te.undefined){const a=this._getOrReturnCtx(e);return Q(a,{code:q.invalid_type,expected:te.undefined,received:a.parsedType}),ye}return _t(e.data)}}Bi.create=i=>new Bi({typeName:me.ZodUndefined,...xe(i)});class Oi extends Se{_parse(e){if(this._getType(e)!==te.null){const a=this._getOrReturnCtx(e);return Q(a,{code:q.invalid_type,expected:te.null,received:a.parsedType}),ye}return _t(e.data)}}Oi.create=i=>new Oi({typeName:me.ZodNull,...xe(i)});class jr extends Se{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}}jr.create=i=>new jr({typeName:me.ZodAny,...xe(i)});class br extends Se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}}br.create=i=>new br({typeName:me.ZodUnknown,...xe(i)});class Nn extends Se{_parse(e){const t=this._getOrReturnCtx(e);return Q(t,{code:q.invalid_type,expected:te.never,received:t.parsedType}),ye}}Nn.create=i=>new Nn({typeName:me.ZodNever,...xe(i)});class zo extends Se{_parse(e){if(this._getType(e)!==te.undefined){const a=this._getOrReturnCtx(e);return Q(a,{code:q.invalid_type,expected:te.void,received:a.parsedType}),ye}return _t(e.data)}}zo.create=i=>new zo({typeName:me.ZodVoid,...xe(i)});class Xt extends Se{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==te.array)return Q(t,{code:q.invalid_type,expected:te.array,received:t.parsedType}),ye;if(s.exactLength!==null){const d=t.data.length>s.exactLength.value,u=t.data.length<s.exactLength.value;(d||u)&&(Q(t,{code:d?q.too_big:q.too_small,minimum:u?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(Q(t,{code:q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(Q(t,{code:q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((d,u)=>s.type._parseAsync(new wn(t,d,t.path,u)))).then(d=>ft.mergeArray(a,d));const c=[...t.data].map((d,u)=>s.type._parseSync(new wn(t,d,t.path,u)));return ft.mergeArray(a,c)}get element(){return this._def.type}min(e,t){return new Xt({...this._def,minLength:{value:e,message:le.toString(t)}})}max(e,t){return new Xt({...this._def,maxLength:{value:e,message:le.toString(t)}})}length(e,t){return new Xt({...this._def,exactLength:{value:e,message:le.toString(t)}})}nonempty(e){return this.min(1,e)}}Xt.create=(i,e)=>new Xt({type:i,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...xe(e)});function Wr(i){if(i instanceof qe){const e={};for(const t in i.shape){const a=i.shape[t];e[t]=kn.create(Wr(a))}return new qe({...i._def,shape:()=>e})}else return i instanceof Xt?new Xt({...i._def,type:Wr(i.element)}):i instanceof kn?kn.create(Wr(i.unwrap())):i instanceof qn?qn.create(Wr(i.unwrap())):i instanceof bn?bn.create(i.items.map(e=>Wr(e))):i}class qe extends Se{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(),t=De.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==te.object){const h=this._getOrReturnCtx(e);return Q(h,{code:q.invalid_type,expected:te.object,received:h.parsedType}),ye}const{status:a,ctx:s}=this._processInputParams(e),{shape:c,keys:d}=this._getCached(),u=[];if(!(this._def.catchall instanceof Nn&&this._def.unknownKeys==="strip"))for(const h in s.data)d.includes(h)||u.push(h);const p=[];for(const h of d){const g=c[h],x=s.data[h];p.push({key:{status:"valid",value:h},value:g._parse(new wn(s,x,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof Nn){const h=this._def.unknownKeys;if(h==="passthrough")for(const g of u)p.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(h==="strict")u.length>0&&(Q(s,{code:q.unrecognized_keys,keys:u}),a.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const g of u){const x=s.data[g];p.push({key:{status:"valid",value:g},value:h._parse(new wn(s,x,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const h=[];for(const g of p){const x=await g.key,R=await g.value;h.push({key:x,value:R,alwaysSet:g.alwaysSet})}return h}).then(h=>ft.mergeObjectSync(a,h)):ft.mergeObjectSync(a,p)}get shape(){return this._def.shape()}strict(e){return le.errToObj,new qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var s,c,d,u;const p=(d=(c=(s=this._def).errorMap)===null||c===void 0?void 0:c.call(s,t,a).message)!==null&&d!==void 0?d:a.defaultError;return t.code==="unrecognized_keys"?{message:(u=le.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new qe({...this._def,unknownKeys:"strip"})}passthrough(){return new qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:me.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new qe({...this._def,catchall:e})}pick(e){const t={};return De.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])}),new qe({...this._def,shape:()=>t})}omit(e){const t={};return De.objectKeys(this.shape).forEach(a=>{e[a]||(t[a]=this.shape[a])}),new qe({...this._def,shape:()=>t})}deepPartial(){return Wr(this)}partial(e){const t={};return De.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];e&&!e[a]?t[a]=s:t[a]=s.optional()}),new qe({...this._def,shape:()=>t})}required(e){const t={};return De.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])t[a]=this.shape[a];else{let c=this.shape[a];for(;c instanceof kn;)c=c._def.innerType;t[a]=c}}),new qe({...this._def,shape:()=>t})}keyof(){return Jc(De.objectKeys(this.shape))}}qe.create=(i,e)=>new qe({shape:()=>i,unknownKeys:"strip",catchall:Nn.create(),typeName:me.ZodObject,...xe(e)}),qe.strictCreate=(i,e)=>new qe({shape:()=>i,unknownKeys:"strict",catchall:Nn.create(),typeName:me.ZodObject,...xe(e)}),qe.lazycreate=(i,e)=>new qe({shape:i,unknownKeys:"strip",catchall:Nn.create(),typeName:me.ZodObject,...xe(e)});class Ai extends Se{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function s(c){for(const u of c)if(u.result.status==="valid")return u.result;for(const u of c)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;const d=c.map(u=>new Bt(u.ctx.common.issues));return Q(t,{code:q.invalid_union,unionErrors:d}),ye}if(t.common.async)return Promise.all(a.map(async c=>{const d={...t,common:{...t.common,issues:[]},parent:null};return{result:await c._parseAsync({data:t.data,path:t.path,parent:d}),ctx:d}})).then(s);{let c;const d=[];for(const p of a){const h={...t,common:{...t.common,issues:[]},parent:null},g=p._parseSync({data:t.data,path:t.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!c&&(c={result:g,ctx:h}),h.common.issues.length&&d.push(h.common.issues)}if(c)return t.common.issues.push(...c.ctx.common.issues),c.result;const u=d.map(p=>new Bt(p));return Q(t,{code:q.invalid_union,unionErrors:u}),ye}}get options(){return this._def.options}}Ai.create=(i,e)=>new Ai({options:i,typeName:me.ZodUnion,...xe(e)});const Bn=i=>i instanceof Ii?Bn(i.schema):i instanceof Qt?Bn(i.innerType()):i instanceof Mi?[i.value]:i instanceof Hn?i.options:i instanceof Pi?De.objectValues(i.enum):i instanceof Li?Bn(i._def.innerType):i instanceof Bi?[void 0]:i instanceof Oi?[null]:i instanceof kn?[void 0,...Bn(i.unwrap())]:i instanceof qn?[null,...Bn(i.unwrap())]:i instanceof vs||i instanceof zi?Bn(i.unwrap()):i instanceof Fi?Bn(i._def.innerType):[];class Zo extends Se{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==te.object)return Q(t,{code:q.invalid_type,expected:te.object,received:t.parsedType}),ye;const a=this.discriminator,s=t.data[a],c=this.optionsMap.get(s);return c?t.common.async?c._parseAsync({data:t.data,path:t.path,parent:t}):c._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const c of t){const d=Bn(c.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,c)}}return new Zo({typeName:me.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...xe(a)})}}function xs(i,e){const t=Un(i),a=Un(e);if(i===e)return{valid:!0,data:i};if(t===te.object&&a===te.object){const s=De.objectKeys(e),c=De.objectKeys(i).filter(u=>s.indexOf(u)!==-1),d={...i,...e};for(const u of c){const p=xs(i[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(t===te.array&&a===te.array){if(i.length!==e.length)return{valid:!1};const s=[];for(let c=0;c<i.length;c++){const d=i[c],u=e[c],p=xs(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return t===te.date&&a===te.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}class Ri extends Se{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(c,d)=>{if(ws(c)||ws(d))return ye;const u=xs(c.value,d.value);return u.valid?((bs(c)||bs(d))&&t.dirty(),{status:t.value,value:u.data}):(Q(a,{code:q.invalid_intersection_types}),ye)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,d])=>s(c,d)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ri.create=(i,e,t)=>new Ri({left:i,right:e,typeName:me.ZodIntersection,...xe(t)});class bn extends Se{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==te.array)return Q(a,{code:q.invalid_type,expected:te.array,received:a.parsedType}),ye;if(a.data.length<this._def.items.length)return Q(a,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&a.data.length>this._def.items.length&&(Q(a,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const c=[...a.data].map((d,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new wn(a,d,a.path,u)):null}).filter(d=>!!d);return a.common.async?Promise.all(c).then(d=>ft.mergeArray(t,d)):ft.mergeArray(t,c)}get items(){return this._def.items}rest(e){return new bn({...this._def,rest:e})}}bn.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bn({items:i,typeName:me.ZodTuple,rest:null,...xe(e)})};class Di extends Se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==te.object)return Q(a,{code:q.invalid_type,expected:te.object,received:a.parsedType}),ye;const s=[],c=this._def.keyType,d=this._def.valueType;for(const u in a.data)s.push({key:c._parse(new wn(a,u,a.path,u)),value:d._parse(new wn(a,a.data[u],a.path,u)),alwaysSet:u in a.data});return a.common.async?ft.mergeObjectAsync(t,s):ft.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof Se?new Di({keyType:e,valueType:t,typeName:me.ZodRecord,...xe(a)}):new Di({keyType:Jt.create(),valueType:e,typeName:me.ZodRecord,...xe(t)})}}class Uo extends Se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==te.map)return Q(a,{code:q.invalid_type,expected:te.map,received:a.parsedType}),ye;const s=this._def.keyType,c=this._def.valueType,d=[...a.data.entries()].map(([u,p],h)=>({key:s._parse(new wn(a,u,a.path,[h,"key"])),value:c._parse(new wn(a,p,a.path,[h,"value"]))}));if(a.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){const h=await p.key,g=await p.value;if(h.status==="aborted"||g.status==="aborted")return ye;(h.status==="dirty"||g.status==="dirty")&&t.dirty(),u.set(h.value,g.value)}return{status:t.value,value:u}})}else{const u=new Map;for(const p of d){const h=p.key,g=p.value;if(h.status==="aborted"||g.status==="aborted")return ye;(h.status==="dirty"||g.status==="dirty")&&t.dirty(),u.set(h.value,g.value)}return{status:t.value,value:u}}}}Uo.create=(i,e,t)=>new Uo({valueType:e,keyType:i,typeName:me.ZodMap,...xe(t)});class kr extends Se{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==te.set)return Q(a,{code:q.invalid_type,expected:te.set,received:a.parsedType}),ye;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(Q(a,{code:q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(Q(a,{code:q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const c=this._def.valueType;function d(p){const h=new Set;for(const g of p){if(g.status==="aborted")return ye;g.status==="dirty"&&t.dirty(),h.add(g.value)}return{status:t.value,value:h}}const u=[...a.data.values()].map((p,h)=>c._parse(new wn(a,p,a.path,h)));return a.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,t){return new kr({...this._def,minSize:{value:e,message:le.toString(t)}})}max(e,t){return new kr({...this._def,maxSize:{value:e,message:le.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}kr.create=(i,e)=>new kr({valueType:i,minSize:null,maxSize:null,typeName:me.ZodSet,...xe(e)});class Hr extends Se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==te.function)return Q(t,{code:q.invalid_type,expected:te.function,received:t.parsedType}),ye;function a(u,p){return Lo({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Po(),Zr].filter(h=>!!h),issueData:{code:q.invalid_arguments,argumentsError:p}})}function s(u,p){return Lo({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Po(),Zr].filter(h=>!!h),issueData:{code:q.invalid_return_type,returnTypeError:p}})}const c={errorMap:t.common.contextualErrorMap},d=t.data;if(this._def.returns instanceof qr){const u=this;return _t(async function(...p){const h=new Bt([]),g=await u._def.args.parseAsync(p,c).catch(T=>{throw h.addIssue(a(p,T)),h}),x=await Reflect.apply(d,this,g);return await u._def.returns._def.type.parseAsync(x,c).catch(T=>{throw h.addIssue(s(x,T)),h})})}else{const u=this;return _t(function(...p){const h=u._def.args.safeParse(p,c);if(!h.success)throw new Bt([a(p,h.error)]);const g=Reflect.apply(d,this,h.data),x=u._def.returns.safeParse(g,c);if(!x.success)throw new Bt([s(g,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Hr({...this._def,args:bn.create(e).rest(br.create())})}returns(e){return new Hr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new Hr({args:e||bn.create([]).rest(br.create()),returns:t||br.create(),typeName:me.ZodFunction,...xe(a)})}}class Ii extends Se{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ii.create=(i,e)=>new Ii({getter:i,typeName:me.ZodLazy,...xe(e)});class Mi extends Se{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:q.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mi.create=(i,e)=>new Mi({value:i,typeName:me.ZodLiteral,...xe(e)});function Jc(i,e){return new Hn({values:i,typeName:me.ZodEnum,...xe(e)})}class Hn extends Se{constructor(){super(...arguments),Ti.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return Q(t,{expected:De.joinValues(a),received:t.parsedType,code:q.invalid_type}),ye}if(Fo(this,Ti)||Hc(this,Ti,new Set(this._def.values)),!Fo(this,Ti).has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return Q(t,{received:t.data,code:q.invalid_enum_value,options:a}),ye}return _t(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Hn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Hn.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}Ti=new WeakMap,Hn.create=Jc;class Pi extends Se{constructor(){super(...arguments),Vi.set(this,void 0)}_parse(e){const t=De.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==te.string&&a.parsedType!==te.number){const s=De.objectValues(t);return Q(a,{expected:De.joinValues(s),received:a.parsedType,code:q.invalid_type}),ye}if(Fo(this,Vi)||Hc(this,Vi,new Set(De.getValidEnumValues(this._def.values))),!Fo(this,Vi).has(e.data)){const s=De.objectValues(t);return Q(a,{received:a.data,code:q.invalid_enum_value,options:s}),ye}return _t(e.data)}get enum(){return this._def.values}}Vi=new WeakMap,Pi.create=(i,e)=>new Pi({values:i,typeName:me.ZodNativeEnum,...xe(e)});class qr extends Se{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==te.promise&&t.common.async===!1)return Q(t,{code:q.invalid_type,expected:te.promise,received:t.parsedType}),ye;const a=t.parsedType===te.promise?t.data:Promise.resolve(t.data);return _t(a.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}qr.create=(i,e)=>new qr({type:i,typeName:me.ZodPromise,...xe(e)});class Qt extends Se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=this._def.effect||null,c={addIssue:d=>{Q(a,d),d.fatal?t.abort():t.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),s.type==="preprocess"){const d=s.transform(a.data,c);if(a.common.async)return Promise.resolve(d).then(async u=>{if(t.value==="aborted")return ye;const p=await this._def.schema._parseAsync({data:u,path:a.path,parent:a});return p.status==="aborted"?ye:p.status==="dirty"||t.value==="dirty"?Ur(p.value):p});{if(t.value==="aborted")return ye;const u=this._def.schema._parseSync({data:d,path:a.path,parent:a});return u.status==="aborted"?ye:u.status==="dirty"||t.value==="dirty"?Ur(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,c);if(a.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(a.common.async===!1){const u=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return u.status==="aborted"?ye:(u.status==="dirty"&&t.dirty(),d(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(u=>u.status==="aborted"?ye:(u.status==="dirty"&&t.dirty(),d(u.value).then(()=>({status:t.value,value:u.value}))))}if(s.type==="transform")if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ei(d))return d;const u=s.transform(d.value,c);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>Ei(d)?Promise.resolve(s.transform(d.value,c)).then(u=>({status:t.value,value:u})):d);De.assertNever(s)}}Qt.create=(i,e,t)=>new Qt({schema:i,typeName:me.ZodEffects,effect:e,...xe(t)}),Qt.createWithPreprocess=(i,e,t)=>new Qt({schema:e,effect:{type:"preprocess",transform:i},typeName:me.ZodEffects,...xe(t)});class kn extends Se{_parse(e){return this._getType(e)===te.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kn.create=(i,e)=>new kn({innerType:i,typeName:me.ZodOptional,...xe(e)});class qn extends Se{_parse(e){return this._getType(e)===te.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qn.create=(i,e)=>new qn({innerType:i,typeName:me.ZodNullable,...xe(e)});class Li extends Se{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===te.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Li.create=(i,e)=>new Li({innerType:i,typeName:me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...xe(e)});class Fi extends Se{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Si(s)?s.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Bt(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Fi.create=(i,e)=>new Fi({innerType:i,typeName:me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...xe(e)});class jo extends Se{_parse(e){if(this._getType(e)!==te.nan){const a=this._getOrReturnCtx(e);return Q(a,{code:q.invalid_type,expected:te.nan,received:a.parsedType}),ye}return{status:"valid",value:e.data}}}jo.create=i=>new jo({typeName:me.ZodNaN,...xe(i)});const Zh=Symbol("zod_brand");class vs extends Se{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class $i extends Se{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?ye:c.status==="dirty"?(t.dirty(),Ur(c.value)):this._def.out._parseAsync({data:c.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?ye:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,t){return new $i({in:e,out:t,typeName:me.ZodPipeline})}}class zi extends Se{_parse(e){const t=this._def.innerType._parse(e),a=s=>(Ei(s)&&(s.value=Object.freeze(s.value)),s);return Si(t)?t.then(s=>a(s)):a(t)}unwrap(){return this._def.innerType}}zi.create=(i,e)=>new zi({innerType:i,typeName:me.ZodReadonly,...xe(e)});function Xc(i,e={},t){return i?jr.create().superRefine((a,s)=>{var c,d;if(!i(a)){const u=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,p=(d=(c=u.fatal)!==null&&c!==void 0?c:t)!==null&&d!==void 0?d:!0,h=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...h,fatal:p})}}):jr.create()}const Uh={object:qe.lazycreate};var me;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(me||(me={}));const jh=(i,e={message:`Input not instance of ${i.name}`})=>Xc(t=>t instanceof i,e),Qc=Jt.create,ed=jn.create,Wh=jo.create,Hh=Wn.create,td=Ni.create,qh=wr.create,Gh=$o.create,Kh=Bi.create,Yh=Oi.create,Jh=jr.create,Xh=br.create,Qh=Nn.create,em=zo.create,tm=Xt.create,nm=qe.create,rm=qe.strictCreate,im=Ai.create,om=Zo.create,am=Ri.create,sm=bn.create,lm=Di.create,cm=Uo.create,dm=kr.create,um=Hr.create,fm=Ii.create,pm=Mi.create,hm=Hn.create,mm=Pi.create,gm=qr.create,nd=Qt.create,ym=kn.create,_m=qn.create,wm=Qt.createWithPreprocess,bm=$i.create;var Wo=Object.freeze({__proto__:null,defaultErrorMap:Zr,setErrorMap:Eh,getErrorMap:Po,makeIssue:Lo,EMPTY_PATH:Sh,addIssueToContext:Q,ParseStatus:ft,INVALID:ye,DIRTY:Ur,OK:_t,isAborted:ws,isDirty:bs,isValid:Ei,isAsync:Si,get util(){return De},get objectUtil(){return _s},ZodParsedType:te,getParsedType:Un,ZodType:Se,datetimeRegex:Yc,ZodString:Jt,ZodNumber:jn,ZodBigInt:Wn,ZodBoolean:Ni,ZodDate:wr,ZodSymbol:$o,ZodUndefined:Bi,ZodNull:Oi,ZodAny:jr,ZodUnknown:br,ZodNever:Nn,ZodVoid:zo,ZodArray:Xt,ZodObject:qe,ZodUnion:Ai,ZodDiscriminatedUnion:Zo,ZodIntersection:Ri,ZodTuple:bn,ZodRecord:Di,ZodMap:Uo,ZodSet:kr,ZodFunction:Hr,ZodLazy:Ii,ZodLiteral:Mi,ZodEnum:Hn,ZodNativeEnum:Pi,ZodPromise:qr,ZodEffects:Qt,ZodTransformer:Qt,ZodOptional:kn,ZodNullable:qn,ZodDefault:Li,ZodCatch:Fi,ZodNaN:jo,BRAND:Zh,ZodBranded:vs,ZodPipeline:$i,ZodReadonly:zi,custom:Xc,Schema:Se,ZodSchema:Se,late:Uh,get ZodFirstPartyTypeKind(){return me},coerce:{string:i=>Jt.create({...i,coerce:!0}),number:i=>jn.create({...i,coerce:!0}),boolean:i=>Ni.create({...i,coerce:!0}),bigint:i=>Wn.create({...i,coerce:!0}),date:i=>wr.create({...i,coerce:!0})},any:Jh,array:tm,bigint:Hh,boolean:td,date:qh,discriminatedUnion:om,effect:nd,enum:hm,function:um,instanceof:jh,intersection:am,lazy:fm,literal:pm,map:cm,nan:Wh,nativeEnum:mm,never:Qh,null:Yh,nullable:_m,number:ed,object:nm,oboolean:()=>td().optional(),onumber:()=>ed().optional(),optional:ym,ostring:()=>Qc().optional(),pipeline:bm,preprocess:wm,promise:gm,record:lm,set:dm,strictObject:rm,string:Qc,symbol:Gh,transformer:nd,tuple:sm,undefined:Kh,union:im,unknown:Xh,void:em,NEVER:ye,ZodIssueCode:q,quotelessJson:Ch,ZodError:Bt});function km(i){throw new Error("Unexpected object: "+i)}const xm=-2147483648,rd=-9007199254740991n,vm=NaN,Cm=NaN,Em=null,Sm=null;function id(i,e){switch(e){case"Int":return i===xm;case"Long":return i===Number(rd)||i===rd;case"Float":return i===vm;case"Double":return i===Cm;case"String":return i===Em;case"Bytes":return i===Sm;default:throw Error(`unsupported data type: ${e}`)}}function Tm(i,e){const t=Math.floor(e/8),a=1<<7-e%8;return(i[t]&a)>0}function od(i){const{type:e,name:t,domain:a}=i;return{type:e,name:t,...a&&{domain:a}}}function Cs(i){return i.map(od)}function Ho(i,e){switch(i.type){case"column":return{type:"column",column:e(i.column)};case"inner":case"full":return{type:i.type,entries:i.entries.map(t=>Ho(t,e))};case"outer":return{type:"outer",primary:Ho(i.primary,e),secondary:i.secondary.map(t=>Ho(t,e))};default:km(i)}}Wo.object({__isRef:Wo.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Wo.string().describe("Upstream block id"),name:Wo.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 Vm(i){if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function Nm(){return Vm()}function Bm(i){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(i)}function ad(){_r.ModuleRegistry.registerModules([Mo.ClientSideRowModelModule,$c.InfiniteRowModelModule,lh.CsvExportModule,zc.ClipboardModule,Zc.RangeSelectionModule,ch.RichSelectModule,dh.MenuModule,uh.ExcelExportModule]);const i=Bm("AGGRID_LICENSE");i?(Qe.LicenseManager.setLicenseKey(i),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const sd=Symbol("sdk-vue");function Es(){return n.inject(sd)}function Om(i,e){let t;ad();const a=()=>{i.loadBlockState().then(c=>{s.loaded=!0;const d=vh(c,i),u=e(d);t=Object.assign(d,{...u,routes:Object.fromEntries(Object.entries(u.routes).map(([p,h])=>[p,n.markRaw(h)]))})}).catch(c=>{console.error("load initial state error",c),s.error=c})},s=n.reactive({loaded:!1,error:void 0,useApp(){return ph(t,"App is not loaded")},install(c){c.provide(sd,this),a()}});return s}var Am=Object.defineProperty,Rm=(i,e,t)=>e in i?Am(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Dm=(i,e,t)=>Rm(i,e+"",t);const Im=10,Mm=30,Pm=[{text:"Delete row",value:"delete:row"},{text:"Update value",value:"update:value"}],Lm=[{text:"Delete column",value:"delete:column"},{text:"Fit content",value:"expand:column"}],Fm=["^data-row-index"],$m=["value"],zm=n.defineComponent({__name:"TdCell",props:{cell:{},showContextOptions:{type:Function},cellEvents:{}},emits:["delete:row","update:value"],setup(i,{emit:e}){const t=e,a=i,s=n.reactive({edit:!1});function c(h){t("update:value",{rowIndex:a.cell.rowIndex,name:a.cell.colName,value:h.target.value}),s.edit=!1}function d(){const h=a.cellEvents??[];if(!a.showContextOptions){console.warn("inject showContextOptions interface for the table");return}const g=Pm.filter(x=>h.includes(x.value));g.length&&a.showContextOptions(g,x=>{t(x,a.cell.rowIndex)})}const u=n.ref();function p(){a.cell.editable&&(s.edit=!0,requestAnimationFrame(()=>{var h,g;(g=(h=u.value)==null?void 0:h.querySelector("input"))==null||g.focus()}))}return(h,g)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"cellRef",ref:u,class:n.normalizeClass(["cell",{[h.cell.class]:!0,edit:s.edit}]),"^data-row-index":h.cell.rowIndex,onContextmenu:d,onClick:n.withModifiers(p,["stop"])},[s.edit?(n.openBlock(),n.createElementBlock("input",{key:0,value:h.cell.value,onFocusout:g[0]||(g[0]=x=>s.edit=!1),onChange:c},null,40,$m)):n.renderSlot(h.$slots,"default",{key:1})],42,Fm))}});function Ge(i,e,t,a=!1){n.onMounted(()=>{var s;return(s=n.unref(i))==null?void 0:s.addEventListener(e,t,a)}),n.onUnmounted(()=>{var s;return(s=n.unref(i))==null?void 0:s.removeEventListener(e,t,a)})}function Zm(i){n.onMounted(()=>window.addEventListener("mouseup",i)),n.onUnmounted(()=>window.removeEventListener("mouseup",i))}function ld(i){let e=!1;return function(...t){e?console.log("handle pressure"):(requestAnimationFrame(()=>{i(...t),e=!1}),e=!0)}}function Um(i,e){let t;function a(c){t={...c}}Zm(()=>{t=void 0,e()});const s=ld(i);return Ge(window,"mousemove",c=>{t&&s({x:t.x,width:t.width,diff:c.x-t.x})}),{start:a}}var jm=Object.defineProperty,Wm=(i,e,t)=>e in i?jm(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ss=(i,e,t)=>Wm(i,typeof e!="symbol"?e+"":e,t);function Ts(i,e){if(i==null)throw Error(e??"Empty (null | undefined) value");return i}function Hm(i,e){if(i===void 0)throw Error(e??"Undefined value");return i}function qm(i=void 0){return i}function Gm(i){return i}function Km(i){return[...new Set(i)]}function Ym(i,e){if(i==null)throw Error(e??"Empty (null | undefined) value")}function Jm(i,e){if(i===void 0)throw Error(e??"Undefined value")}function cd(i,e,t){const a=Math.min(e,t),s=Math.max(e,t);return i>=a&&i<=s}function Xm(i){return i.map(e=>({text:String(e),value:e}))}function Qm(i){return function(...e){const t=i(...e);async function a(s){return s.done?Promise.resolve(s.value):Promise.resolve(s.value).then(c=>a(t.next(c))).catch(c=>a(t.throw(c)))}try{return a(t.next())}catch(s){return Promise.reject(s)}}}class eg{constructor(){Ss(this,"promise"),Ss(this,"resolve",()=>{}),Ss(this,"reject",()=>{}),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}function qo(i){return new Promise(e=>setTimeout(e,i))}function tg(){return new Promise(i=>queueMicrotask(i))}function ng(){const i=new Date().getTime();return function(){return new Date().getTime()-i}}function rg(){const i=performance.now();return function(){return performance.now()-i}}function dd(i){return i()}function Zi(i,e,t){return e>i?e:i>t?t:i}function Vs(i,e){return e(i)}function Gn(i,e){if(i!=null)return e(i)}function ig(i,e){return i=Math.ceil(i),e=Math.floor(e),Math.floor(Math.random()*(e-i))+i}function*ud(i,e,t=1){for(let a=i;a<e;a+=t)yield a}function fd(i){const e=[];for(const t of i)e.push(t);return e}function og(i,e){return fd(ud(0,i)).map(e)}class ag{constructor(e){this._delay=e}async*generate(){let e=0;for(;;)await qo(this._delay),yield e++}async*[Symbol.asyncIterator](){let e=0;for(;;)await qo(this._delay),yield e++}}function sg(i,e){return Array.from({length:i},(t,a)=>e(a))}function lg(i,e){throw Error(e)}function cg(i){return e=>i[e]()}function pd(i){if(i&&i.ok)return i.value}function dg(i){if(i&&!i.ok)return i.error}function ug(i){if(i.ok)return i.value;throw Error(i.error)}function fg(i){return Array.isArray(i)?i:[i]}async function hd(i){return Object.fromEntries(await Promise.all(Object.entries(i).map(async([e,t])=>[e,await t])))}function pg(i,e){return Object.keys(e).every(t=>i[t]===e[t])}const Ns=i=>i;function hg(i){return i}function mg(i){return Object.entries(i).map(([e,t])=>({key:e,value:t}))}const Go=Object.freeze(Object.defineProperty({__proto__:null,Deferred:eg,Interval:ag,alike:pg,arrayFrom:sg,asConst:hg,async:Qm,between:cd,bool:Gm,call:dd,checkIfDefined:Jm,checkIfNotEmpty:Ym,clamp:Zi,delay:qo,errorOptional:dg,exhaustive:lg,flatValue:fg,identity:Ns,listToOptions:Xm,match:cg,notEmpty:Ts,notUndef:Hm,okOptional:pd,performanceTimer:rg,randomInt:ig,range:ud,resolveAwaited:hd,tap:Vs,tapIf:Gn,tear:tg,timer:ng,times:og,toList:fd,undef:qm,unionize:mg,uniqueValues:Km,unwrap:ug},Symbol.toStringTag,{value:"Module"}));function gg(i,e){return i=Math.ceil(i),e=Math.floor(e),Math.floor(Math.random()*(e-i))+i}function yg(i){return i=i.replace(" ","-"),(i[0]||"").toLowerCase()+i.slice(1).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function _g(i,e=[]){for(i=i?String(i):"";e.includes(i.charAt(0));)i=i.substr(1);for(;e.includes(i.charAt(i.length-1));)i=i.substr(0,i.length-1);return i}function md(i){return i.replace(/^.*[\\/]/,"")}function gd(i){return i.replace(/^.*?[.]/,"")}function wg(i,e){const t=[];if(i.dataTransfer)for(let a=0;a<i.dataTransfer.items.length;a++){if(i.dataTransfer.items[a].kind!=="file")continue;const s=i.dataTransfer.items[a].getAsFile();s&&s.path&&t.push(s.path)}return e?t.filter(a=>e.includes(gd(md(a)))):t}const bg=(i,e,t="s")=>`${i} ${e}${i!==1?t:""}`;function kg(i){try{return new RegExp(i),!0}catch{return!1}}function xg(i){return i?i.charAt(0).toUpperCase()+i.slice(1):""}function vg(i){return i?i.charAt(0).toLowerCase()+i.slice(1):""}function yd(i){let e="";for(let t=0;t<i;t++)e+=String.fromCharCode(gg(65,91));return e}function _d(){return yd(42)}function Cg(i,e){return i.substring(0,i.indexOf(e))}function Eg(i,e){return i.substring(0,i.lastIndexOf(e))}function Sg(i,e){return i.substring(i.indexOf(e)+e.length,i.length)}function Tg(i){if(typeof i!="string")throw Error("Expect string value, got: "+typeof i)}function Vg(i){let e=0,t,a;if(i.length===0)return e;for(t=0;t<i.length;t++)a=i.charCodeAt(t),e=(e<<5)-e+a,e|=0;return e}const Ng=Object.freeze(Object.defineProperty({__proto__:null,after:Sg,assertString:Tg,before:Cg,beforeLast:Eg,camelToKebab:yg,extractExtension:gd,extractFileName:md,extractPaths:wg,hashCode:Vg,isRegexpValid:kg,lcFirst:vg,pluralize:bg,randomString:yd,trimChars:_g,ucFirst:xg,uniqueId:_d},Symbol.toStringTag,{value:"Module"}));function Ui(i){return i!==null&&typeof i=="object"}function Bg(i,e){return Object.keys(i).map(t=>e(i[t],t))}function Bs(i,e){return Ui(i)&&Ui(e)?Object.keys(i).length!==Object.keys(e).length?!1:Object.keys(i).every(t=>Bs(i[t],e[t])):i===e}function ji(i){if(Array.isArray(i)){const e=[];for(let t=0;t<i.length;t++)e[t]=ji(i[t]);return e}else if(Ui(i)){const e={};return Object.keys(i).forEach(t=>{e[t]=ji(i[t])}),e}else return i}function Og(i){return Array.isArray(i)?Object.assign([],i):Ui(i)?Object.assign({},i):i}function Ag(i,e){const t={};for(const a in e)e[a]!==i[a]&&(t[a]=i[a]);return t}function Rg(i,e,t){return Object.assign({},i,{[e]:t})}function Dg(i){return Object.entries(i).forEach(([e,t])=>{t instanceof Function&&(i[e]=t.bind(i))}),i}function Ig(i,e,t){return i[e]=t,i}function Mg(i,e){return i[e]}function Pg(i,e){i={...i};const t=i[e];return delete i[e],[t,i]}function Lg(i,...e){return Object.assign({},...e.map(t=>({[t]:i[t]})))}function Fg(i,...e){return e.map(t=>i[t])}function $g(i,...e){const t=Object.assign({},i);return e.forEach(a=>delete t[a]),t}const Os=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:Dg,deepClone:ji,deepEqual:Bs,getProp:Mg,iSet:Rg,isObject:Ui,map:Bg,omit:$g,pick:Lg,pickValues:Fg,setProp:Ig,shallowClone:Og,shallowDiff:Ag,shiftProp:Pg},Symbol.toStringTag,{value:"Module"}));function zg(i,e){const t=i.findIndex(e);if(t<0)return[];const a=(()=>{for(let s=t;s<i.length;s++)if(!e(i[s],s))return s;return i.length})();return i.slice(t,a)}function wd(i,e,t){let a;return function(...s){a&&clearTimeout(a),a=setTimeout(()=>{a=void 0,i.apply(this,s)},e)}}const Zg=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ug=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],jg=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Wg=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bd=(i,e)=>{let t=String(i);return typeof e=="string"||Array.isArray(e)?t=i.toLocaleString(e):e===!0&&(t=i.toLocaleString(void 0)),t};function As(i,e){if(i=typeof i=="bigint"?Number(i):i,!Number.isFinite(i))throw new TypeError(`Expected a finite number, got ${typeof i}: ${i}`);Object.assign(e,{bits:!1,binary:!1});const t=e.bits?e.binary?Wg:jg:e.binary?Ug:Zg;if(e.signed&&i===0)return` 0 ${t[0]}`;const a=i<0,s=a?"-":e.signed?"+":"";if(a&&(i=-i),i<1){const p=bd(i,e.locale);return s+p+" "+t[0]}const c=Math.min(Math.floor(e.binary?Math.log(i)/Math.log(1024):Math.log10(i)/3),t.length-1);i/=(e.binary?1024:1e3)**c,i=Number(i.toPrecision(3));const d=bd(Number(i),e.locale),u=t[c];return s+d+" "+u}function Hg(i){var e;const t=Go.tapIf((e=n.unref(i))==null?void 0:e.querySelectorAll(".th-cell"),a=>[...a])??[];return t.map((a,s)=>{const{width:c,x:d}=a.getBoundingClientRect();return{index:s,width:c,x:d,right:d+c}}).slice(0,t.length-1)}function Rs(){const i=n.reactive({x:0,y:0});function e(t){i.x=t.pageX,i.y=t.pageY}return n.onMounted(()=>window.addEventListener("mousemove",e)),n.onUnmounted(()=>window.removeEventListener("mousemove",e)),i}function Ds(i,e={}){const{delayEnter:t=0,delayLeave:a=0}=e,s=n.ref(!1);let c;const d=u=>{const p=u?t:a;c&&(clearTimeout(c),c=void 0),p?c=setTimeout(()=>s.value=u,p):s.value=u};return window&&(Ge(i,"mouseenter",()=>d(!0)),Ge(i,"mouseleave",()=>d(!1))),s}const{tapIf:qg,clamp:Gg}=Go;function Kg(i,e){const t=Rs(),a=Ds(e,{}),s=Um(d=>{qg(i.resizeTh,u=>{i.columnsMeta[u.index]={width:Gg(d.width+d.diff,Mm,1e4)}})},()=>{i.resize=!1,i.resizeTh=void 0,document.body.style.cursor=""});function c(d){i.resizeTh&&(i.resize=!0,s.start({x:d.x,width:i.resizeTh.width}))}return n.watchEffect(()=>{if(!a.value){document.body.style.cursor="";return}if(i.resize)return;const d=Hg(e).find(u=>Math.abs(t.x-u.right)<Im);d?(document.body.style.cursor="col-resize",i.resizeTh=d):(i.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const xr=(i,e)=>{const t=i.__vccOpts||i;for(const[a,s]of e)t[a]=s;return t},Yg={},Jg={class:"add-column-btn"};function Xg(i,e){return n.openBlock(),n.createElementBlock("div",Jg,e[0]||(e[0]=[n.createElementVNode("div",null,null,-1)]))}const Qg=xr(Yg,[["render",Xg]]),ey={},ty={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ny(i,e){return n.openBlock(),n.createElementBlock("svg",ty,e[0]||(e[0]=[n.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),n.createTextVNode(),n.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 ry=xr(ey,[["render",ny]]),iy=n.defineComponent({__name:"ThCell",props:{col:{},showContextOptions:{type:Function},columnEvents:{}},emits:["delete:column","expand:column","change:sort"],setup(i,{emit:e}){const t=e,a=i;function s(u,p){const h=p.indexOf(u)+1;return p[h>=p.length?0:h]}function c(){const u=a.columnEvents??[];if(!a.showContextOptions){console.warn("inject showContextOptions interface for the table");return}const p=Lm.filter(h=>u.includes(h.value));p.length&&a.showContextOptions(p,h=>{t(h,a.col.name)})}function d(u,p){t("change:sort",{colName:u,direction:s(p??"DESC",["DESC","ASC"])})}return(u,p)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["cell th-cell",{"justify-center":u.col.justify}]),onContextmenu:c},[u.col.valueType?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(u.col.valueType)},null,2)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(u.col.text)+" ",1),u.col.sort?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["sort",u.col.sort.direction]),onClick:p[0]||(p[0]=n.withModifiers(()=>{var h;return d(u.col.name,(h=u.col.sort)==null?void 0:h.direction)},["stop"]))},null,2)):n.createCommentVNode("",!0)],34))}}),oy=n.defineComponent({__name:"TRow",props:{index:{},visible:{type:Boolean},height:{}},setup(i){return(e,t)=>(n.openBlock(),n.createElementBlock("div",{class:"t-row",style:n.normalizeStyle(`height: ${e.height}px`)},[e.visible?n.renderSlot(e.$slots,"default",{key:0}):n.createCommentVNode("",!0)],4))}});function kd(i){return typeof i=="number"||typeof i=="string"?i:String(i)}function ay(i,e,t){for(const[a,s]of Object.entries(i)){const c=kd(e[a]),d=kd(t[a]),u=s==="DESC"?-1:1;if(c!==d)return(c>d?1:-1)*u}return 0}function xd(i){return i()}function Is(i,e){if(i==null)throw Error(e);return i}function Ms(i){let e=!1;return function(...t){e||(requestAnimationFrame(()=>{i(...t),e=!1}),e=!0)}}function vd(i){return new Promise(e=>setTimeout(e,i))}function Cd(i,e){const t=setTimeout(i,e);return()=>{clearTimeout(t)}}function Ed(i,e){return i=Math.ceil(i),e=Math.floor(e),Math.floor(Math.random()*(e-i))+i}function sy(i){let e="";for(let t=0;t<i;t++)e+=String.fromCharCode(Ed(65,91));return e}function Sd(i){return function(e){return 1-i(1-e)}}function ly(i){return function(e){return e<.5?i(2*e)/2:(2-i(2*(1-e)))/2}}function Td(i){const{duration:e,draw:t,timing:a}=i,s=performance.now();let c=!1;return requestAnimationFrame(function d(u){let p=(u-s)/e;(p>1||c)&&(p=1);const h=a(p);t(h),p<1&&requestAnimationFrame(d)}),function(){c=!0}}function cy(i){const{getFraction:e,draw:t,timing:a}=i,s=performance.now();let c=!1;return requestAnimationFrame(function d(u){let p=e(u-s);if(c)return;p>1&&(p=1);const h=a(p);t(h),p<1&&requestAnimationFrame(d)}),function(){c=!0}}function Vd(i,e){let t=-1;return(...a)=>{t!==-1&&(clearTimeout(t),t=-1),t=window.setTimeout(()=>i(...a),e)}}function Ps(i,e,t=!0){let a=0,s;return function(...c){s=()=>{i.apply(this,c),a=new Date().getTime()+e,s=null,t&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>a&&s()}}function dy(i){return i.map(e=>({text:String(e),value:e}))}function Gr(i){return i.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const Ls=40,uy=n.defineComponent({__name:"index",props:{settings:{}},emits:["click:cell","delete:row","delete:column","change:sort","update:value"],setup(i){const{tapIf:e,tap:t}=Go,{uniqueId:a}=Ng,s=i,c=n.reactive({rowIndex:-1,columnsMeta:{},resize:!1,resizeTh:void 0,bodyHeight:0,scrollTop:0}),d=n.ref(),u=n.ref(),p=n.ref(),h=()=>{e(p.value,j=>{c.bodyHeight=j.getBoundingClientRect().height})},g=n.computed(()=>s.settings.autoLastColumn?[...s.settings.columns,{name:a(),text:"_"}]:s.settings.columns),x=n.computed(()=>{const{columnsMeta:j}=c,z=n.unref(g),W=Object.keys(j).length;return z.map((O,B)=>B==z.length-1?W?"minmax(100px, 1fr)":O.width??"minmax(100px, 1fr)":j[B]?j[B].width+"px":O.width??"140px").join(" ")}),R=n.computed(()=>({gridColumn:"1 / "+n.unref(g).length+1})),T=n.computed(()=>n.unref(g).reduce((j,z)=>(j[z.name]=z.justify?"justify-"+z.justify:"",j),{})),C=n.computed(()=>{const j=n.unref(g),z=s.settings.rows.slice(),{bodyHeight:W,scrollTop:O}=c;if(s.settings.selfSort){const Z=j.reduce((L,H)=>{var oe;return(oe=H.sort)!=null&&oe.direction&&(L[H.name]=H.sort.direction),L},{});Object.keys(Z).length&&z.sort((L,H)=>ay(Z,L,H))}const B=160;let P=0;return z.map((Z,L)=>{const H=t(Z.__height?Number(Z.__height):Ls,ae=>!Number.isFinite(ae)||ae<Ls?Ls:ae),oe=j.map(ae=>{const J=ae.name;return{colName:J,rowIndex:L,value:Z[J],class:T.value[J]+(L===c.rowIndex?" hovered":""),slot:ae.slot,editable:ae.editable}}),de=W?O<P+H+B&&P<W+O+B:!1;return P+=H+1,{visible:de,height:H,cells:oe}})}),{mouseDown:k}=Kg(c,d);function S(){e(u.value,j=>{var z;j.scrollLeft=((z=p.value)==null?void 0:z.scrollLeft)??0})}const v=Ps(()=>{var j;c.scrollTop=((j=p.value)==null?void 0:j.scrollTop)??0},10),I=()=>{S(),v()};function K(j){const z=g.value.findIndex(O=>O.name===j);if(z<0)return;const W=s.settings.rows.reduce((O,B)=>{const P=9.52*Go.call(()=>{const Z=B[j];return Z&&typeof Z=="object"&&"segments"in Z?Z.segments.map(L=>L.sequence).join("").length:String(Z??"").length});return P>O?P:O},0);c.columnsMeta[z]={width:W}}return n.onMounted(()=>{n.nextTick(h)}),n.watchPostEffect(()=>{n.unref(s.settings),n.nextTick(h)}),Ge(window,"resize",()=>n.nextTick(h)),(j,z)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"tableRef",ref:d,class:"grid-table",onMousedown:z[5]||(z[5]=(...W)=>n.unref(k)&&n.unref(k)(...W))},[j.settings.addColumn?(n.openBlock(),n.createBlock(Qg,{key:0,onClick:n.withModifiers(j.settings.addColumn,["stop"])},null,8,["onClick"])):n.createCommentVNode("",!0),z[9]||(z[9]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"headRef",ref:u,class:"table-head",style:n.normalizeStyle({gridTemplateColumns:x.value})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(W,O)=>(n.openBlock(),n.createBlock(iy,{key:O,col:W,"show-context-options":j.settings.showContextOptions,"column-events":j.settings.columnEvents,"onDelete:column":z[0]||(z[0]=B=>j.$emit("delete:column",B)),"onChange:sort":z[1]||(z[1]=B=>j.$emit("change:sort",B)),"onExpand:column":z[2]||(z[2]=B=>K(B))},null,8,["col","show-context-options","column-events"]))),128))],4),z[10]||(z[10]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"bodyRef",ref:p,class:"table-body",onScroll:I},[C.value.length===0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"table-body__no-data",style:n.normalizeStyle(R.value)},[n.createElementVNode("div",null,[n.createVNode(ry),z[6]||(z[6]=n.createTextVNode()),z[7]||(z[7]=n.createElementVNode("div",null,"No Data To Show",-1))])],4)):n.createCommentVNode("",!0),z[8]||(z[8]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value,(W,O)=>(n.openBlock(),n.createBlock(oy,{key:O,visible:W.visible,height:W.height,index:O,style:n.normalizeStyle({gridTemplateColumns:x.value})},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W.cells,(B,P)=>(n.openBlock(),n.createBlock(zm,{key:P,cell:B,"show-context-options":j.settings.showContextOptions,"cell-events":j.settings.cellEvents,onClick:n.withModifiers(Z=>j.$emit("click:cell",B),["stop"]),"onDelete:row":z[3]||(z[3]=Z=>j.$emit("delete:row",Z)),"onUpdate:value":z[4]||(z[4]=Z=>j.$emit("update:value",Z))},{default:n.withCtx(()=>[B.slot?n.renderSlot(j.$slots,B.colName,n.mergeProps({key:0,ref_for:!0},B),()=>[n.createTextVNode(n.toDisplayString(B.value),1)]):n.renderSlot(j.$slots,"default",n.mergeProps({key:1,ref_for:!0},B),()=>[n.createTextVNode(n.toDisplayString(B.value),1)])]),_:2},1032,["cell","show-context-options","cell-events","onClick"]))),128))]),_:2},1032,["visible","height","index","style"]))),128))],544)],544))}}),fy={class:"context-menu"},py=["onClick"],hy=n.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(i,{emit:e}){const t=e,a=s=>{s.cb(),t("close")};return(s,c)=>(n.openBlock(),n.createElementBlock("div",fy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.options,(d,u)=>(n.openBlock(),n.createElementBlock("div",{key:u,onClick:n.withModifiers(p=>a(d),["stop"])},[n.createElementVNode("span",null,n.toDisplayString(d.text),1)],8,py))),128))]))}}),my=xr(hy,[["__scopeId","data-v-12530966"]]);function Fs(i,e){i.preventDefault();const t=()=>{n.render(null,document.body)},a=n.h(my,{options:e,onClose:()=>{t()}});n.render(a,document.body);const s=a.el;return s.style.top=i.clientY+"px",s.style.left=i.clientX+"px",document.addEventListener("click",c=>{s.contains(c.target)||t()}),t}const Nd=Symbol(),Ko=()=>n.inject(Nd),gy=["value"],yy={key:1},_y=n.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=e,a=i,s=n.reactive({edit:!1}),c=n.computed(()=>a.valueType),d=h=>{var g;let x=(g=h.target)==null?void 0:g.value;const R=n.unref(c),T=dd(()=>R==="integer"?parseInt(x,10):R==="float"?Number(x):x);t("update:modelValue",T),s.edit=!1},u=n.ref(),p=h=>{!h.metaKey&&a.editable&&(s.edit=!0,requestAnimationFrame(()=>{var g,x;(x=(g=u.value)==null?void 0:g.querySelector("input"))==null||x.focus()}))};return(h,g)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"baseRef",ref:u,class:n.normalizeClass(["base-cell",{"base-cell__edit":s.edit}]),onClick:p},[s.edit?(n.openBlock(),n.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:g[0]||(g[0]=x=>s.edit=!1),onChange:d},null,40,gy)):(n.openBlock(),n.createElementBlock("div",yy,n.toDisplayString(h.modelValue),1))],2))}}),wy=["^data-row-index"],by={key:0,class:"control-cell"},ky=n.defineComponent({__name:"TdCell",props:{cell:{}},setup(i){const e=i,t=Ko(),a=n.computed(()=>e.cell.column.valueType),s=h=>{Gn(t.settings.value.onUpdatedRow,g=>{const x=e.cell.row,R={...x.dataRow,[e.cell.id]:h};g({...x,dataRow:R})})},c=h=>{h.metaKey&&t.selectRow(e.cell.row.primaryKey)},d=(h,g)=>{if(h.type==="contextmenu")h.preventDefault();else return;const x=t.settings??{},R=[],{onSelectedRows:T,onSelectedColumns:C}=x.value,k=t.data.selectedRows.has(g.primaryKey);T&&T.length&&(k?R.push({text:"Deselect row",cb(){t.data.selectedRows.delete(e.cell.row.primaryKey)}}):R.push({text:"Select row",cb(){t.selectRow(e.cell.row.primaryKey)}})),C&&C.length&&(R.push({text:"Select column",cb(){t.selectColumn(e.cell.column.id)}}),R.push({text:"Unselect column",cb(){t.unselectColumn(e.cell.column.id)}})),R.length&&Fs(h,R)},u=n.ref(),p=n.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(h,g)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"cellRef",ref:u,class:n.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:c,onContextmenu:g[0]||(g[0]=x=>d(x,h.cell.row))},[h.cell.control?(n.openBlock(),n.createElementBlock("div",by,n.toDisplayString(h.cell.row.index),1)):p.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":s},null,8,["model-value"])):(n.openBlock(),n.createBlock(_y,{key:2,"model-value":h.cell.value,"value-type":a.value,editable:h.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,wy))}}),xy={},vy={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Cy(i,e){return n.openBlock(),n.createElementBlock("svg",vy,e[0]||(e[0]=[n.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),n.createTextVNode(),n.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 Ey=xr(xy,[["render",Cy]]),Sy={class:"tr-head"},Ty=n.defineComponent({__name:"TrHead",setup(i){return(e,t)=>(n.openBlock(),n.createElementBlock("div",Sy,[n.renderSlot(e.$slots,"default")]))}});function Vy(i,e){const t=e.indexOf(i)+1;return e[t>=e.length?0:t]}function Ny(i,e){const t=i.findIndex(e);if(t<0)return[];const a=(()=>{for(let s=t;s<i.length;s++)if(!e(i[s],s))return s;return i.length})();return i.slice(t,a)}const By=["^data-col-id"],Oy=n.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(i,{emit:e}){const t=e;function a(c){c.preventDefault();const d=[];d.length&&Fs(c,d)}function s(c){var d;const u=((d=c.sort)==null?void 0:d.direction)??"DESC";t("change:sort",{colId:c.id,direction:Vy(u,["DESC","ASC"])})}return(c,d)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["cell th-cell",{"justify-center":c.col.justify,frozen:c.col.frozen}]),"^data-col-id":c.col.id,onContextmenu:a},[c.col.valueType?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(c.col.valueType)},null,2)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(c.col.label)+" ",1),c.col.sort?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["sort",c.col.sort.direction]),onClick:d[0]||(d[0]=n.withModifiers(()=>s(c.col),["stop"]))},null,2)):n.createCommentVNode("",!0)],42,By))}}),Ay=n.defineComponent({__name:"TrBody",props:{row:{}},setup(i){const e=n.ref(),t=()=>{n.nextTick().then(()=>{Gn(e.value,a=>a.scrollLeft=0)})};return(a,s)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"trRef",ref:e,class:n.normalizeClass(["tr-body",{selected:a.row.selected}]),scroll:"no",style:n.normalizeStyle(a.row.style),onScroll:t},[n.renderSlot(a.$slots,"default")],38))}}),Ry=n.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(i){const e=Ko(),t=i,a=n.computed(()=>e.data.selectedColumns.has(t.column.id));return(s,c)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["column-caret",{selected:a.value,frozen:s.column.frozen}])},null,2))}});function Dy(i){n.onMounted(()=>window.addEventListener("mouseup",i)),n.onUnmounted(()=>window.removeEventListener("mouseup",i))}function Iy(i,e){let t;function a(c){t={...c}}Dy(()=>{t=void 0,e()});const s=ld(i);return Ge(window,"mousemove",c=>{t&&s({x:t.x,width:t.width,diff:c.x-t.x})}),{start:a}}const Kr=1,My=10,Py=30,Bd=60;function Ly(i){var e;const t=Gn((e=n.unref(i))==null?void 0:e.querySelectorAll(".th-cell"),a=>[...a])??[];return t.map(a=>{const{width:s,x:c}=a.getBoundingClientRect(),d=a.getAttribute("data-col-id");return Ns({colId:d,width:s,x:c,right:c+s})}).slice(0,t.length-1)}function Fy(i,e){const t=Rs(),a=Ds(e,{}),{data:s}=i,c=Iy(u=>{Gn(s.resizeTh,p=>{const h=s.columns.find(g=>g.id===p.colId);h&&(h.width=Zi(u.width+u.diff,Py,1e4),i.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),d=u=>{s.resizeTh&&(s.resize=!0,c.start({x:u.x,width:s.resizeTh.width}))};return n.watchEffect(()=>{if(!a.value){document.body.style.cursor="";return}if(s.resize)return;const u=Ly(e).find(p=>Math.abs(t.x-p.right)<My);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:d}}const $y={key:0,class:"command-menu"},zy={key:0},Zy=["onClick"],Uy=n.defineComponent({__name:"RowsCommandMenu",setup(i){const e=Ko(),t=n.computed(()=>e.getSelectedRows()),a=n.computed(()=>t.value.length>0),s=n.computed(()=>{var d;return((d=e.settings)==null?void 0:d.value.onSelectedRows)??[]}),c=n.computed(()=>s.value.map(d=>({label:d.label,cb:()=>{d.cb(t.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(d,u)=>a.value?(n.openBlock(),n.createElementBlock("div",$y,[t.value.length?(n.openBlock(),n.createElementBlock("span",zy,n.toDisplayString(t.value.length)+" rows selected",1)):n.createCommentVNode("",!0),u[0]||(u[0]=n.createTextVNode()),u[1]||(u[1]=n.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(p,h)=>(n.openBlock(),n.createElementBlock("span",{key:h,class:"command",onClick:n.withModifiers(p.cb,["stop"])},n.toDisplayString(p.label),9,Zy))),128))])):n.createCommentVNode("",!0)}}),jy={key:0,class:"command-menu"},Wy={key:0},Hy=["onClick"],qy=n.defineComponent({__name:"ColumnsCommandMenu",setup(i){const e=Ko(),t=n.computed(()=>e.getSelectedColumns()),a=n.computed(()=>t.value.length>0),s=n.computed(()=>{var d;return((d=e.settings)==null?void 0:d.value.onSelectedColumns)??[]}),c=n.computed(()=>s.value.map(d=>({label:d.label,cb:()=>{d.cb(t.value),e.data.selectedColumns.clear()}})));return(d,u)=>a.value?(n.openBlock(),n.createElementBlock("div",jy,[t.value.length?(n.openBlock(),n.createElementBlock("span",Wy,"selected columns "+n.toDisplayString(t.value.length),1)):n.createCommentVNode("",!0),u[0]||(u[0]=n.createTextVNode()),u[1]||(u[1]=n.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(p,h)=>(n.openBlock(),n.createElementBlock("span",{key:h,class:"command",onClick:n.withModifiers(p.cb,["stop"])},n.toDisplayString(p.label),9,Hy))),128))])):n.createCommentVNode("",!0)}});function Kn(i,e){const t={el:void 0,x:0,y:0},a=s=>({x:s.x,y:s.y,dx:s.x-t.x,dy:s.y-t.y});Ge(document,"mousedown",s=>{s.target===n.unref(i)&&(s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault(),t.el=n.unref(i),t.x=s.x,t.y=s.y)}),Ge(document,"mouseup",s=>{t.el&&(t.el=void 0,e({...a(s),stop:!0},t))}),Ge(document,"mousemove",s=>{t.el&&e(a(s),t)})}const Gy=n.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(i,{emit:e}){const t=e,a=i,s=n.ref(),c=n.computed(()=>a.windowSize-12),d=n.computed(()=>a.windowSize<a.dataSize),u=n.computed(()=>Math.ceil(a.offset*(c.value/a.dataSize))),p=n.computed(()=>Math.ceil(c.value*c.value/a.dataSize)),h=n.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return Kn(s,(g,x)=>{const R=(u.value+g.dy)*a.dataSize/c.value;t("change:offset",R),x.x=g.x,x.y=g.y}),(g,x)=>(n.openBlock(),n.createElementBlock("div",{class:"t-scroll",style:n.normalizeStyle({height:`${g.windowSize}px`})},[n.createElementVNode("div",null,[d.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"handleRef",ref:s,class:"t-scroll__handle",style:n.normalizeStyle(h.value)},null,4)):n.createCommentVNode("",!0)])],4))}});function Ky(i){return n.computed(()=>{const{data:e,settings:t}=i,{bodyWidth:a,scrollLeft:s}=e,c=[...e.columns],d=_d();t.value.controlColumn&&c.unshift({id:d,label:"#",width:60,frozen:!0});let u=0;const p=c.map(g=>{const x={...g,offset:u};return u+=g.width+Kr,x}),h=p.filter(g=>g.frozen);return zg(p,g=>g.frozen?!1:s<g.offset+g.width&&g.offset<a+s).concat(h).map(g=>({...g,style:{left:g.frozen?`${g.offset}px`:`${g.offset-e.scrollLeft}px`,width:`${g.width}px`},control:g.id===d}))})}function Yy(i,e){const t=n.computed(()=>e.value.reduce((a,s)=>(a[s.id]=s.justify?"justify-"+s.justify:"",a),{}));return n.computed(()=>i.rows.map(a=>{const s=t.value,{primaryKey:c,offset:d,dataRow:u,height:p}=a,h=e.value.map(g=>({id:g.id,column:g,row:a,value:u[g.id],class:s[g.id],editable:g.editable,width:g.width,style:g.style,control:g.control}));return Ns({style:{top:`${d-i.scrollTop}px`,height:`${a.height}px`},primaryKey:c,offset:d,height:p,cells:h,selected:i.selectedRows.has(c)})}))}const Jy=async(i,e)=>{const{scrollTop:t,bodyHeight:a}=i;return await qo(0),hd({rows:e.getRows(t,a),dataWindow:i})};function Xy(i){const e=n.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:i.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});n.watch(()=>i.settings,g=>{e.columns=ji(g.columns),e.currentWindow=void 0,g.dataSource.getHeight().then(x=>{e.dataHeight=x,h.updateBodyHeight()}).catch(x=>e.error=x)},{immediate:!0});const t=n.computed(()=>i.settings),a=n.computed(()=>e.columns.reduce((g,x)=>g+x.width+Kr,0)),s=n.computed(()=>Vs(h.data.dataHeight-h.data.bodyHeight,g=>g>0?g:0)),c=n.computed(()=>Vs(a.value-h.data.bodyWidth,g=>g>0?g:0)),d=n.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=Ky({data:e,settings:t}),p=Yy(e,u),h={data:e,settings:t,tableColumns:u,tableRows:p,adjustWidth:()=>{const g=e.columns.reduce((R,T)=>R+T.width+Kr,0),x=e.bodyWidth+e.scrollLeft;if(g<x){const R=e.columns[e.columns.length-1];R.width=R.width+(x-g)}},updateOffsets(g){this.updateScrollTop(e.scrollTop+g.deltaY),this.updateScrollLeft(e.scrollLeft+g.deltaX)},getSelectedRows(){return e.rows.filter(g=>e.selectedRows.has(g.primaryKey))},getSelectedColumns(){return e.columns.filter(g=>e.selectedColumns.has(g.id))},selectRow(g){e.selectedRows.add(g)},unselectRow(g){e.selectedRows.delete(g)},selectColumn(g){e.selectedColumns.add(g)},unselectColumn(g){e.selectedColumns.delete(g)},updateScrollTop(g){e.scrollTop=Zi(g,0,s.value)},updateScrollLeft(g){e.scrollLeft=Zi(g,0,c.value)},updateBodyHeight(){const{height:g}=i.settings,{dataHeight:x}=e,R=g>x?x:g;e.bodyHeight=R},updateDimensions(g){this.updateBodyHeight(),h.data.bodyWidth=g.width,h.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return n.watch(d,(g,x)=>{const R=g.current;(!R||g.scrollTop<R.scrollTop||g.scrollTop+g.bodyHeight>R.bodyHeight+R.scrollTop)&&(e.currentWindow={scrollTop:g.scrollTop-Bd,bodyHeight:g.bodyHeight+Bd*2},Jy(ji(e.currentWindow),t.value.dataSource).then(({rows:T,dataWindow:C})=>{Bs(e.currentWindow,C)&&(e.rows=T)}))},{deep:!0,immediate:!0}),n.provide(Nd,h),h}const Qy={class:"command-menu__container"},e_={key:0,class:"table-body__no-data"},t_={class:"carets"},$s=n.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(i,{emit:e}){const t=e,a=i,s=Xy(a),c=n.computed(()=>s.data.rows.length===0),d=n.computed(()=>({height:c.value?"212px":s.data.bodyHeight+"px"}));n.watch(s.data,k=>t("update:data",k),{deep:!0}),n.watch(a,()=>g);const u=n.ref(),p=n.ref(),h=n.ref(),g=()=>{Gn(h.value,k=>{s.updateDimensions(k.getBoundingClientRect())})},x=s.tableColumns,R=s.tableRows,{mouseDown:T}=Fy(s,u);n.onMounted(()=>{n.nextTick(g)}),n.watchPostEffect(()=>{n.unref(a.settings),n.nextTick(g)}),Ge(window,"resize",()=>n.nextTick(g));const C=k=>{k.preventDefault(),s.updateOffsets(k)};return(k,S)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:S[2]||(S[2]=(...v)=>n.unref(T)&&n.unref(T)(...v))},[n.createElementVNode("div",Qy,[n.createVNode(Uy),S[3]||(S[3]=n.createTextVNode()),n.createVNode(qy)]),S[7]||(S[7]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[n.createVNode(Ty,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(x),(v,I)=>(n.openBlock(),n.createBlock(Oy,{key:I,col:v,style:n.normalizeStyle(v.style),"onChange:sort":S[0]||(S[0]=K=>k.$emit("change:sort",K))},null,8,["col","style"]))),128))]),_:1})],512),S[8]||(S[8]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:n.normalizeStyle(d.value),onWheel:C},[c.value?(n.openBlock(),n.createElementBlock("div",e_,[n.createElementVNode("div",null,[n.createVNode(Ey),S[4]||(S[4]=n.createTextVNode()),S[5]||(S[5]=n.createElementVNode("div",null,"No Data To Show",-1))])])):n.createCommentVNode("",!0),S[6]||(S[6]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(R),(v,I)=>(n.openBlock(),n.createBlock(Ay,{key:I,row:v},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(v.cells,K=>(n.openBlock(),n.createBlock(ky,{key:K.column.id+":"+I,cell:K,style:n.normalizeStyle(K.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),S[9]||(S[9]=n.createTextVNode()),n.createElementVNode("div",t_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(x),(v,I)=>(n.openBlock(),n.createBlock(Ry,{key:I,column:v,style:n.normalizeStyle(v.style),"onChange:sort":S[1]||(S[1]=K=>k.$emit("change:sort",K))},null,8,["column","style"]))),128))]),S[10]||(S[10]=n.createTextVNode()),n.createVNode(Gy,{offset:n.unref(s).data.scrollTop,"window-size":n.unref(s).data.bodyHeight,"data-size":n.unref(s).data.dataHeight,"onChange:offset":n.unref(s).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),Od=new WeakMap;class n_{constructor(e,t,a){Dm(this,"dataHeight"),this.datum=e,this.resolveHeight=t,this.resolvePrimaryKey=a;const s=e.reduce((d,u,p)=>(d.indices.set(p,d.total),d.total+=this.resolveHeight(u,p)+Kr,d),{total:0,indices:new Map});this.dataHeight=s.total;const c=e.map((d,u)=>({dataRow:d,index:u,primaryKey:this.resolvePrimaryKey(d,u),offset:Ts(s.indices.get(u)),height:this.resolveHeight(d,u)}));Od.set(this,c)}get rows(){return Od.get(this)}async getHeight(){return this.dataHeight}async getRows(e,t){return Ny(this.rows,a=>{const s=a.offset;return e<s+a.height&&s<t+e})}}class r_{constructor(e,t,a){this.api=e,this.rowHeight=t,this.resolvePrimaryKey=a}get height(){return this.rowHeight+Kr}async getHeight(){return await this.api.count()*this.height}async getRows(e,t){const a=Zi(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(t+40/this.height);return(await this.api.query({offset:a,limit:s})).map((c,d)=>({dataRow:c,index:a+d,primaryKey:this.resolvePrimaryKey(c,a+d),offset:(a+d)*(this.rowHeight+Kr),height:this.rowHeight}))}}function i_(i){return Object.freeze(i)}function o_(i){return n.h($s,{settings:Object.freeze(i)})}function zs(i,e){const t=new n_(i,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:t}}function a_(i,e){return n.computed(()=>{const t=n.unref(i);return zs(t,n.unref(e))})}function s_(i,e){const t=n.computed(()=>{const s=n.unref(i);return zs(s,n.unref(e))}),a=n.reactive({settings:t});return n.computed(()=>n.h($s,a))}const l_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:r_,Component:$s,factory:o_,rawDataSettings:zs,settings:i_,useRawData:a_,useRawDataComponent:s_},Symbol.toStringTag,{value:"Module"}));function*c_(i,e){for(const t of i)yield e(t)}function d_(i){const e=[];for(const t of i)e.push(t);return e}const Zs=new Map;function u_(i){return Zs.has(i)||Zs.set(i,n.ref(localStorage.getItem(i))),Is(Zs.get(i),"...")}function f_(i,e){e==null?localStorage.removeItem(i):localStorage.setItem(i,e)}function Ad(i){const e=u_(i);return n.watch(e,t=>f_(i,t)),e}const Us=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",i=>{d_(c_(Us.values(),e=>e(i.matches?"dark":"light")))});const p_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",Rd=n.ref(p_),js=Ad("theme");function Dd(i){const e=n.computed(()=>js.value?js.value:Rd.value),t=s=>{Rd.value=s,i&&i(s)};function a(){js.value=e.value==="light"?"dark":(e.value,"light")}return n.watch(e,s=>{i&&i(n.unref(s))}),n.onMounted(()=>{Us.add(t)}),n.onUnmounted(()=>{Us.delete(t)}),[e,a]}const h_=n.defineComponent({__name:"ThemeSwitcher",setup(i){const[e,t]=Dd();return(a,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["ui-theme-switcher",n.unref(e)]),onClick:s[0]||(s[0]=(...c)=>n.unref(t)&&n.unref(t)(...c))},s[1]||(s[1]=[n.createElementVNode("div",null,null,-1)]),2))}}),m_={class:"pl-layout-component pl-block-page"},g_={key:0,class:"pl-block-page__title"},y_={class:"pl-block-page__title__append"},__={key:1},w_={class:"pl-block-page__body"},b_={name:"PlBlockPage"},k_=n.defineComponent({...b_,setup(i){const e=n.useSlots();return(t,a)=>(n.openBlock(),n.createElementBlock("div",m_,[n.unref(e).title?(n.openBlock(),n.createElementBlock("div",g_,[n.createElementVNode("h1",null,[n.renderSlot(t.$slots,"title")]),a[0]||(a[0]=n.createTextVNode()),n.createElementVNode("div",y_,[n.renderSlot(t.$slots,"append")])])):(n.openBlock(),n.createElementBlock("div",__)),a[1]||(a[1]=n.createTextVNode()),n.createElementVNode("div",w_,[n.renderSlot(t.$slots,"default")])]))}}),x_={name:"PlContainer"},v_=n.defineComponent({...x_,props:{width:{}},setup(i){const e=i,t=n.computed(()=>({width:e.width}));return(a,s)=>(n.openBlock(),n.createElementBlock("div",{class:"pl-container pl-layout-component",style:n.normalizeStyle(t.value)},[n.renderSlot(a.$slots,"default")],4))}}),C_={name:"PlRow"},E_=n.defineComponent({...C_,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(i){return(e,t)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[n.renderSlot(e.$slots,"default")],2))}}),S_={class:"pl-layout-component",style:{"flex-grow":"1"}},T_={name:"PlSpacer"},V_=n.defineComponent({...T_,setup(i){return(e,t)=>(n.openBlock(),n.createElementBlock("div",S_))}}),N_={name:"PlGrid"},B_=n.defineComponent({...N_,props:{columns:{}},setup(i){const e=i,t=n.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(a,s)=>(n.openBlock(),n.createElementBlock("div",{class:"pl-layout-component pl-grid",style:n.normalizeStyle(t.value)},[n.renderSlot(a.$slots,"default")],4))}}),O_={key:0,class:"pl-alert__icon"},A_={class:"pl-alert__main"},R_={key:0},D_={class:"pl-alert__main__text"},I_={name:"PlAlert"},M_=n.defineComponent({...I_,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(i){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(t,a)=>t.modelValue?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["pl-alert",[{monospace:t.monospace,whiteSpacePre:t.whiteSpacePre},t.type?`pl-alert__${t.type}`:""]]),style:n.normalizeStyle({maxHeight:t.maxHeight})},[t.icon&&t.type?(n.openBlock(),n.createElementBlock("div",O_,[n.createElementVNode("div",{class:n.normalizeClass(`icon-24 icon-${e[t.type]}`)},null,2)])):n.createCommentVNode("",!0),a[2]||(a[2]=n.createTextVNode()),n.createElementVNode("div",A_,[t.label?(n.openBlock(),n.createElementBlock("label",R_,n.toDisplayString(t.label),1)):n.createCommentVNode("",!0),a[1]||(a[1]=n.createTextVNode()),n.createElementVNode("div",D_,[n.renderSlot(t.$slots,"default")])]),a[3]||(a[3]=n.createTextVNode()),t.closeable?(n.openBlock(),n.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:a[0]||(a[0]=s=>t.$emit("update:modelValue",!1))})):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)}}),Wi=n.defineComponent({__name:"MaskIcon16",props:{name:{},size:{}},setup(i){const e=i,t=n.computed(()=>e.size==="large"?"--mask-size: 24px":""),a=n.computed(()=>`mask-16 mask-${e.name}`);return(s,c)=>(n.openBlock(),n.createElementBlock("i",{style:n.normalizeStyle(t.value),class:n.normalizeClass(a.value)},null,6))}});function Id(i){function e(t){const a=t.currentTarget,s=document.createElement("span"),c=Math.max(a.clientWidth,a.clientHeight),d=c/2;s.style.width=s.style.height=`${c}px`,s.style.left=`${t.clientX-a.offsetLeft-d}px`,s.style.top=`${t.clientY-a.offsetTop-d}px`,s.classList.add("ripple");const u=a.getElementsByClassName("ripple")[0];u&&u.remove(),a.appendChild(s)}n.onMounted(()=>{var t;(t=i.value)==null||t.addEventListener("click",e)})}const P_={key:0},L_={inheritAttrs:!1},Ws=n.defineComponent({...L_,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(i){const e=i,t=n.ref(),a=n.computed(()=>e.small||e.size==="small"),s=n.computed(()=>e.large||e.size==="large");return Id(t),(c,d)=>(n.openBlock(),n.createElementBlock("button",n.mergeProps({ref_key:"btn",ref:t,tabindex:"0",class:{loading:c.loading,small:a.value,large:s.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[c.round?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",P_,[n.renderSlot(c.$slots,"default")])),d[0]||(d[0]=n.createTextVNode()),c.loading?(n.openBlock(),n.createBlock(Wi,{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(n.openBlock(),n.createBlock(Wi,{key:2,name:c.icon,size:c.size},null,8,["name","size"])):n.createCommentVNode("",!0)],16))}}),F_={name:"PlBtnPrimary"},Md=n.defineComponent({...F_,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(i){const e=i;return(t,a)=>(n.openBlock(),n.createBlock(Ws,n.mergeProps({class:"pl-btn-primary"},e),{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default")]),_:3},16))}}),$_={name:"PlBtnAccent"},z_=n.defineComponent({...$_,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(i){const e=i;return(t,a)=>(n.openBlock(),n.createBlock(Ws,n.mergeProps({class:"ui-btn-accent"},e),{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default")]),_:3},16))}}),Z_={name:"PlBtnSecondary"},Hs=n.defineComponent({...Z_,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(i){const e=i;return(t,a)=>(n.openBlock(),n.createBlock(Ws,n.mergeProps(e,{class:"pl-btn-secondary"}),{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default")]),_:3},16))}}),U_={key:0},j_={name:"PlBtnGhost"},Pd=n.defineComponent({...j_,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!0}},setup(i){const e=i,t=n.computed(()=>e.size==="small"),a=n.computed(()=>e.size==="large"),s=n.ref(),c=n.useSlots();return Id(s),(d,u)=>(n.openBlock(),n.createElementBlock("button",n.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["ui-btn-ghost",{loading:d.loading,small:t.value,large:a.value,round:d.round,reverse:d.reverse,justifyCenter:d.justifyCenter,[d.$attrs.class+""]:!0}]},{...d.$attrs,disabled:!!d.$attrs.disabled||d.loading}),[n.unref(c).default&&!d.round?(n.openBlock(),n.createElementBlock("span",U_,[n.renderSlot(d.$slots,"default")])):n.createCommentVNode("",!0),u[0]||(u[0]=n.createTextVNode()),d.loading?(n.openBlock(),n.createBlock(Wi,{key:1,name:"loading",size:d.size},null,8,["size"])):d.icon?(n.openBlock(),n.createBlock(Wi,{key:2,name:d.icon,size:d.size},null,8,["name","size"])):n.createCommentVNode("",!0)],16))}}),W_=n.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(i){const e=i,t=n.ref(!1);return(a,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["ui-btn-link",{disabled:a.disabled,loading:a.loading,hover:t.value}]),onMouseover:s[0]||(s[0]=c=>t.value=!0),onMouseleave:s[1]||(s[1]=c=>t.value=!1)},[n.createVNode(Hs,n.mergeProps({round:"",hover:t.value},e),null,16,["hover"]),s[2]||(s[2]=n.createTextVNode()),n.renderSlot(a.$slots,"default")],34))}});function Ld(i,e){const t=Ms(()=>{if(i.value){const{scrollTop:a,scrollLeft:s,scrollHeight:c,scrollWidth:d,clientHeight:u,clientWidth:p}=document.documentElement,h=i.value.getBoundingClientRect();e({scrollTop:a,scrollLeft:s,scrollHeight:c,scrollWidth:d,clientHeight:u,clientWidth:p,offsetY:a+h.y,offsetX:s+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});n.onMounted(t),Ge(window,"scroll",t,!0),Ge(window,"resize",t,!0),Ge(window,"adjust",t,!0)}function H_(i,e){const t=n.ref();return Ld(i,a=>{t.value=a}),n.computed(()=>{const a=n.unref(t),s=n.unref(e),c=s.position??"top",d=s.gap??8;if(!a)return"";const u=a.offsetY+Math.floor(a.height/2),p=a.offsetX+Math.floor(a.width/2);return c==="top-left"?`left: ${a.offsetX}px; top: ${a.offsetY-d}px;`:c==="top"?`left: ${p}px; top: ${a.offsetY-d}px;`:c==="right"?`left: ${a.offsetX+a.width+d}px; top: ${u}px;`:c==="left"?`right: ${a.scrollWidth-a.x+d}px; top: ${u}px;`:""})}function Yo(i,e){return e(i)}function at(i,e){if(i!=null)return e(i)}function q_(i){return Array.isArray(i)?i:[i]}function G_(i,e,...t){t.forEach(a=>{i[a]=e[a]})}function Jo(i,e){Ge(document,"click",t=>{document.contains(t.target)&&(q_(i).map(a=>a.value).filter(a=>!!a).some(a=>a==null?void 0:a.contains(t.target))||e())})}const K_={},Y_={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function J_(i,e){return n.openBlock(),n.createElementBlock("svg",Y_,e[0]||(e[0]=[n.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const X_=xr(K_,[["render",J_]]),qs=new Map,Q_={name:"PlTooltip"},Zt=n.defineComponent({...Q_,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(i,{emit:e}){const t=e,a=Symbol(),s=i,c=n.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});qs.set(a,()=>h()),n.watch(()=>c.open,k=>{requestAnimationFrame(()=>{c.tooltipOpen=k})});let d=()=>{};const u=Ps(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{c.open=!0;for(let[k,S]of qs.entries())k!==a&&S()},h=()=>{c.open=!1,t("tooltip:close")},g=async()=>{s.hide||(u(),c.over=!0,d(),await vd(100),c.over&&p())},x=()=>{c.over=!1,d=Cd(()=>{c.over||h()},s.closeDelay)};n.watch(()=>s.hide,k=>{k&&h()});const R=n.ref(),T=n.ref(),C=H_(R,n.toRef(s));return Jo([R,T],()=>h()),n.onUnmounted(()=>{qs.delete(a)}),(k,S)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(k.element),n.mergeProps(k.$attrs,{ref_key:"rootRef",ref:R,onClick:g,onMouseover:g,onMouseleave:x}),{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default"),S[1]||(S[1]=n.createTextVNode()),k.$slots.tooltip&&c.open?(n.openBlock(),n.createBlock(n.Teleport,{key:0,to:"body"},[n.createVNode(n.Transition,{name:"tooltip-transition"},{default:n.withCtx(()=>[c.tooltipOpen?(n.openBlock(),n.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:n.normalizeStyle(n.unref(C))},[n.createElementVNode("div",{ref_key:"tooltip",ref:T,class:n.normalizeClass(["pl-tooltip",k.position]),onMouseover:g,onMouseleave:x},[n.createElementVNode("div",null,[n.renderSlot(k.$slots,"tooltip")]),S[0]||(S[0]=n.createTextVNode()),n.createVNode(X_)],34)],4)):n.createCommentVNode("",!0)]),_:3})])):n.createCommentVNode("",!0)]),_:3},16))}}),e0={},t0={class:"inner-border"};function n0(i,e,t,a,s,c){return n.openBlock(),n.createElementBlock("div",t0,[n.renderSlot(i.$slots,"default")])}const r0=xr(e0,[["render",n0]]),i0={key:0},o0=["tabindex","onKeydown","onClick"],a0={key:1,class:"ui-btn-group__helper"},s0={key:2,class:"ui-btn-group__error"},l0={name:"PlBtnGroup"},c0=n.defineComponent({...l0,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=n.useSlots(),a=e,s=u=>a("update:modelValue",u),c=i,d=n.computed(()=>c.options.map(u=>({label:"label"in u?u.label:u.text,value:u.value})));return(u,p)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["ui-btn-group",{disabled:u.disabled}])},[u.label?(n.openBlock(),n.createElementBlock("label",i0,[n.createElementVNode("span",null,n.toDisplayString(u.label),1),p[0]||(p[0]=n.createTextVNode()),n.unref(t).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(u.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),p[1]||(p[1]=n.createTextVNode()),n.createVNode(r0,{class:"ui-btn-group__container"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(h,g)=>(n.openBlock(),n.createElementBlock("div",{key:g,class:n.normalizeClass(["ui-btn-group__option",{active:u.modelValue===h.value}]),tabindex:u.modelValue===h.value||u.disabled?void 0:0,onKeydown:n.withKeys(x=>s(h.value),["enter"]),onClick:x=>s(h.value)},n.toDisplayString(h.label),43,o0))),128))]),_:1}),p[2]||(p[2]=n.createTextVNode()),u.helper?(n.openBlock(),n.createElementBlock("div",a0,n.toDisplayString(u.helper),1)):u.error?(n.openBlock(),n.createElementBlock("div",s0,n.toDisplayString(u.error),1)):n.createCommentVNode("",!0)],2))}}),d0={inheritAttrs:!1},u0={class:"double-contour"};function f0(i,e,t,a,s,c){return n.openBlock(),n.createElementBlock("div",u0,[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(i.$attrs)),[n.renderSlot(i.$slots,"default")],16)])}const Yr=xr(d0,[["render",f0]]);function Fd(i){n.onMounted(i),n.onUpdated(i)}const Gs=new WeakMap,Ks=new ResizeObserver(i=>{for(const e of i)at(Gs.get(e.target),t=>t(e))});function $d(i,e){Gs.set(i,e),Ks.unobserve(i),Ks.observe(i)}function zd(i){Ks.unobserve(i),Gs.delete(i)}const p0=8,Zd=4;function vr(i,e="label"){const t=new Set;Fd(()=>{at(i==null?void 0:i.value,a=>{const s=a.querySelector(e);s&&(t.add(s),$d(s,()=>{const c=xd(()=>s.getBoundingClientRect().width+Yo(p0,d=>Number.isNaN(d)?Zd:d+Zd));a.style.getPropertyValue("--label-offset-right-x")!==`${c}px`&&a.style.setProperty("--label-offset-right-x",`${c}px`)}))})}),n.onBeforeUnmount(()=>{Array.from(t.values()).map(a=>zd(a))})}function h0(i,e){const t=[];return e&&e.length>0&&e.forEach(a=>{const s=a(i);typeof s=="string"&&t.push(s)}),{isValid:t.length===0,errors:t}}function Ud(i,e){return n.computed(()=>h0(i.value,e))}const m0={class:"ui-text-field__envelope"},g0={key:0,ref:"label"},y0={key:0,class:"required-icon"},_0={key:1,class:"ui-text-field__prefix"},w0=["disabled","placeholder"],b0={class:"ui-text-field__append"},k0={key:0,class:"ui-text-field__error"},x0={key:1,class:"ui-text-field__helper"},v0={name:"PlTextField"},jd=n.defineComponent({...v0,props:{modelValue:{},label:{},clearable:{type:[Boolean,Function]},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.ref(void 0),d=n.ref(),u=n.computed({get(){return s.modelValue??""},set(C){a("update:modelValue",C)}}),p=()=>{s.clearable&&a("update:modelValue",s.clearable===!0?"":s.clearable())},h=Ud(u,s.rules||[]),g=n.computed(()=>s.clearable?s.clearable===!0?s.modelValue==="":s.modelValue===s.clearable():s.modelValue===""),x=n.computed(()=>!g.value),R=n.computed(()=>{const C=[];return s.error&&C.push(s.error),h.value.isValid||C.push(...h.value.errors),C}),T=n.computed(()=>R.value.length>0);return vr(c),(C,k)=>(n.openBlock(),n.createElementBlock("div",m0,[n.createElementVNode("div",{ref_key:"rootRef",ref:c,class:n.normalizeClass(["ui-text-field",{error:T.value,disabled:C.disabled,dashed:C.dashed,nonEmpty:x.value}])},[C.label?(n.openBlock(),n.createElementBlock("label",g0,[C.required?(n.openBlock(),n.createElementBlock("i",y0)):n.createCommentVNode("",!0),k[1]||(k[1]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(C.label),1),k[2]||(k[2]=n.createTextVNode()),n.unref(t).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(C.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0),k[4]||(k[4]=n.createTextVNode()),C.prefix?(n.openBlock(),n.createElementBlock("div",_0,n.toDisplayString(C.prefix),1)):n.createCommentVNode("",!0),k[5]||(k[5]=n.createTextVNode()),n.withDirectives(n.createElementVNode("input",{ref_key:"inputRef",ref:d,"onUpdate:modelValue":k[0]||(k[0]=S=>u.value=S),disabled:C.disabled,placeholder:C.placeholder||"...",type:"text",spellcheck:"false"},null,8,w0),[[n.vModelText,u.value]]),k[6]||(k[6]=n.createTextVNode()),n.createElementVNode("div",b0,[C.clearable&&x.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"icon icon--clear",onClick:p})):n.createCommentVNode("",!0),k[3]||(k[3]=n.createTextVNode()),n.renderSlot(C.$slots,"append")]),k[7]||(k[7]=n.createTextVNode()),n.createVNode(Yr,{class:"ui-text-field__contour"})],2),k[8]||(k[8]=n.createTextVNode()),T.value?(n.openBlock(),n.createElementBlock("div",k0,n.toDisplayString(R.value.join(" ")),1)):C.helper?(n.openBlock(),n.createElementBlock("div",x0,n.toDisplayString(C.helper),1)):n.createCommentVNode("",!0)]))}}),C0={class:"ui-text-area__envelope"},E0={key:0,ref:"label"},S0={key:0,class:"required-icon"},T0=["readonly","rows","disabled","placeholder"],V0={class:"ui-text-area__append"},N0={key:0,class:"ui-text-area__error"},B0={key:1,class:"ui-text-area__helper"},O0={name:"PlTextArea"},A0=n.defineComponent({...O0,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(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.ref(),d=n.ref(),u=n.computed({get(){return s.modelValue??""},set(T){a("update:modelValue",T)}}),p=n.computed(()=>!!s.modelValue),h=Ud(u,s.rules||[]);vr(c);const g=n.computed(()=>{const T=[];return s.error&&T.push(s.error),T.push(...h.value.errors),T}),x=n.computed(()=>g.value.length>0),R=()=>{if(!s.autogrow)return;const T=d.value;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)};return n.onMounted(()=>{R()}),(T,C)=>(n.openBlock(),n.createElementBlock("div",C0,[n.createElementVNode("div",{ref_key:"root",ref:c,class:n.normalizeClass(["ui-text-area",{error:x.value,disabled:T.disabled,dashed:T.dashed,nonEmpty:p.value}])},[T.label?(n.openBlock(),n.createElementBlock("label",E0,[T.required?(n.openBlock(),n.createElementBlock("i",S0)):n.createCommentVNode("",!0),C[1]||(C[1]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(T.label),1),C[2]||(C[2]=n.createTextVNode()),n.unref(t).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(T.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0),C[3]||(C[3]=n.createTextVNode()),n.withDirectives(n.createElementVNode("textarea",{ref_key:"input",ref:d,"onUpdate:modelValue":C[0]||(C[0]=k=>u.value=k),readonly:T.readonly,rows:T.rows,disabled:T.disabled,placeholder:T.placeholder??"...",spellcheck:"false",onInput:R},null,40,T0),[[n.vModelText,u.value]]),C[4]||(C[4]=n.createTextVNode()),n.createElementVNode("div",V0,[n.renderSlot(T.$slots,"append")]),C[5]||(C[5]=n.createTextVNode()),n.createVNode(Yr,{class:"ui-text-area__contour"})],2),C[6]||(C[6]=n.createTextVNode()),x.value?(n.openBlock(),n.createElementBlock("div",N0,n.toDisplayString(g.value.join(" ")),1)):T.helper?(n.openBlock(),n.createElementBlock("div",B0,n.toDisplayString(T.helper),1)):n.createCommentVNode("",!0)]))}});function Wd(i,e){const t=i.scrollTop,a=i.getBoundingClientRect().height,s=e.offsetTop,c=e.getBoundingClientRect().height;return s+c<a+t&&s>t}function Hd(i,e){const t=i.scrollTop,a=i.getBoundingClientRect().height,s=e.offsetTop,c=e.getBoundingClientRect().height;return s+c<a+t?"ceil":s>t?"floor":"visible"}function Xo(i,e,t={}){const a=i.scrollTop,s=i.getBoundingClientRect().height,c=e.getBoundingClientRect().height,d=e.offsetTop,u=Hd(i,e);if(u==="visible")return;const p=h=>{const g=u==="floor"?d-(s-c):d;i.scrollTop=a+h*(g-a)};Wd(i,e)||Td({duration:t.duration||100,timing:Sd(h=>h),draw:p})}function Ys(i,e,t,a){return i.addEventListener(e,t,a),function(){i.removeEventListener(e,t)}}function R0(i,e){const t=e.getBoundingClientRect();return i.x<t.x||i.x>t.x+t.width||i.y<t.y||i.y>t.y+t.height}function qd(i){return i!==null&&typeof i=="object"}function en(i,e){return qd(i)&&qd(e)?Object.keys(i).length!==Object.keys(e).length?!1:Object.keys(i).every(t=>en(i[t],e[t])):i===e}function Js(i,e){return i.some(t=>en(t,e))}const D0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
198
2
  <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"/>
199
3
  </svg>
200
- `,wO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ `,I0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
201
5
  <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
202
6
  <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"/>
203
7
  </svg>
204
- `,SO=["innerHTML"],yO={class:"dropdown-list-item__title-container"},bO={class:"dropdown-list-item__title text-s"},RO={key:0,class:"dropdown-list-item__description text-description"},FO={key:1,class:"dropdown-list-item__icon flex-self-start"},ec=l.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,i=l.computed(()=>{const o=[];return t.size==="small"&&o.push("dropdown-list-item__small"),t.isSelected&&o.push("dropdown-list-item__selected"),t.isHovered&&o.push("hovered-item"),o.join(" ")}),s=l.computed(()=>{const o=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&o.push("checked"),o.join(" ")}),n=l.computed(()=>t.isSelected?wO:vO);return(o,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([i.value,"dropdown-list-item"])},[t.useCheckbox?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(s.value),innerHTML:n.value},null,10,SO)):l.createCommentVNode("",!0),r[1]||(r[1]=l.createTextVNode()),l.createElementVNode("div",yO,[l.createElementVNode("div",bO,l.toDisplayString(o.option.label),1),r[0]||(r[0]=l.createTextVNode()),o.option.description?(l.openBlock(),l.createElementBlock("div",RO,l.toDisplayString(o.option.description),1)):l.createCommentVNode("",!0)]),r[2]||(r[2]=l.createTextVNode()),!t.useCheckbox&&t.isSelected?(l.openBlock(),l.createElementBlock("div",FO)):l.createCommentVNode("",!0)],2))}}),UC=l.defineComponent({__name:"LongText",setup(e){l.useCssVars(p=>({"8d68520c":r.value}));const t=l.ref(!1),i=l.ref(),s=l.ref(!1),n=l.computed(()=>s.value&&t.value?"ui-lt-animate":""),o=FC(p=>s.value=p,500),r=l.computed(()=>{var p;return i.value?`${((p=i.value)==null?void 0:p.innerHTML.length)*.4}s`:"5s"});function a(){const p=Ju(i.value,"span cannot be empty");t.value=p.clientWidth<p.scrollWidth}function d(){a(),o(!0)}function h(){o(!1)}return(p,f)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(p.$attrs,{class:"ui-lt-container"}),[l.createElementVNode("span",{onMouseover:d,onMouseleave:h},[l.createElementVNode("span",{ref_key:"span",ref:i,class:l.normalizeClass(n.value)},[l.renderSlot(p.$slots,"default")],2)],32)],16))}}),EO={class:"ui-dropdown__envelope"},xO=["tabindex"],PO={class:"ui-dropdown__container"},DO={class:"ui-dropdown__field"},TO=["disabled","placeholder"],AO={class:"ui-dropdown__controls"},MO={key:0},kO={key:0,class:"required-icon"},IO={key:0,class:"nothing-found"},LO={key:0,class:"ui-dropdown__error"},_O={key:1,class:"ui-dropdown__helper"},OO={name:"PlDropdown"},mh=l.defineComponent({...OO,props:{modelValue:{},label:{default:""},options:{},helper:{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(e,{emit:t}){const i=t,s=e,n=l.useSlots(),o=l.ref(),r=l.ref(),a=l.ref(),d=l.reactive({search:"",activeIndex:-1,open:!1}),h=()=>Qa(R.value.findIndex(U=>ji(U.value,s.modelValue)),U=>U<0?0:U),p=()=>d.activeIndex=h(),f=l.computed(()=>s.options.findIndex(U=>ji(U.value,s.modelValue))),m=l.computed(()=>{if(s.error)return s.error;if(s.modelValue!==void 0&&f.value===-1)return"The selected value is not one of the options"}),v=l.computed(()=>zo(s.options).map((U,Q)=>({...U,index:Q,isSelected:Q===f.value,isActive:Q===d.activeIndex}))),w=l.computed(()=>{const U=l.unref(v).find(Q=>ji(Q.value,s.modelValue));return(U==null?void 0:U.label)||s.modelValue}),S=l.computed(()=>!d.open&&s.modelValue?"":s.modelValue?String(w.value):s.placeholder),b=l.computed(()=>s.modelValue!==void 0&&s.modelValue!==null),R=l.computed(()=>{const U=v.value;return d.search?U.filter(Q=>{const ce=d.search.toLowerCase();return Q.label.toLowerCase().includes(ce)||Q.description&&Q.description.toLowerCase().includes(ce)?!0:typeof Q.value=="string"?Q.value.toLowerCase().includes(ce):Q.value===d.search}):U}),x=l.computed(()=>s.disabled?void 0:"0"),T=U=>{var Q;i("update:modelValue",U),d.search="",d.open=!1,(Q=o==null?void 0:o.value)==null||Q.focus()},I=()=>i("update:modelValue",void 0),V=()=>{var U;return(U=a.value)==null?void 0:U.focus()},L=()=>d.open=!d.open,A=()=>d.open=!0,k=U=>{var Q;(Q=o==null?void 0:o.value)!=null&&Q.contains(U.relatedTarget)||(d.search="",d.open=!1)},N=()=>{const U=r.value;U&&Et(U.querySelector(".hovered-item"),Q=>{Ja(U,Q)})},$=U=>{var Q,ce;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(U.code))U.preventDefault();else return;const{open:me,activeIndex:ue}=d;if(!me){U.code==="Enter"&&(d.open=!0);return}U.code==="Escape"&&(d.open=!1,(Q=o.value)==null||Q.focus());const ie=l.unref(R),{length:Me}=ie;if(!Me)return;U.code==="Enter"&&T((ce=ie.find(ni=>ni.index===ue))==null?void 0:ce.value);const Ge=ie.findIndex(ni=>ni.index===ue)??-1,ro=U.code==="ArrowDown"?1:U.code==="ArrowUp"?-1:0,yn=Math.abs(Ge+ro+Me)%Me;d.activeIndex=R.value[yn].index??-1};return Qn(o),l.watch(()=>s.modelValue,p,{immediate:!0}),l.watch(()=>d.open,U=>{var Q;return U?(Q=a.value)==null?void 0:Q.focus():""}),l.watchPostEffect(()=>{d.search,d.activeIndex>=0&&d.open&&N()}),(U,Q)=>(l.openBlock(),l.createElementBlock("div",EO,[l.createElementVNode("div",{ref_key:"root",ref:o,tabindex:x.value,class:l.normalizeClass(["ui-dropdown",{open:d.open,error:U.error,disabled:U.disabled}]),onKeydown:$,onFocusout:k},[l.createElementVNode("div",PO,[l.createElementVNode("div",DO,[l.withDirectives(l.createElementVNode("input",{ref_key:"input",ref:a,"onUpdate:modelValue":Q[0]||(Q[0]=ce=>d.search=ce),type:"text",tabindex:"-1",disabled:U.disabled,placeholder:S.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:A},null,40,TO),[[l.vModelText,d.search]]),Q[3]||(Q[3]=l.createTextVNode()),d.open?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:0,onClick:V},[l.createVNode(UC,{class:"input-value"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(w.value),1)]),_:1})])),Q[4]||(Q[4]=l.createTextVNode()),l.createElementVNode("div",AO,[U.clearable&&b.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"icon-16 icon-clear",onClick:l.withModifiers(I,["stop"])})):l.createCommentVNode("",!0),Q[1]||(Q[1]=l.createTextVNode()),l.renderSlot(U.$slots,"append"),Q[2]||(Q[2]=l.createTextVNode()),U.arrowIconLarge?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["arrow-icon",[`icon-24 ${U.arrowIconLarge}`]]),onClick:l.withModifiers(L,["stop"])},null,2)):U.arrowIcon?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(["arrow-icon",[`icon-16 ${U.arrowIcon}`]]),onClick:l.withModifiers(L,["stop"])},null,2)):(l.openBlock(),l.createElementBlock("div",{key:3,class:"arrow-icon arrow-icon-default",onClick:l.withModifiers(L,["stop"])}))])]),Q[8]||(Q[8]=l.createTextVNode()),U.label?(l.openBlock(),l.createElementBlock("label",MO,[U.required?(l.openBlock(),l.createElementBlock("i",kO)):l.createCommentVNode("",!0),Q[5]||(Q[5]=l.createTextVNode()),l.createElementVNode("span",null,l.toDisplayString(U.label),1),Q[6]||(Q[6]=l.createTextVNode()),l.unref(n).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:1,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(U.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),Q[9]||(Q[9]=l.createTextVNode()),d.open?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"list",ref:r,class:"ui-dropdown__options"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(R.value,(ce,me)=>(l.openBlock(),l.createBlock(ec,{key:me,option:ce,"is-selected":ce.isSelected,"is-hovered":ce.isActive,size:U.optionSize,onClick:l.withModifiers(ue=>T(ce.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),Q[7]||(Q[7]=l.createTextVNode()),R.value.length?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",IO,"Nothing found"))],512)):l.createCommentVNode("",!0),Q[10]||(Q[10]=l.createTextVNode()),l.createVNode($o,{class:"ui-dropdown__contour"})])],42,xO),Q[11]||(Q[11]=l.createTextVNode()),m.value?(l.openBlock(),l.createElementBlock("div",LO,l.toDisplayString(m.value),1)):U.helper?(l.openBlock(),l.createElementBlock("div",_O,l.toDisplayString(U.helper),1)):l.createCommentVNode("",!0)]))}}),VO={name:"PlDropdownRef"},NO=l.defineComponent({...VO,props:{modelValue:{},label:{default:""},options:{},helper:{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(e){const t=e,i=l.computed(()=>t.options.map(n=>({label:n.label,value:n.ref}))),s=l.computed(()=>t.disabled?"icon-link-disabled":"icon-link");return(n,o)=>(l.openBlock(),l.createBlock(l.unref(mh),l.mergeProps(t,{options:i.value,"arrow-icon-large":s.value,"onUpdate:modelValue":o[0]||(o[0]=r=>n.$emit("update:modelValue",r))}),null,16,["options","arrow-icon-large"]))}});function BO(e,t){return l.computed(()=>{const i=zo(e.value);return t.value?i.filter(s=>s.label.toLowerCase().includes(t.value.toLowerCase())):i})}const GO={class:"resizable-input"},HO=["placeholder","value","disabled"],WO=l.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(e,{emit:t}){const i=e,s=t,n=l.computed(()=>{var a;return i.placeholder?i.placeholder:(a=i.modelValue||i.value)==null?void 0:a.replace('"',"")}),o=l.computed(()=>{const a={};return i.width&&(a.width=i.width),i.maxWidth&&(a.maxWidth=i.maxWidth),a});function r(a){const d=a.target.value;s("update:modelValue",d)}return(a,d)=>(l.openBlock(),l.createElementBlock("div",GO,[l.createElementVNode("span",{style:l.normalizeStyle(o.value),class:"resizable-input__size-span"},l.toDisplayString(n.value),5),d[0]||(d[0]=l.createTextVNode()),l.createElementVNode("input",l.mergeProps(a.$attrs,{placeholder:a.placeholder,value:i.modelValue,disabled:i.disabled,style:o.value,onInput:r}),null,16,HO)]))}}),zO={class:"dropdown-tab-item__title text-caps13"},UO=l.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(e){const t=e,i=l.computed(()=>t.option.label),s=l.computed(()=>{const n=[];return t.isSelected&&n.push("dropdown-tab-item__selected"),t.isHovered&&n.push("hovered-item"),n.join(" ")});return(n,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([s.value,"dropdown-tab-item"])},[l.createElementVNode("div",zO,l.toDisplayString(i.value),1)],2))}}),$O={class:"ui-line-dropdown__prefix"},KO={class:"ui-line-dropdown__icon-wrapper"},jO={class:"ui-line-dropdown__icon"},ZO={key:0,class:"ui-line-dropdown__no-item"},qO={key:0,class:"ui-line-dropdown__no-item"},$C=l.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(e,{emit:t}){const i=t,s=e,n=l.reactive({isOpen:!1,activeOption:-1}),o=l.ref(),r=l.ref(),a=l.computed(()=>{const N=[];return n.isOpen&&N.push("open"),s.disabled&&N.push("disabled"),N.join(" ")}),d=l.ref(""),h=BO(l.toRef(s,"options"),d),p=l.computed(()=>!!(s.clearable&&n.isOpen&&s.modelValue&&f.value)),f=l.computed(()=>{if(s.modelValue){const N=w();if(N!==-1){const $=zo(s.options)[N];return typeof $.label=="object"?$.label.title:$.label}}return""}),m=l.ref(f.value),v=l.computed(()=>n.isOpen&&d.value&&d.value.length>=f.value.length-1?d.value:f.value||"...");Xa(o,()=>{s.mode==="list"&&(n.isOpen=!1)}),l.watch(()=>m.value,N=>{f.value!==N?d.value=N:d.value=""}),l.watch(()=>n.isOpen,N=>{var $;N&&o.value&&(($=o.value.querySelector("input"))==null||$.focus(),l.nextTick(()=>A()))}),l.watch(()=>s.modelValue,()=>S(),{immediate:!0});function w(){return s.options.findIndex(N=>ji(N.value,s.modelValue))}function S(){n.activeOption=Qa(h.value.findIndex(N=>ji(N.value,s.modelValue)),N=>N<0?0:N),m.value=f.value}function b(){d.value=""}function R(){s.disabled?n.isOpen=!1:l.nextTick(()=>{n.isOpen=!n.isOpen})}function x(){s.mode==="list"&&(n.isOpen=!1)}function T(N){N&&(i("update:modelValue",N.value),x(),b())}function I(N){return ji(N.value,s.modelValue)}function V(N){var $;($=o==null?void 0:o.value)!=null&&$.contains(N.relatedTarget)||(n.isOpen=!1,d.value="")}function L(N){const{activeOption:$}=n;if(!n.isOpen&&N.code==="Enter"){n.isOpen=!0;return}const{length:U}=h.value;if(!U)return;["ArrowDown","ArrowUp","Enter"].includes(N.code)&&N.preventDefault(),N.code==="Enter"&&T(h.value[$]);const Q=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0;n.activeOption=Math.abs($+Q+U)%U,requestAnimationFrame(A)}function A(){const N=r.value;N&&Et(N.querySelector(".hovered-item"),$=>{s.mode==="list"?Ja(N,$):$.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function k(){i("update:modelValue",void 0)}return(N,$)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"container",ref:o,tabindex:"0",class:l.normalizeClass([a.value,"ui-line-dropdown uc-pointer"]),onKeydown:L,onFocusout:V,onClick:R},[l.createElementVNode("div",$O,l.toDisplayString(s==null?void 0:s.prefix),1),$[6]||($[6]=l.createTextVNode()),l.createVNode(WO,{modelValue:m.value,"onUpdate:modelValue":$[0]||($[0]=U=>m.value=U),placeholder:v.value,disabled:s.disabled,class:"ui-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),$[7]||($[7]=l.createTextVNode()),l.createElementVNode("div",KO,[l.withDirectives(l.createElementVNode("div",jO,null,512),[[l.vShow,!p.value]]),$[1]||($[1]=l.createTextVNode()),l.withDirectives(l.createElementVNode("div",{class:"ui-line-dropdown__icon-clear",onClick:k},null,512),[[l.vShow,p.value]])]),$[8]||($[8]=l.createTextVNode()),s.mode==="list"?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"list",ref:r,class:"ui-line-dropdown__items"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(h),(U,Q)=>l.renderSlot(N.$slots,"item",{key:Q,item:U,textItem:"text",isSelected:I(U),isHovered:n.activeOption==Q,onClick:l.withModifiers(ce=>T(U),["stop"])},()=>[l.createVNode(ec,{option:U,"text-item":"text","is-selected":I(U),"is-hovered":n.activeOption==Q,size:"medium",onClick:l.withModifiers(ce=>T(U),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),$[3]||($[3]=l.createTextVNode()),l.unref(h).length===0?(l.openBlock(),l.createElementBlock("div",ZO,$[2]||($[2]=[l.createElementVNode("div",{class:"ui-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):l.createCommentVNode("",!0)],512)),[[l.vShow,n.isOpen]]):l.createCommentVNode("",!0),$[9]||($[9]=l.createTextVNode()),s.mode==="tabs"?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"list",ref:r,style:l.normalizeStyle(s.tabsContainerStyles),class:"ui-line-dropdown__items-tabs"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(h),(U,Q)=>l.renderSlot(N.$slots,"item",{key:Q,item:U,isSelected:I(U),isHovered:n.activeOption==Q,onClick:l.withModifiers(ce=>T(U),["stop"])},()=>[l.createVNode(UO,{option:U,"is-selected":I(U),"is-hovered":n.activeOption==Q,onClick:l.withModifiers(ce=>T(U),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),$[5]||($[5]=l.createTextVNode()),l.unref(h).length===0?(l.openBlock(),l.createElementBlock("div",qO,$[4]||($[4]=[l.createElementVNode("div",{class:"ui-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):l.createCommentVNode("",!0)],4)),[[l.vShow,n.isOpen]]):l.createCommentVNode("",!0)],34))}}),YO={key:0,class:"ui-progress-bar"},QO={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},XO={class:"ui-progress-bar__message flex-grow-1"},JO={class:"ui-progress-bar__percent"},eV=l.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(e){const t=e,i=l.computed(()=>t.progress===100?t.completeMessage:"");return(s,n)=>s.loading?(l.openBlock(),l.createElementBlock("div",YO,[l.createElementVNode("div",{class:"ui-progress-bar__indicator",style:l.normalizeStyle({width:s.progress+"%"})},null,4),n[1]||(n[1]=l.createTextVNode()),l.createElementVNode("div",QO,[l.createElementVNode("div",XO,l.toDisplayString(i.value),1),n[0]||(n[0]=l.createTextVNode()),l.createElementVNode("div",JO,l.toDisplayString(s.progress+"%"),1)])])):l.createCommentVNode("",!0)}}),tV={class:"mi-number-field__main-wrapper d-flex"},iV={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},sV={key:0,class:"text-description"},nV=["disabled","placeholder"],oV={class:"mi-number-field__icons d-flex-column"},rV={key:0,class:"mi-number-field__hint text-description"},lV=l.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(e,{emit:t}){const i=e,s=t,n=l.ref(),o=l.useSlots(),r=l.ref();Qn(n);const a=l.ref(!0),d=l.computed({get(){return a.value&&i.modelValue!==void 0?new Number(i.modelValue).toString():""},set(R){var x;R=R.replace(/,/g,""),m(R)?(s("update:modelValue",+R),R.toString()!==((x=i.modelValue)==null?void 0:x.toString())&&+R===i.modelValue&&R[R.length-1]!=="."&&(a.value=!1,l.nextTick(()=>{a.value=!0}))):(R.trim()===""&&s("update:modelValue",void 0),a.value=!1,l.nextTick(()=>{a.value=!0}))}}),h=l.computed(()=>{let R=[];return i.errorMessage&&R.push(i.errorMessage),m(i.modelValue)?(i.minValue!==void 0&&i.modelValue!==void 0&&i.modelValue<i.minValue&&R.push(`Model value must be higher than ${i.minValue}`),i.maxValue!==void 0&&i.modelValue!==void 0&&i.modelValue>i.maxValue&&R.push(`Model value must be less than ${i.maxValue}`)):R.push("Model value is not a number."),R=[...R],R.join(" ")}),p=l.computed(()=>!!(i.maxValue&&i.modelValue!==void 0&&(i.modelValue||0)+i.step>i.maxValue)),f=l.computed(()=>!!(i.minValue&&i.modelValue!==void 0&&(i.modelValue||0)-i.step<i.minValue));function m(R){return R!==void 0?(R=R==null?void 0:R.toString(),!isNaN(+R)&&!isNaN(parseFloat(R))):!1}function v(){if(!p.value){let R=0;i.modelValue===void 0?R=i.minValue?i.minValue:0:R=+(i.modelValue||0)+i.step,d.value=R.toString()}}function w(){if(!f.value){let R=0;i.modelValue===void 0?R=0:R=+(i.modelValue||0)-i.step,d.value=i.minValue?Math.max(i.minValue,R).toString():R.toString()}}function S(R){["ArrowDown","ArrowUp"].includes(R.code)&&R.preventDefault(),R.code==="ArrowUp"?v():R.code==="ArrowDown"&&w()}const b=R=>{R.detail>1&&R.preventDefault()};return(R,x)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"root",ref:n,class:l.normalizeClass([{error:!!h.value.trim(),disabled:R.disabled},"mi-number-field d-flex-column"]),onMousedown:b,onKeydown:x[1]||(x[1]=T=>S(T))},[l.createElementVNode("div",tV,[l.createVNode($o,{class:"mi-number-field__contour"}),x[6]||(x[6]=l.createTextVNode()),l.createElementVNode("div",iV,[R.label?(l.openBlock(),l.createElementBlock("label",sV,[l.createTextVNode(l.toDisplayString(R.label)+" ",1),l.unref(o).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:0,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(R.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),x[2]||(x[2]=l.createTextVNode()),l.withDirectives(l.createElementVNode("input",{ref_key:"input",ref:r,"onUpdate:modelValue":x[0]||(x[0]=T=>d.value=T),disabled:R.disabled,placeholder:R.placeholder,class:"text-s flex-grow"},null,8,nV),[[l.vModelText,d.value]])]),x[7]||(x[7]=l.createTextVNode()),l.createElementVNode("div",oV,[l.createElementVNode("div",{class:l.normalizeClass([{disabled:p.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:v},x[3]||(x[3]=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[l.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),x[5]||(x[5]=l.createTextVNode()),l.createElementVNode("div",{class:l.normalizeClass([{disabled:f.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:w},x[4]||(x[4]=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[l.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)])]),x[8]||(x[8]=l.createTextVNode()),h.value.trim()?(l.openBlock(),l.createElementBlock("div",rV,l.toDisplayString(h.value),1)):l.createCommentVNode("",!0)],34))}}),aV={class:"ui-chip__text"},Ch=l.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(e){const t=l.ref(),i=l.ref(!1);return l.onMounted(()=>{var s;t.value&&(i.value=((s=t.value)==null?void 0:s.clientWidth)>=256)}),(s,n)=>(l.openBlock(),l.createBlock(l.unref(Ti),{position:"top",class:"ui-chip-tooltip",delay:500},l.createSlots({default:l.withCtx(()=>[n[4]||(n[4]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"chip",ref:t,class:l.normalizeClass(["ui-chip",{small:s.small}])},[l.createElementVNode("div",aV,[l.renderSlot(s.$slots,"default")]),n[3]||(n[3]=l.createTextVNode()),s.closeable?(l.openBlock(),l.createElementBlock("div",{key:0,tabindex:"0",class:"ui-chip__close",onKeydown:n[0]||(n[0]=l.withKeys(o=>s.$emit("close"),["enter"])),onClick:n[1]||(n[1]=l.withModifiers(o=>s.$emit("close"),["stop"]))},n[2]||(n[2]=[l.createElementVNode("div",{class:"ui-chip__close--icon"},null,-1)]),32)):l.createCommentVNode("",!0)],2)]),_:2},[i.value?{name:"tooltip",fn:l.withCtx(()=>[l.renderSlot(s.$slots,"default")]),key:"0"}:void 0]),1024))}}),cV={class:"ui-multi-dropdown__envelope"},dV=["tabindex"],uV={class:"ui-multi-dropdown__container"},hV={class:"ui-multi-dropdown__field"},pV=["disabled","placeholder"],gV={class:"ui-multi-dropdown__append"},fV={key:0},mV={key:0,class:"required-icon"},CV={class:"ui-multi-dropdown__open-chips-container"},vV={key:0,class:"nothing-found"},wV={key:0,class:"ui-multi-dropdown__error"},SV={key:1,class:"ui-multi-dropdown__helper"},yV={name:"PlDropdownMulti"},bV=l.defineComponent({...yV,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(e,{emit:t}){const i=t,s=A=>i("update:modelValue",A),n=l.useSlots(),o=e,r=l.ref(),a=l.ref(),d=l.ref(),h=l.reactive({search:"",activeOption:-1,open:!1}),p=l.computed(()=>Array.isArray(o.modelValue)?o.modelValue:[]),f=l.computed(()=>h.open&&o.modelValue.length>0?o.placeholder:o.modelValue.length>0?"":o.placeholder),m=l.computed(()=>zo(o.options).filter(A=>fh(p.value,A.value))),v=l.computed(()=>{const A=l.unref(p),k=zo(o.options);return(h.search?k.filter(N=>{const $=h.search.toLowerCase();return N.label.toLowerCase().includes($)?!0:typeof N.value=="string"?N.value.toLowerCase().includes($):N.value===h.search}):[...k]).map(N=>({...N,selected:fh(A,N.value)}))}),w=l.computed(()=>o.disabled?void 0:"0"),S=()=>{h.activeOption=Qa(v.value.findIndex(A=>ji(A.value,o.modelValue)),A=>A<0?0:A)},b=A=>{var k;const N=l.unref(p);s(fh(N,A)?N.filter($=>!ji($,A)):[...N,A]),h.search="",(k=r==null?void 0:r.value)==null||k.focus()},R=A=>s(l.unref(p).filter(k=>!ji(k,A))),x=()=>{var A;return(A=d.value)==null?void 0:A.focus()},T=()=>h.open=!h.open,I=A=>{var k;(k=r==null?void 0:r.value)!=null&&k.contains(A.relatedTarget)||(h.search="",h.open=!1)},V=()=>{const A=a.value;A&&Et(A.querySelector(".hovered-item"),k=>{Ja(A,k)})},L=A=>{var k;const{open:N,activeOption:$}=h;if(!N){A.code==="Enter"&&(h.open=!0);return}A.code==="Escape"&&(h.open=!1,(k=r.value)==null||k.focus());const U=l.unref(v),{length:Q}=U;if(!Q)return;["ArrowDown","ArrowUp","Enter"].includes(A.code)&&A.preventDefault(),A.code==="Enter"&&b(U[$].value);const ce=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0;h.activeOption=Math.abs($+ce+Q)%Q,requestAnimationFrame(V)};return Qn(r),l.watch(()=>o.modelValue,()=>S(),{immediate:!0}),l.watchPostEffect(()=>{h.search,h.open&&V()}),(A,k)=>(l.openBlock(),l.createElementBlock("div",cV,[l.createElementVNode("div",{ref_key:"rootRef",ref:r,tabindex:w.value,class:l.normalizeClass(["ui-multi-dropdown",{open:h.open,error:A.error,disabled:A.disabled}]),onKeydown:L,onFocusout:I},[l.createElementVNode("div",uV,[l.createElementVNode("div",hV,[l.withDirectives(l.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":k[0]||(k[0]=N=>h.search=N),type:"text",tabindex:"-1",disabled:A.disabled,placeholder:f.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k[1]||(k[1]=N=>h.open=!0)},null,40,pV),[[l.vModelText,h.search]]),k[3]||(k[3]=l.createTextVNode()),h.open?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:0,class:"chips-container",onClick:x},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,(N,$)=>(l.openBlock(),l.createBlock(l.unref(Ch),{key:$,closeable:"",small:"",onClick:k[2]||(k[2]=l.withModifiers(U=>h.open=!0,["stop"])),onClose:U=>R(N.value)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(N.label||N.value),1)]),_:2},1032,["onClose"]))),128))])),k[4]||(k[4]=l.createTextVNode()),l.createElementVNode("div",{class:"arrow",onClick:l.withModifiers(T,["stop"])}),k[5]||(k[5]=l.createTextVNode()),l.createElementVNode("div",gV,[l.renderSlot(A.$slots,"append")])]),k[10]||(k[10]=l.createTextVNode()),A.label?(l.openBlock(),l.createElementBlock("label",fV,[A.required?(l.openBlock(),l.createElementBlock("i",mV)):l.createCommentVNode("",!0),k[6]||(k[6]=l.createTextVNode()),l.createElementVNode("span",null,l.toDisplayString(A.label),1),k[7]||(k[7]=l.createTextVNode()),l.unref(n).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:1,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(A.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),k[11]||(k[11]=l.createTextVNode()),h.open?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"list",ref:a,class:"ui-multi-dropdown__options"},[l.createElementVNode("div",CV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,(N,$)=>(l.openBlock(),l.createBlock(l.unref(Ch),{key:$,closeable:"",small:"",onClose:U=>R(N.value)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(N.label||N.value),1)]),_:2},1032,["onClose"]))),128))]),k[8]||(k[8]=l.createTextVNode()),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(v.value,(N,$)=>(l.openBlock(),l.createBlock(ec,{key:$,option:N,"text-item":"text","is-selected":N.selected,"is-hovered":h.activeOption==$,size:"medium","use-checkbox":"",onClick:l.withModifiers(U=>b(N.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),k[9]||(k[9]=l.createTextVNode()),v.value.length?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",vV,"Nothing found"))],512)):l.createCommentVNode("",!0),k[12]||(k[12]=l.createTextVNode()),l.createVNode($o,{class:"ui-multi-dropdown__contour"})])],42,dV),k[13]||(k[13]=l.createTextVNode()),A.error?(l.openBlock(),l.createElementBlock("div",wV,l.toDisplayString(A.error),1)):A.helper?(l.openBlock(),l.createElementBlock("div",SV,l.toDisplayString(A.helper),1)):l.createCommentVNode("",!0)]))}}),vh=l.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e,i=l.computed(()=>t.modelValue);return(s,n)=>(l.openBlock(),l.createElementBlock("div",{tabindex:"0",class:l.normalizeClass(["pl-checkbox-base",{checked:i.value,disabled:s.disabled}]),onClick:n[0]||(n[0]=o=>s.$emit("update:modelValue",!s.modelValue)),onKeydown:n[1]||(n[1]=l.withKeys(o=>s.$emit("update:modelValue",!s.modelValue),["enter"]))},null,34))}}),RV={name:"PlCheckbox"},FV=l.defineComponent({...RV,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e,i=l.useSlots();return(s,n)=>l.unref(i).default?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["pl-checkbox",{disabled:s.disabled}])},[l.createVNode(vh,l.mergeProps(t,{"onUpdate:modelValue":n[0]||(n[0]=o=>s.$emit("update:modelValue",o))}),null,16),n[3]||(n[3]=l.createTextVNode()),l.createElementVNode("label",{onClick:n[1]||(n[1]=o=>s.$emit("update:modelValue",!s.$props.modelValue))},[l.renderSlot(s.$slots,"default")])],2)):(l.openBlock(),l.createBlock(vh,l.mergeProps({key:1},t,{"onUpdate:modelValue":n[2]||(n[2]=o=>s.$emit("update:modelValue",o))}),null,16))}}),EV={key:0},xV=["onClick"],PV={name:"PlCheckboxGroup"},DV=l.defineComponent({...PV,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=r=>s.modelValue.includes(r),o=r=>{const a=s.modelValue??[];i("update:modelValue",n(r)?a.filter(d=>d!==r):[...a,r])};return(r,a)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["ui-checkbox-group",{disabled:r.disabled}])},[r.label?(l.openBlock(),l.createElementBlock("label",EV,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),a[1]||(a[1]=l.createTextVNode()),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.options,(d,h)=>(l.openBlock(),l.createElementBlock("div",{key:h},[l.createVNode(vh,{disabled:r.disabled,label:d.text,"model-value":n(d.value),"onUpdate:modelValue":()=>o(d.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),a[0]||(a[0]=l.createTextVNode()),l.createElementVNode("label",{onClick:l.withModifiers(()=>o(d.value),["stop"])},l.toDisplayString(d.text),9,xV)]))),128))],2))}}),TV={key:1,class:"pl-dialog-modal__title"},AV={key:2,class:"pl-dialog-modal__actions"},MV={inheritAttrs:!1},KC=l.defineComponent({...MV,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},type:{default:"A"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.ref(),r=l.useAttrs();function a(d){o.value&&document.contains(d.target)&&!o.value.contains(d.target)&&s("update:modelValue",!1)}return dt(document.body,"keyup",d=>{n.modelValue&&d.code==="Escape"&&s("update:modelValue",!1)}),(d,h)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,{name:"dialog"},{default:l.withCtx(()=>[d.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:a},[l.createElementVNode("div",l.mergeProps(l.unref(r),{ref_key:"modal",ref:o,class:["pl-dialog-modal",[d.type,l.unref(i).title?"has-title":""]],style:{width:d.width,height:d.height,minHeight:d.minHeight}}),[d.closable?(l.openBlock(),l.createElementBlock("div",{key:0,class:"close-dialog-btn",onClick:h[0]||(h[0]=l.withModifiers(p=>s("update:modelValue",!1),["stop"]))})):l.createCommentVNode("",!0),h[1]||(h[1]=l.createTextVNode()),l.unref(i).title?(l.openBlock(),l.createElementBlock("div",TV,[l.renderSlot(d.$slots,"title")])):l.createCommentVNode("",!0),h[2]||(h[2]=l.createTextVNode()),l.createElementVNode("div",{class:l.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":d.noContentGutters}])},[l.renderSlot(d.$slots,"default")],2),h[3]||(h[3]=l.createTextVNode()),l.unref(i).actions?(l.openBlock(),l.createElementBlock("div",AV,[l.renderSlot(d.$slots,"actions")])):l.createCommentVNode("",!0)],16)])):l.createCommentVNode("",!0)]),_:3})]))}}),kV=l.defineComponent({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function i(){window.dispatchEvent(new CustomEvent("adjust"))}return(s,n)=>(l.openBlock(),l.createBlock(l.Transition,{name:"slide-panel",onAfterEnter:t,onAfterLeave:i},{default:l.withCtx(()=>[l.renderSlot(s.$slots,"default")]),_:3}))}}),IV={key:0,class:"pl-slide-modal__title"},LV={class:"pl-slide-modal__content"},_V={key:1,class:"pl-slide-modal__actions"},OV={name:"PlSlideModal",inheritAttrs:!1},VV=l.defineComponent({...OV,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.ref(),r=l.useAttrs();return Xa(o,()=>{n.modelValue&&n.closeOnOutsideClick&&s("update:modelValue",!1)}),dt(document,"keydown",a=>{a.key==="Escape"&&s("update:modelValue",!1)}),(a,d)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(kV,null,{default:l.withCtx(()=>[a.modelValue?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref_key:"modal",ref:o,style:{width:a.width}},l.unref(r),{class:["pl-slide-modal",{"has-title":l.unref(i).title,"has-actions":l.unref(i).actions}],onKeyup:d[1]||(d[1]=l.withKeys(h=>s("update:modelValue",!1),["esc"]))}),[l.createElementVNode("div",{class:"close-dialog-btn",onClick:d[0]||(d[0]=h=>s("update:modelValue",!1))}),d[3]||(d[3]=l.createTextVNode()),l.unref(i).title?(l.openBlock(),l.createElementBlock("div",IV,[l.renderSlot(a.$slots,"title")])):l.createCommentVNode("",!0),d[4]||(d[4]=l.createTextVNode()),l.createElementVNode("div",LV,[l.renderSlot(a.$slots,"default")]),d[5]||(d[5]=l.createTextVNode()),l.unref(i).actions?(l.openBlock(),l.createElementBlock("div",_V,[l.renderSlot(a.$slots,"actions")])):l.createCommentVNode("",!0)],16)):l.createCommentVNode("",!0)]),_:3}),d[6]||(d[6]=l.createTextVNode()),a.modelValue&&a.shadow?(l.openBlock(),l.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:d[2]||(d[2]=l.withKeys(h=>s("update:modelValue",!1),["esc"]))},null,32)):l.createCommentVNode("",!0)]))}}),NV={key:0,class:"label"},BV={name:"PlToggleSwitch"},GV=l.defineComponent({...BV,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,i)=>(l.openBlock(),l.createElementBlock("div",{tabindex:"0",class:l.normalizeClass(["ui-toggle-switch",{active:t.modelValue}]),onClick:i[0]||(i[0]=s=>t.$emit("update:modelValue",!t.modelValue)),onKeydown:i[1]||(i[1]=l.withKeys(s=>t.$emit("update:modelValue",!t.modelValue),["enter"]))},[i[2]||(i[2]=l.createElementVNode("div",{class:"ui-toggle-switch__body"},[l.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),i[3]||(i[3]=l.createTextVNode()),t.label?(l.openBlock(),l.createElementBlock("span",NV,l.toDisplayString(t.label),1)):l.createCommentVNode("",!0)],34))}}),Xn=l.defineComponent({__name:"MaskIcon24",props:{name:{},size:{}},setup(e){const t=e,i=l.computed(()=>`mask-24 mask-${t.name}`);return(s,n)=>(l.openBlock(),l.createElementBlock("i",{class:l.normalizeClass(i.value)},null,2))}}),HV={key:0,class:"pl-log-view__error"},WV={name:"PlLogView"},zV=l.defineComponent({...WV,props:{value:{},error:{},output:{}},setup(e){const t=d=>{if(d&&d.ok===!1)return d.errors.join(`
205
- `)},i=e,s=l.ref(),n=l.computed(()=>i.error??t(i.output)),o=l.computed(()=>i.value??cC(i.output)),r=()=>{i.value&&navigator.clipboard.writeText(i.value)},a=()=>{dn(s.value,d=>{d.clientHeight+d.scrollTop+100>d.scrollHeight&&d.scrollTo(d.scrollLeft,d.scrollHeight)})};return l.onMounted(a),l.onUpdated(a),(d,h)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["pl-log-view",{"has-error":n.value}])},[l.createVNode(Xn,{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:r}),h[0]||(h[0]=l.createTextVNode()),n.value?(l.openBlock(),l.createElementBlock("div",HV,l.toDisplayString(n.value),1)):(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"contentRef",ref:s,class:"pl-log-view__content"},l.toDisplayString(o.value),513))],2))}});function UV(e){const t=e.split("/"),i=[];for(let s=0;s<t.length;s++)i.push({index:s,name:s===0?"Root":t[s],path:t.slice(0,s+1).join("/")});return i}const $V={class:"file-dialog"},KV={class:"file-dialog__search"},jV={class:"ls-container"},ZV={class:"ls-head"},qV={class:"ls-head__breadcrumbs"},YV=["title","onClick"],QV={key:0,class:"icon-16 icon-chevron-right"},XV={class:"d-flex ml-auto align-center gap-12"},JV={class:"ls-head__selected"},eN={key:0,class:"ls-loader"},tN={key:1,class:"ls-empty"},iN={key:2,class:"ls-error"},sN={class:"ls-error__message"},nN={key:3,class:"ls-body"},oN=["onClick"],rN=["title"],lN=["onClick"],aN=["title"],jC=l.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(e,{emit:t}){const i=t,s=e,n=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),o=l.reactive(n()),r=l.computed(()=>o.showHiddenItems?o.items:o.items.filter(A=>!A.name.startsWith("."))),a=l.computed(()=>{var A;return{modelValue:s.modelValue,dirPath:o.dirPath,storageHandle:(A=o.storageEntry)==null?void 0:A.handle}}),d=(A,k)=>{window.platforma&&o.currentLoadingPath!==k&&(o.error="",o.items=[],o.lastSelected=void 0,o.currentLoadingPath=k,window.platforma.lsDriver.listFiles(A,k).then(N=>{k===o.dirPath&&(o.items=$u(N).entries.map($=>({path:$.fullPath,name:$.name,isDir:$.type==="dir",canBeSelected:$.type==="file"&&(!s.extensions||s.extensions.some(U=>$.fullPath.endsWith(U))),handle:$.type==="file"?$.handle:void 0,selected:!1})).sort(($,U)=>$.isDir&&!U.isDir?-1:!$.isDir&&U.isDir?1:$.name.localeCompare(U.name)).map(($,U)=>({id:U,...$})),o.lastSelected=void 0)}).catch(N=>o.error=String(N)).finally(()=>{o.currentLoadingPath=void 0}))},h=()=>{const{storageHandle:A,dirPath:k,modelValue:N}=a.value;A&&N&&d(A,k)},p=fC(A=>{A&&(o.dirPath=A)},1e3),f=l.computed(()=>UV(o.dirPath)),m=l.computed(()=>o.items.filter(A=>A.canBeSelected&&A.selected&&!A.isDir)),v=l.computed(()=>m.value.length>0),w=()=>{i("update:modelValue",!1)},S=()=>{var A;v.value&&(A=o.storageEntry)!=null&&A.handle&&(i("import:files",{storageHandle:o.storageEntry.handle,files:m.value.map(k=>k.handle)}),w())},b=A=>{o.dirPath=A,o.storageEntry&&h()},R=(A,k)=>{const{shiftKey:N,metaKey:$}=A,{lastSelected:U}=o;if(A.preventDefault(),k.canBeSelected){if(s.multi||o.items.forEach(Q=>Q.selected=!1),k.selected=!0,!s.multi)return;!$&&!N&&o.items.forEach(Q=>{Q.id!==k.id&&(Q.selected=!1)}),N&&U!==void 0&&o.items.forEach(Q=>{oC(Q.id,U,k.id)&&(Q.selected=!0)}),k.selected&&(o.lastSelected=k.id)}},x=A=>{A&&!s.multi||o.items.filter(k=>k.canBeSelected).forEach(k=>{k.selected=A})},T=()=>x(!0),I=()=>x(!1),V=()=>{if(o.error="",o.lastSelected=void 0,I(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(A=>{o.storageOptions=A.map(k=>({text:k.name,value:k})),s.autoSelectStorage&&dn(A.find(k=>k.name==="local"),k=>{o.storageEntry=k,o.dirPath=k.initialFullPath})}).catch(A=>o.error=String(A))};l.watch(l.toRef(o,"storageEntry"),A=>{o.dirPath=(A==null?void 0:A.initialFullPath)??""}),l.watch([()=>o.dirPath,()=>o.storageEntry],()=>{h()}),l.watch(()=>s.modelValue,A=>{A?V():Object.assign(o,n())},{immediate:!0}),dt(document,"keydown",A=>{s.modelValue&&A.target===document.body&&(A.metaKey&&A.code==="KeyA"&&(A.preventDefault(),T()),A.metaKey&&A.shiftKey&&A.code==="Period"&&(A.preventDefault(),o.showHiddenItems=!o.showHiddenItems),A.code==="Enter"&&S())}),l.onUpdated(V);const L={mounted:A=>{if(A.clientWidth<A.scrollWidth){const k=A.innerText;A.innerText=k.substring(0,57)+"..."+k.substring(k.length-10)}}};return(A,k)=>(l.openBlock(),l.createBlock(l.unref(KC),{"no-content-gutters":!0,class:"split","model-value":A.modelValue,width:"688px",height:"720px","onUpdate:modelValue":w,onClick:l.withModifiers(I,["stop"])},{title:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(A.title??"Select files"),1)]),actions:l.withCtx(()=>[l.createVNode(l.unref(kC),{style:{"min-width":"160px"},disabled:!v.value,onClick:l.withModifiers(S,["stop"])},{default:l.withCtx(()=>k[14]||(k[14]=[l.createTextVNode("Import")])),_:1},8,["disabled"]),k[16]||(k[16]=l.createTextVNode()),l.createVNode(l.unref(IC),{"justify-center":!1,onClick:l.withModifiers(w,["stop"])},{default:l.withCtx(()=>k[15]||(k[15]=[l.createTextVNode("Cancel")])),_:1})]),default:l.withCtx(()=>[k[17]||(k[17]=l.createTextVNode()),l.createElementVNode("div",$V,[l.createElementVNode("div",KV,[l.createVNode(l.unref(mh),{modelValue:o.storageEntry,"onUpdate:modelValue":k[0]||(k[0]=N=>o.storageEntry=N),label:"Select storage",options:o.storageOptions},null,8,["modelValue","options"]),k[1]||(k[1]=l.createTextVNode()),l.createVNode(l.unref(GC),{"model-value":o.dirPath,label:"Enter path","onUpdate:modelValue":l.unref(p)},null,8,["model-value","onUpdate:modelValue"])]),k[13]||(k[13]=l.createTextVNode()),l.createElementVNode("div",jV,[l.createElementVNode("div",ZV,[l.createElementVNode("div",qV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,(N,$)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:$},[l.createElementVNode("div",{title:N.path,onClick:U=>b(N.path)},l.toDisplayString(N.name),9,YV),k[2]||(k[2]=l.createTextVNode()),N.index!==f.value.length-1?(l.openBlock(),l.createElementBlock("i",QV)):l.createCommentVNode("",!0)],64))),128))]),k[3]||(k[3]=l.createTextVNode()),l.createElementVNode("div",XV,[l.createElementVNode("span",JV,"Selected: "+l.toDisplayString(m.value.length),1)])]),k[12]||(k[12]=l.createTextVNode()),o.currentLoadingPath!==void 0?(l.openBlock(),l.createElementBlock("div",eN,k[4]||(k[4]=[l.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):o.storageEntry?o.error?(l.openBlock(),l.createElementBlock("div",iN,[k[6]||(k[6]=l.createElementVNode("div",{class:"ls-error__cat"},null,-1)),k[7]||(k[7]=l.createTextVNode()),l.createElementVNode("div",sN,l.toDisplayString(o.error),1)])):(l.openBlock(),l.createElementBlock("div",nN,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,N=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:N.id},[N.isDir?(l.openBlock(),l.createElementBlock("div",{key:0,class:"isDir",onClick:$=>b(N.path)},[k[8]||(k[8]=l.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),k[9]||(k[9]=l.createTextVNode()),l.withDirectives((l.openBlock(),l.createElementBlock("span",{title:N.name},[l.createTextVNode(l.toDisplayString(N.name),1)],8,rN)),[[L]])],8,oN)):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass({canBeSelected:N.canBeSelected,selected:N.selected}),onClick:l.withModifiers($=>R($,N),["stop"])},[k[10]||(k[10]=l.createElementVNode("i",{class:"mask-16 mask-comp isFile"},null,-1)),k[11]||(k[11]=l.createTextVNode()),l.withDirectives((l.openBlock(),l.createElementBlock("span",{title:N.name},[l.createTextVNode(l.toDisplayString(N.name),1)],8,aN)),[[L]])],10,lN))],64))),128))])):(l.openBlock(),l.createElementBlock("div",tN,k[5]||(k[5]=[l.createElementVNode("div",{class:"ls-empty__cat"},null,-1),l.createTextVNode(),l.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),k[18]||(k[18]=l.createTextVNode())]),_:1},8,["model-value"]))}});var Ke;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function i(n){throw new Error}e.assertNever=i,e.arrayToEnum=n=>{const o={};for(const r of n)o[r]=r;return o},e.getValidEnumValues=n=>{const o=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),r={};for(const a of o)r[a]=n[a];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const o=[];for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&o.push(r);return o},e.find=(n,o)=>{for(const r of n)if(o(r))return r},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,o=" | "){return n.map(r=>typeof r=="string"?`'${r}'`:r).join(o)}e.joinValues=s,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(Ke||(Ke={}));var wh;(function(e){e.mergeShapes=(t,i)=>({...t,...i})})(wh||(wh={}));const le=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hn=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}},J=Ke.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"]),cN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class pi extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const i=t||function(o){return o.message},s={_errors:[]},n=o=>{for(const r of o.issues)if(r.code==="invalid_union")r.unionErrors.map(n);else if(r.code==="invalid_return_type")n(r.returnTypeError);else if(r.code==="invalid_arguments")n(r.argumentsError);else if(r.path.length===0)s._errors.push(i(r));else{let a=s,d=0;for(;d<r.path.length;){const h=r.path[d];d===r.path.length-1?(a[h]=a[h]||{_errors:[]},a[h]._errors.push(i(r))):a[h]=a[h]||{_errors:[]},a=a[h],d++}}};return n(this),s}static assert(t){if(!(t instanceof pi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ke.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=i=>i.message){const i={},s=[];for(const n of this.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}pi.create=e=>new pi(e);const Ko=(e,t)=>{let i;switch(e.code){case J.invalid_type:e.received===le.undefined?i="Required":i=`Expected ${e.expected}, received ${e.received}`;break;case J.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:i=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case J.invalid_union:i="Invalid input";break;case J.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case J.invalid_enum_value:i=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case J.invalid_arguments:i="Invalid function arguments";break;case J.invalid_return_type:i="Invalid function return type";break;case J.invalid_date:i="Invalid date";break;case J.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:Ke.assertNever(e.validation):e.validation!=="regex"?i=`Invalid ${e.validation}`:i="Invalid";break;case J.too_small:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:i="Invalid input";break;case J.too_big:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?i=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:i="Invalid input";break;case J.custom:i="Invalid input";break;case J.invalid_intersection_types:i="Intersection results could not be merged";break;case J.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case J.not_finite:i="Number must be finite";break;default:i=t.defaultError,Ke.assertNever(e)}return{message:i}};let ZC=Ko;function dN(e){ZC=e}function tc(){return ZC}const ic=e=>{const{data:t,path:i,errorMaps:s,issueData:n}=e,o=[...i,...n.path||[]],r={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="";const d=s.filter(h=>!!h).slice().reverse();for(const h of d)a=h(r,{data:t,defaultError:a}).message;return{...n,path:o,message:a}},uN=[];function oe(e,t){const i=tc(),s=ic({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===Ko?void 0:Ko].filter(n=>!!n)});e.common.issues.push(s)}class Vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,i){const s=[];for(const n of i){if(n.status==="aborted")return Ee;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,i){const s=[];for(const n of i){const o=await n.key,r=await n.value;s.push({key:o,value:r})}return Vt.mergeObjectSync(t,s)}static mergeObjectSync(t,i){const s={};for(const n of i){const{key:o,value:r}=n;if(o.status==="aborted"||r.status==="aborted")return Ee;o.status==="dirty"&&t.dirty(),r.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof r.value<"u"||n.alwaysSet)&&(s[o.value]=r.value)}return{status:t.value,value:s}}}const Ee=Object.freeze({status:"aborted"}),sc=e=>({status:"dirty",value:e}),Zt=e=>({status:"valid",value:e}),Sh=e=>e.status==="aborted",yh=e=>e.status==="dirty",dl=e=>e.status==="valid",ul=e=>typeof Promise<"u"&&e instanceof Promise;function nc(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function qC(e,t,i,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(fe||(fe={}));var hl,pl;class Ss{constructor(t,i,s,n){this._cachedPath=[],this.parent=t,this.data=i,this._path=s,this._key=n}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 YC=(e,t)=>{if(dl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new pi(e.common.issues);return this._error=i,this._error}}};function Ae(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:s,description:n}=e;if(t&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(o,r)=>{var a,d;const{message:h}=e;return o.code==="invalid_enum_value"?{message:h??r.defaultError}:typeof r.data>"u"?{message:(a=h??s)!==null&&a!==void 0?a:r.defaultError}:o.code!=="invalid_type"?{message:r.defaultError}:{message:(d=h??i)!==null&&d!==void 0?d:r.defaultError}},description:n}}class _e{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return hn(t.data)}_getOrReturnCtx(t,i){return i||{common:t.parent.common,data:t.data,parsedType:hn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Vt,ctx:{common:t.parent.common,data:t.data,parsedType:hn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const i=this._parse(t);if(ul(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(t){const i=this._parse(t);return Promise.resolve(i)}parse(t,i){const s=this.safeParse(t,i);if(s.success)return s.data;throw s.error}safeParse(t,i){var s;const n={common:{issues:[],async:(s=i==null?void 0:i.async)!==null&&s!==void 0?s:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return YC(n,o)}async parseAsync(t,i){const s=await this.safeParseAsync(t,i);if(s.success)return s.data;throw s.error}async safeParseAsync(t,i){const s={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hn(t)},n=this._parse({data:t,path:s.path,parent:s}),o=await(ul(n)?n:Promise.resolve(n));return YC(s,o)}refine(t,i){const s=n=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(n):i;return this._refinement((n,o)=>{const r=t(n),a=()=>o.addIssue({code:J.custom,...s(n)});return typeof Promise<"u"&&r instanceof Promise?r.then(d=>d?!0:(a(),!1)):r?!0:(a(),!1)})}refinement(t,i){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof i=="function"?i(s,n):i),!1))}_refinement(t){return new Yi({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return bs.create(this,this._def)}nullable(){return Cn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qi.create(this,this._def)}promise(){return Yo.create(this,this._def)}or(t){return Cl.create([this,t],this._def)}and(t){return vl.create(this,t,this._def)}transform(t){return new Yi({...Ae(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const i=typeof t=="function"?t:()=>t;return new Rl({...Ae(this._def),innerType:this,defaultValue:i,typeName:Re.ZodDefault})}brand(){return new Fh({typeName:Re.ZodBranded,type:this,...Ae(this._def)})}catch(t){const i=typeof t=="function"?t:()=>t;return new Fl({...Ae(this._def),innerType:this,catchValue:i,typeName:Re.ZodCatch})}describe(t){const i=this.constructor;return new i({...this._def,description:t})}pipe(t){return El.create(this,t)}readonly(){return xl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hN=/^c[^\s-]{8,}$/i,pN=/^[0-9a-z]+$/,gN=/^[0-9A-HJKMNP-TV-Z]{26}$/,fN=/^[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,mN=/^[a-z0-9_-]{21}$/i,CN=/^[-+]?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)?)??$/,vN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let bh;const SN=/^(?:(?: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])$/,yN=/^(([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})))$/,bN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QC="((\\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])))",RN=new RegExp(`^${QC}$`);function XC(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function FN(e){return new RegExp(`^${XC(e)}$`)}function JC(e){let t=`${QC}T${XC(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,new RegExp(`^${t}$`)}function EN(e,t){return!!((t==="v4"||!t)&&SN.test(e)||(t==="v6"||!t)&&yN.test(e))}class Zi extends _e{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:le.string,received:n.parsedType}),Ee}const i=new Vt;let s;for(const n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),oe(s,{code:J.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="max")t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),oe(s,{code:J.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="length"){const o=t.data.length>n.value,r=t.data.length<n.value;(o||r)&&(s=this._getOrReturnCtx(t,s),o?oe(s,{code:J.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&oe(s,{code:J.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),i.dirty())}else if(n.kind==="email")vN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"email",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="emoji")bh||(bh=new RegExp(wN,"u")),bh.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"emoji",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="uuid")fN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"uuid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="nanoid")mN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"nanoid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid")hN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"cuid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid2")pN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"cuid2",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="ulid")gN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"ulid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),oe(s,{validation:"url",code:J.invalid_string,message:n.message}),i.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"regex",code:J.invalid_string,message:n.message}),i.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),oe(s,{code:J.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),i.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),oe(s,{code:J.invalid_string,validation:{startsWith:n.value},message:n.message}),i.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),oe(s,{code:J.invalid_string,validation:{endsWith:n.value},message:n.message}),i.dirty()):n.kind==="datetime"?JC(n).test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{code:J.invalid_string,validation:"datetime",message:n.message}),i.dirty()):n.kind==="date"?RN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{code:J.invalid_string,validation:"date",message:n.message}),i.dirty()):n.kind==="time"?FN(n).test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{code:J.invalid_string,validation:"time",message:n.message}),i.dirty()):n.kind==="duration"?CN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"duration",code:J.invalid_string,message:n.message}),i.dirty()):n.kind==="ip"?EN(t.data,n.version)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"ip",code:J.invalid_string,message:n.message}),i.dirty()):n.kind==="base64"?bN.test(t.data)||(s=this._getOrReturnCtx(t,s),oe(s,{validation:"base64",code:J.invalid_string,message:n.message}),i.dirty()):Ke.assertNever(n);return{status:i.value,value:t.data}}_regex(t,i,s){return this.refinement(n=>t.test(n),{validation:i,code:J.invalid_string,...fe.errToObj(s)})}_addCheck(t){return new Zi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}datetime(t){var i,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(i=t==null?void 0:t.offset)!==null&&i!==void 0?i:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...fe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,i){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(i)})}includes(t,i){return this._addCheck({kind:"includes",value:t,position:i==null?void 0:i.position,...fe.errToObj(i==null?void 0:i.message)})}startsWith(t,i){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(i)})}endsWith(t,i){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(i)})}min(t,i){return this._addCheck({kind:"min",value:t,...fe.errToObj(i)})}max(t,i){return this._addCheck({kind:"max",value:t,...fe.errToObj(i)})}length(t,i){return this._addCheck({kind:"length",value:t,...fe.errToObj(i)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new Zi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Zi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Zi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxLength(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}Zi.create=e=>{var t;return new Zi({checks:[],typeName:Re.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ae(e)})};function xN(e,t){const i=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=i>s?i:s,o=parseInt(e.toFixed(n).replace(".","")),r=parseInt(t.toFixed(n).replace(".",""));return o%r/Math.pow(10,n)}class pn extends _e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==le.number){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:le.number,received:n.parsedType}),Ee}let i;const s=new Vt;for(const n of this._def.checks)n.kind==="int"?Ke.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:J.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?xN(t.data,n.value)!==0&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:J.not_finite,message:n.message}),s.dirty()):Ke.assertNever(n);return{status:s.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,fe.toString(i))}gt(t,i){return this.setLimit("min",t,!1,fe.toString(i))}lte(t,i){return this.setLimit("max",t,!0,fe.toString(i))}lt(t,i){return this.setLimit("max",t,!1,fe.toString(i))}setLimit(t,i,s,n){return new pn({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:fe.toString(n)}]})}_addCheck(t){return new pn({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(i)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ke.isInteger(t.value))}get isFinite(){let t=null,i=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(i)&&Number.isFinite(t)}}pn.create=e=>new pn({checks:[],typeName:Re.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ae(e)});class gn extends _e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==le.bigint){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:le.bigint,received:n.parsedType}),Ee}let i;const s=new Vt;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),oe(i,{code:J.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):Ke.assertNever(n);return{status:s.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,fe.toString(i))}gt(t,i){return this.setLimit("min",t,!1,fe.toString(i))}lte(t,i){return this.setLimit("max",t,!0,fe.toString(i))}lt(t,i){return this.setLimit("max",t,!1,fe.toString(i))}setLimit(t,i,s,n){return new gn({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:fe.toString(n)}]})}_addCheck(t){return new gn({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(i)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}gn.create=e=>{var t;return new gn({checks:[],typeName:Re.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ae(e)})};class gl extends _e{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.boolean,received:i.parsedType}),Ee}return Zt(t.data)}}gl.create=e=>new gl({typeName:Re.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ae(e)});class Jn extends _e{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_type,expected:le.date,received:n.parsedType}),Ee}if(isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return oe(n,{code:J.invalid_date}),Ee}const i=new Vt;let s;for(const n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),oe(s,{code:J.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),i.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),oe(s,{code:J.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),i.dirty()):Ke.assertNever(n);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Jn({...this._def,checks:[...this._def.checks,t]})}min(t,i){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(i)})}max(t,i){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(i)})}get minDate(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t!=null?new Date(t):null}}Jn.create=e=>new Jn({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Re.ZodDate,...Ae(e)});class oc extends _e{_parse(t){if(this._getType(t)!==le.symbol){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.symbol,received:i.parsedType}),Ee}return Zt(t.data)}}oc.create=e=>new oc({typeName:Re.ZodSymbol,...Ae(e)});class fl extends _e{_parse(t){if(this._getType(t)!==le.undefined){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.undefined,received:i.parsedType}),Ee}return Zt(t.data)}}fl.create=e=>new fl({typeName:Re.ZodUndefined,...Ae(e)});class ml extends _e{_parse(t){if(this._getType(t)!==le.null){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.null,received:i.parsedType}),Ee}return Zt(t.data)}}ml.create=e=>new ml({typeName:Re.ZodNull,...Ae(e)});class jo extends _e{constructor(){super(...arguments),this._any=!0}_parse(t){return Zt(t.data)}}jo.create=e=>new jo({typeName:Re.ZodAny,...Ae(e)});class eo extends _e{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Zt(t.data)}}eo.create=e=>new eo({typeName:Re.ZodUnknown,...Ae(e)});class Vs extends _e{_parse(t){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.never,received:i.parsedType}),Ee}}Vs.create=e=>new Vs({typeName:Re.ZodNever,...Ae(e)});class rc extends _e{_parse(t){if(this._getType(t)!==le.undefined){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.void,received:i.parsedType}),Ee}return Zt(t.data)}}rc.create=e=>new rc({typeName:Re.ZodVoid,...Ae(e)});class qi extends _e{_parse(t){const{ctx:i,status:s}=this._processInputParams(t),n=this._def;if(i.parsedType!==le.array)return oe(i,{code:J.invalid_type,expected:le.array,received:i.parsedType}),Ee;if(n.exactLength!==null){const r=i.data.length>n.exactLength.value,a=i.data.length<n.exactLength.value;(r||a)&&(oe(i,{code:r?J.too_big:J.too_small,minimum:a?n.exactLength.value:void 0,maximum:r?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&i.data.length<n.minLength.value&&(oe(i,{code:J.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&i.data.length>n.maxLength.value&&(oe(i,{code:J.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((r,a)=>n.type._parseAsync(new Ss(i,r,i.path,a)))).then(r=>Vt.mergeArray(s,r));const o=[...i.data].map((r,a)=>n.type._parseSync(new Ss(i,r,i.path,a)));return Vt.mergeArray(s,o)}get element(){return this._def.type}min(t,i){return new qi({...this._def,minLength:{value:t,message:fe.toString(i)}})}max(t,i){return new qi({...this._def,maxLength:{value:t,message:fe.toString(i)}})}length(t,i){return new qi({...this._def,exactLength:{value:t,message:fe.toString(i)}})}nonempty(t){return this.min(1,t)}}qi.create=(e,t)=>new qi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...Ae(t)});function Zo(e){if(e instanceof ut){const t={};for(const i in e.shape){const s=e.shape[i];t[i]=bs.create(Zo(s))}return new ut({...e._def,shape:()=>t})}else return e instanceof qi?new qi({...e._def,type:Zo(e.element)}):e instanceof bs?bs.create(Zo(e.unwrap())):e instanceof Cn?Cn.create(Zo(e.unwrap())):e instanceof ys?ys.create(e.items.map(t=>Zo(t))):e}class ut extends _e{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),i=Ke.objectKeys(t);return this._cached={shape:t,keys:i}}_parse(t){if(this._getType(t)!==le.object){const d=this._getOrReturnCtx(t);return oe(d,{code:J.invalid_type,expected:le.object,received:d.parsedType}),Ee}const{status:i,ctx:s}=this._processInputParams(t),{shape:n,keys:o}=this._getCached(),r=[];if(!(this._def.catchall instanceof Vs&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||r.push(d);const a=[];for(const d of o){const h=n[d],p=s.data[d];a.push({key:{status:"valid",value:d},value:h._parse(new Ss(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Vs){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of r)a.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(d==="strict")r.length>0&&(oe(s,{code:J.unrecognized_keys,keys:r}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of r){const p=s.data[h];a.push({key:{status:"valid",value:h},value:d._parse(new Ss(s,p,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of a){const p=await h.key,f=await h.value;d.push({key:p,value:f,alwaysSet:h.alwaysSet})}return d}).then(d=>Vt.mergeObjectSync(i,d)):Vt.mergeObjectSync(i,a)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new ut({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(i,s)=>{var n,o,r,a;const d=(r=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,i,s).message)!==null&&r!==void 0?r:s.defaultError;return i.code==="unrecognized_keys"?{message:(a=fe.errToObj(t).message)!==null&&a!==void 0?a:d}:{message:d}}}:{}})}strip(){return new ut({...this._def,unknownKeys:"strip"})}passthrough(){return new ut({...this._def,unknownKeys:"passthrough"})}extend(t){return new ut({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ut({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Re.ZodObject})}setKey(t,i){return this.augment({[t]:i})}catchall(t){return new ut({...this._def,catchall:t})}pick(t){const i={};return Ke.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new ut({...this._def,shape:()=>i})}omit(t){const i={};return Ke.objectKeys(this.shape).forEach(s=>{t[s]||(i[s]=this.shape[s])}),new ut({...this._def,shape:()=>i})}deepPartial(){return Zo(this)}partial(t){const i={};return Ke.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?i[s]=n:i[s]=n.optional()}),new ut({...this._def,shape:()=>i})}required(t){const i={};return Ke.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])i[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof bs;)n=n._def.innerType;i[s]=n}}),new ut({...this._def,shape:()=>i})}keyof(){return ev(Ke.objectKeys(this.shape))}}ut.create=(e,t)=>new ut({shape:()=>e,unknownKeys:"strip",catchall:Vs.create(),typeName:Re.ZodObject,...Ae(t)}),ut.strictCreate=(e,t)=>new ut({shape:()=>e,unknownKeys:"strict",catchall:Vs.create(),typeName:Re.ZodObject,...Ae(t)}),ut.lazycreate=(e,t)=>new ut({shape:e,unknownKeys:"strip",catchall:Vs.create(),typeName:Re.ZodObject,...Ae(t)});class Cl extends _e{_parse(t){const{ctx:i}=this._processInputParams(t),s=this._def.options;function n(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return i.common.issues.push(...a.ctx.common.issues),a.result;const r=o.map(a=>new pi(a.ctx.common.issues));return oe(i,{code:J.invalid_union,unionErrors:r}),Ee}if(i.common.async)return Promise.all(s.map(async o=>{const r={...i,common:{...i.common,issues:[]},parent:null};return{result:await o._parseAsync({data:i.data,path:i.path,parent:r}),ctx:r}})).then(n);{let o;const r=[];for(const d of s){const h={...i,common:{...i.common,issues:[]},parent:null},p=d._parseSync({data:i.data,path:i.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:h}),h.common.issues.length&&r.push(h.common.issues)}if(o)return i.common.issues.push(...o.ctx.common.issues),o.result;const a=r.map(d=>new pi(d));return oe(i,{code:J.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}}Cl.create=(e,t)=>new Cl({options:e,typeName:Re.ZodUnion,...Ae(t)});const fn=e=>e instanceof Sl?fn(e.schema):e instanceof Yi?fn(e.innerType()):e instanceof yl?[e.value]:e instanceof mn?e.options:e instanceof bl?Ke.objectValues(e.enum):e instanceof Rl?fn(e._def.innerType):e instanceof fl?[void 0]:e instanceof ml?[null]:e instanceof bs?[void 0,...fn(e.unwrap())]:e instanceof Cn?[null,...fn(e.unwrap())]:e instanceof Fh||e instanceof xl?fn(e.unwrap()):e instanceof Fl?fn(e._def.innerType):[];class lc extends _e{_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==le.object)return oe(i,{code:J.invalid_type,expected:le.object,received:i.parsedType}),Ee;const s=this.discriminator,n=i.data[s],o=this.optionsMap.get(n);return o?i.common.async?o._parseAsync({data:i.data,path:i.path,parent:i}):o._parseSync({data:i.data,path:i.path,parent:i}):(oe(i,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,i,s){const n=new Map;for(const o of i){const r=fn(o.shape[t]);if(!r.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of r){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,o)}}return new lc({typeName:Re.ZodDiscriminatedUnion,discriminator:t,options:i,optionsMap:n,...Ae(s)})}}function Rh(e,t){const i=hn(e),s=hn(t);if(e===t)return{valid:!0,data:e};if(i===le.object&&s===le.object){const n=Ke.objectKeys(t),o=Ke.objectKeys(e).filter(a=>n.indexOf(a)!==-1),r={...e,...t};for(const a of o){const d=Rh(e[a],t[a]);if(!d.valid)return{valid:!1};r[a]=d.data}return{valid:!0,data:r}}else if(i===le.array&&s===le.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let o=0;o<e.length;o++){const r=e[o],a=t[o],d=Rh(r,a);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return i===le.date&&s===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class vl extends _e{_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=(o,r)=>{if(Sh(o)||Sh(r))return Ee;const a=Rh(o.value,r.value);return a.valid?((yh(o)||yh(r))&&i.dirty(),{status:i.value,value:a.data}):(oe(s,{code:J.invalid_intersection_types}),Ee)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([o,r])=>n(o,r)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}vl.create=(e,t,i)=>new vl({left:e,right:t,typeName:Re.ZodIntersection,...Ae(i)});class ys extends _e{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==le.array)return oe(s,{code:J.invalid_type,expected:le.array,received:s.parsedType}),Ee;if(s.data.length<this._def.items.length)return oe(s,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&s.data.length>this._def.items.length&&(oe(s,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const n=[...s.data].map((o,r)=>{const a=this._def.items[r]||this._def.rest;return a?a._parse(new Ss(s,o,s.path,r)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>Vt.mergeArray(i,o)):Vt.mergeArray(i,n)}get items(){return this._def.items}rest(t){return new ys({...this._def,rest:t})}}ys.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ys({items:e,typeName:Re.ZodTuple,rest:null,...Ae(t)})};class wl extends _e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==le.object)return oe(s,{code:J.invalid_type,expected:le.object,received:s.parsedType}),Ee;const n=[],o=this._def.keyType,r=this._def.valueType;for(const a in s.data)n.push({key:o._parse(new Ss(s,a,s.path,a)),value:r._parse(new Ss(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Vt.mergeObjectAsync(i,n):Vt.mergeObjectSync(i,n)}get element(){return this._def.valueType}static create(t,i,s){return i instanceof _e?new wl({keyType:t,valueType:i,typeName:Re.ZodRecord,...Ae(s)}):new wl({keyType:Zi.create(),valueType:t,typeName:Re.ZodRecord,...Ae(i)})}}class ac extends _e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==le.map)return oe(s,{code:J.invalid_type,expected:le.map,received:s.parsedType}),Ee;const n=this._def.keyType,o=this._def.valueType,r=[...s.data.entries()].map(([a,d],h)=>({key:n._parse(new Ss(s,a,s.path,[h,"key"])),value:o._parse(new Ss(s,d,s.path,[h,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const d of r){const h=await d.key,p=await d.value;if(h.status==="aborted"||p.status==="aborted")return Ee;(h.status==="dirty"||p.status==="dirty")&&i.dirty(),a.set(h.value,p.value)}return{status:i.value,value:a}})}else{const a=new Map;for(const d of r){const h=d.key,p=d.value;if(h.status==="aborted"||p.status==="aborted")return Ee;(h.status==="dirty"||p.status==="dirty")&&i.dirty(),a.set(h.value,p.value)}return{status:i.value,value:a}}}}ac.create=(e,t,i)=>new ac({valueType:t,keyType:e,typeName:Re.ZodMap,...Ae(i)});class to extends _e{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==le.set)return oe(s,{code:J.invalid_type,expected:le.set,received:s.parsedType}),Ee;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(oe(s,{code:J.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),i.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(oe(s,{code:J.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),i.dirty());const o=this._def.valueType;function r(d){const h=new Set;for(const p of d){if(p.status==="aborted")return Ee;p.status==="dirty"&&i.dirty(),h.add(p.value)}return{status:i.value,value:h}}const a=[...s.data.values()].map((d,h)=>o._parse(new Ss(s,d,s.path,h)));return s.common.async?Promise.all(a).then(d=>r(d)):r(a)}min(t,i){return new to({...this._def,minSize:{value:t,message:fe.toString(i)}})}max(t,i){return new to({...this._def,maxSize:{value:t,message:fe.toString(i)}})}size(t,i){return this.min(t,i).max(t,i)}nonempty(t){return this.min(1,t)}}to.create=(e,t)=>new to({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...Ae(t)});class qo extends _e{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==le.function)return oe(i,{code:J.invalid_type,expected:le.function,received:i.parsedType}),Ee;function s(a,d){return ic({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,tc(),Ko].filter(h=>!!h),issueData:{code:J.invalid_arguments,argumentsError:d}})}function n(a,d){return ic({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,tc(),Ko].filter(h=>!!h),issueData:{code:J.invalid_return_type,returnTypeError:d}})}const o={errorMap:i.common.contextualErrorMap},r=i.data;if(this._def.returns instanceof Yo){const a=this;return Zt(async function(...d){const h=new pi([]),p=await a._def.args.parseAsync(d,o).catch(m=>{throw h.addIssue(s(d,m)),h}),f=await Reflect.apply(r,this,p);return await a._def.returns._def.type.parseAsync(f,o).catch(m=>{throw h.addIssue(n(f,m)),h})})}else{const a=this;return Zt(function(...d){const h=a._def.args.safeParse(d,o);if(!h.success)throw new pi([s(d,h.error)]);const p=Reflect.apply(r,this,h.data),f=a._def.returns.safeParse(p,o);if(!f.success)throw new pi([n(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new qo({...this._def,args:ys.create(t).rest(eo.create())})}returns(t){return new qo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,i,s){return new qo({args:t||ys.create([]).rest(eo.create()),returns:i||eo.create(),typeName:Re.ZodFunction,...Ae(s)})}}class Sl extends _e{get schema(){return this._def.getter()}_parse(t){const{ctx:i}=this._processInputParams(t);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Sl.create=(e,t)=>new Sl({getter:e,typeName:Re.ZodLazy,...Ae(t)});class yl extends _e{_parse(t){if(t.data!==this._def.value){const i=this._getOrReturnCtx(t);return oe(i,{received:i.data,code:J.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}}yl.create=(e,t)=>new yl({value:e,typeName:Re.ZodLiteral,...Ae(t)});function ev(e,t){return new mn({values:e,typeName:Re.ZodEnum,...Ae(t)})}class mn extends _e{constructor(){super(...arguments),hl.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const i=this._getOrReturnCtx(t),s=this._def.values;return oe(i,{expected:Ke.joinValues(s),received:i.parsedType,code:J.invalid_type}),Ee}if(nc(this,hl)||qC(this,hl,new Set(this._def.values)),!nc(this,hl).has(t.data)){const i=this._getOrReturnCtx(t),s=this._def.values;return oe(i,{received:i.data,code:J.invalid_enum_value,options:s}),Ee}return Zt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const i of this._def.values)t[i]=i;return t}get Values(){const t={};for(const i of this._def.values)t[i]=i;return t}get Enum(){const t={};for(const i of this._def.values)t[i]=i;return t}extract(t,i=this._def){return mn.create(t,{...this._def,...i})}exclude(t,i=this._def){return mn.create(this.options.filter(s=>!t.includes(s)),{...this._def,...i})}}hl=new WeakMap,mn.create=ev;class bl extends _e{constructor(){super(...arguments),pl.set(this,void 0)}_parse(t){const i=Ke.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==le.string&&s.parsedType!==le.number){const n=Ke.objectValues(i);return oe(s,{expected:Ke.joinValues(n),received:s.parsedType,code:J.invalid_type}),Ee}if(nc(this,pl)||qC(this,pl,new Set(Ke.getValidEnumValues(this._def.values))),!nc(this,pl).has(t.data)){const n=Ke.objectValues(i);return oe(s,{received:s.data,code:J.invalid_enum_value,options:n}),Ee}return Zt(t.data)}get enum(){return this._def.values}}pl=new WeakMap,bl.create=(e,t)=>new bl({values:e,typeName:Re.ZodNativeEnum,...Ae(t)});class Yo extends _e{unwrap(){return this._def.type}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==le.promise&&i.common.async===!1)return oe(i,{code:J.invalid_type,expected:le.promise,received:i.parsedType}),Ee;const s=i.parsedType===le.promise?i.data:Promise.resolve(i.data);return Zt(s.then(n=>this._def.type.parseAsync(n,{path:i.path,errorMap:i.common.contextualErrorMap})))}}Yo.create=(e,t)=>new Yo({type:e,typeName:Re.ZodPromise,...Ae(t)});class Yi extends _e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:r=>{oe(s,r),r.fatal?i.abort():i.dirty()},get path(){return s.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){const r=n.transform(s.data,o);if(s.common.async)return Promise.resolve(r).then(async a=>{if(i.value==="aborted")return Ee;const d=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return d.status==="aborted"?Ee:d.status==="dirty"||i.value==="dirty"?sc(d.value):d});{if(i.value==="aborted")return Ee;const a=this._def.schema._parseSync({data:r,path:s.path,parent:s});return a.status==="aborted"?Ee:a.status==="dirty"||i.value==="dirty"?sc(a.value):a}}if(n.type==="refinement"){const r=a=>{const d=n.refinement(a,o);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Ee:(a.status==="dirty"&&i.dirty(),r(a.value),{status:i.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&i.dirty(),r(a.value).then(()=>({status:i.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const r=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!dl(r))return r;const a=n.transform(r.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(r=>dl(r)?Promise.resolve(n.transform(r.value,o)).then(a=>({status:i.value,value:a})):r);Ke.assertNever(n)}}Yi.create=(e,t,i)=>new Yi({schema:e,typeName:Re.ZodEffects,effect:t,...Ae(i)}),Yi.createWithPreprocess=(e,t,i)=>new Yi({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...Ae(i)});class bs extends _e{_parse(t){return this._getType(t)===le.undefined?Zt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bs.create=(e,t)=>new bs({innerType:e,typeName:Re.ZodOptional,...Ae(t)});class Cn extends _e{_parse(t){return this._getType(t)===le.null?Zt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cn.create=(e,t)=>new Cn({innerType:e,typeName:Re.ZodNullable,...Ae(t)});class Rl extends _e{_parse(t){const{ctx:i}=this._processInputParams(t);let s=i.data;return i.parsedType===le.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}Rl.create=(e,t)=>new Rl({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ae(t)});class Fl extends _e{_parse(t){const{ctx:i}=this._processInputParams(t),s={...i,common:{...i.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ul(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new pi(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new pi(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Fl.create=(e,t)=>new Fl({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ae(t)});class cc extends _e{_parse(t){if(this._getType(t)!==le.nan){const i=this._getOrReturnCtx(t);return oe(i,{code:J.invalid_type,expected:le.nan,received:i.parsedType}),Ee}return{status:"valid",value:t.data}}}cc.create=e=>new cc({typeName:Re.ZodNaN,...Ae(e)});const PN=Symbol("zod_brand");class Fh extends _e{_parse(t){const{ctx:i}=this._processInputParams(t),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}}class El extends _e{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Ee:n.status==="dirty"?(i.dirty(),sc(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Ee:n.status==="dirty"?(i.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,i){return new El({in:t,out:i,typeName:Re.ZodPipeline})}}class xl extends _e{_parse(t){const i=this._def.innerType._parse(t),s=n=>(dl(n)&&(n.value=Object.freeze(n.value)),n);return ul(i)?i.then(n=>s(n)):s(i)}unwrap(){return this._def.innerType}}xl.create=(e,t)=>new xl({innerType:e,typeName:Re.ZodReadonly,...Ae(t)});function tv(e,t={},i){return e?jo.create().superRefine((s,n)=>{var o,r;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,d=(r=(o=a.fatal)!==null&&o!==void 0?o:i)!==null&&r!==void 0?r:!0,h=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...h,fatal:d})}}):jo.create()}const DN={object:ut.lazycreate};var Re;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Re||(Re={}));const TN=(e,t={message:`Input not instance of ${e.name}`})=>tv(i=>i instanceof e,t),iv=Zi.create,sv=pn.create,AN=cc.create,MN=gn.create,nv=gl.create,kN=Jn.create,IN=oc.create,LN=fl.create,_N=ml.create,ON=jo.create,VN=eo.create,NN=Vs.create,BN=rc.create,GN=qi.create,HN=ut.create,WN=ut.strictCreate,zN=Cl.create,UN=lc.create,$N=vl.create,KN=ys.create,jN=wl.create,ZN=ac.create,qN=to.create,YN=qo.create,QN=Sl.create,XN=yl.create,JN=mn.create,eB=bl.create,tB=Yo.create,ov=Yi.create,iB=bs.create,sB=Cn.create,nB=Yi.createWithPreprocess,oB=El.create;var dc=Object.freeze({__proto__:null,defaultErrorMap:Ko,setErrorMap:dN,getErrorMap:tc,makeIssue:ic,EMPTY_PATH:uN,addIssueToContext:oe,ParseStatus:Vt,INVALID:Ee,DIRTY:sc,OK:Zt,isAborted:Sh,isDirty:yh,isValid:dl,isAsync:ul,get util(){return Ke},get objectUtil(){return wh},ZodParsedType:le,getParsedType:hn,ZodType:_e,datetimeRegex:JC,ZodString:Zi,ZodNumber:pn,ZodBigInt:gn,ZodBoolean:gl,ZodDate:Jn,ZodSymbol:oc,ZodUndefined:fl,ZodNull:ml,ZodAny:jo,ZodUnknown:eo,ZodNever:Vs,ZodVoid:rc,ZodArray:qi,ZodObject:ut,ZodUnion:Cl,ZodDiscriminatedUnion:lc,ZodIntersection:vl,ZodTuple:ys,ZodRecord:wl,ZodMap:ac,ZodSet:to,ZodFunction:qo,ZodLazy:Sl,ZodLiteral:yl,ZodEnum:mn,ZodNativeEnum:bl,ZodPromise:Yo,ZodEffects:Yi,ZodTransformer:Yi,ZodOptional:bs,ZodNullable:Cn,ZodDefault:Rl,ZodCatch:Fl,ZodNaN:cc,BRAND:PN,ZodBranded:Fh,ZodPipeline:El,ZodReadonly:xl,custom:tv,Schema:_e,ZodSchema:_e,late:DN,get ZodFirstPartyTypeKind(){return Re},coerce:{string:e=>Zi.create({...e,coerce:!0}),number:e=>pn.create({...e,coerce:!0}),boolean:e=>gl.create({...e,coerce:!0}),bigint:e=>gn.create({...e,coerce:!0}),date:e=>Jn.create({...e,coerce:!0})},any:ON,array:GN,bigint:MN,boolean:nv,date:kN,discriminatedUnion:UN,effect:ov,enum:JN,function:YN,instanceof:TN,intersection:$N,lazy:QN,literal:XN,map:ZN,nan:AN,nativeEnum:eB,never:NN,null:_N,nullable:sB,number:sv,object:HN,oboolean:()=>nv().optional(),onumber:()=>sv().optional(),optional:iB,ostring:()=>iv().optional(),pipeline:oB,preprocess:nB,promise:tB,record:jN,set:qN,strictObject:WN,string:iv,symbol:IN,transformer:ov,tuple:KN,undefined:LN,union:zN,unknown:VN,void:BN,NEVER:Ee,ZodIssueCode:J,quotelessJson:cN,ZodError:pi});function rB(e){throw new Error("Unexpected object: "+e)}const rv="upload://upload/",lv="index://index/";function lB(e){return e.startsWith(rv)}function aB(e){return e.startsWith(lv)}function cB(e){if(aB(e)){const t=e.slice(lv.length);return JSON.parse(decodeURIComponent(t)).path}else if(lB(e)){const t=e.slice(rv.length);return JSON.parse(decodeURIComponent(t)).localPath}rB(e)}dc.object({__isRef:dc.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:dc.string().describe("Upstream block id"),name:dc.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 dB(e){return e.replace(/^.*[\\/]/,"")}const uB={class:"pl-file-input__envelope"},hB={key:0,ref:"label"},pB={key:0,class:"required-icon"},gB=["data-placeholder"],fB={key:5,class:"pl-file-input__stats"},mB={key:0,class:"pl-file-input__error"},CB={key:1,class:"upl-file-input__helper"},vB=l.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}},emits:["update:modelValue"],setup(e,{emit:t}){const i=l.reactive({fileDialogOpen:!1}),s=l.useSlots(),n=t,o=e,r=l.computed(()=>{if(o.modelValue)try{const R=cB(o.modelValue).trim();return o.showFilenameOnly?dB(R):R}catch(R){return console.error(R),o.modelValue}return""}),a=l.computed(()=>o.progress&&!o.progress.done),d=l.computed(()=>o.progress&&o.progress.done),h=l.computed(()=>{var R;return o.error||((R=o.progress)==null?void 0:R.lastError)}),p=l.computed(()=>{var R;return o.error??((R=o.progress)==null?void 0:R.lastError)}),f=l.computed(()=>{const{status:R,done:x}=o.progress??{};return!R||!R.bytesTotal?"":R.bytesProcessed&&!x?Yu(R.bytesProcessed,{})+" / "+Yu(R.bytesTotal,{}):Yu(R.bytesTotal,{})}),m=l.computed(()=>{var R;const{progress:x}=o;return x?{width:x.done?"100%":Math.round((((R=x.status)==null?void 0:R.progress)??0)*100)+"%"}:{}}),v=()=>{i.fileDialogOpen=!0},w=R=>{R.files.length&&n("update:modelValue",R.files[0])},S=()=>n("update:modelValue",void 0),b=l.ref();return Qn(b),(R,x)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",uB,[l.createElementVNode("div",{ref_key:"rootRef",ref:b,class:l.normalizeClass(["pl-file-input",{dashed:R.dashed,error:h.value}]),tabindex:"0",onKeyup:l.withKeys(v,["enter"])},[l.createElementVNode("div",{class:"pl-file-input__progress",style:l.normalizeStyle(m.value)},null,4),x[3]||(x[3]=l.createTextVNode()),R.label?(l.openBlock(),l.createElementBlock("label",hB,[R.required?(l.openBlock(),l.createElementBlock("i",pB)):l.createCommentVNode("",!0),x[1]||(x[1]=l.createTextVNode()),l.createElementVNode("span",null,l.toDisplayString(R.label),1),x[2]||(x[2]=l.createTextVNode()),l.unref(s).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:1,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(R.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)],512)):l.createCommentVNode("",!0),x[4]||(x[4]=l.createTextVNode()),h.value?(l.openBlock(),l.createBlock(Xn,{key:1,name:"restart"})):a.value?(l.openBlock(),l.createBlock(Xn,{key:2,name:"cloud-up"})):d.value?(l.openBlock(),l.createBlock(Xn,{key:3,name:"success"})):(l.openBlock(),l.createBlock(Xn,{key:4,name:"paper-clip"})),x[5]||(x[5]=l.createTextVNode()),l.createElementVNode("div",{"data-placeholder":R.placeholder??"Choose file",class:"pl-file-input__filename",onClick:l.withModifiers(v,["stop"])},l.toDisplayString(r.value),9,gB),x[6]||(x[6]=l.createTextVNode()),f.value?(l.openBlock(),l.createElementBlock("div",fB,l.toDisplayString(f.value),1)):l.createCommentVNode("",!0),x[7]||(x[7]=l.createTextVNode()),R.modelValue?(l.openBlock(),l.createBlock(Xn,{key:6,name:"close",onClick:l.withModifiers(S,["stop"])})):l.createCommentVNode("",!0),x[8]||(x[8]=l.createTextVNode()),l.createVNode($o,{class:"pl-file-input__contour"})],34),x[9]||(x[9]=l.createTextVNode()),h.value?(l.openBlock(),l.createElementBlock("div",mB,l.toDisplayString(p.value),1)):R.helper?(l.openBlock(),l.createElementBlock("div",CB,l.toDisplayString(R.helper),1)):l.createCommentVNode("",!0)]),x[10]||(x[10]=l.createTextVNode()),l.createVNode(l.unref(jC),{modelValue:i.fileDialogOpen,"onUpdate:modelValue":x[0]||(x[0]=T=>i.fileDialogOpen=T),extensions:R.extensions,title:R.fileDialogTitle,"onImport:files":w},null,8,["modelValue","extensions","title"])],64))}}),wB=l.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(e){const t=e;return l.provide(t.contextKey,l.computed(()=>t.context)),(i,s)=>l.renderSlot(i.$slots,"default")}});function Nt(e,t,i){return t>e?t:e>i?i:e}const Eh=e=>l.computed(()=>{const t=[100],{min:i,max:s,step:n}=e.value;let o=i;for(;o<s;){o+=n;const r=(1-(Nt(o,i,s)-i)/(s-i))*100;t.push(r)}return t}),SB={class:"ui-slider__wrapper"},yB={class:"ui-slider__label-section"},bB={key:0,class:"text-s"},RB={key:1,class:"ui-slider__value-static text-s"},FB={class:"ui-slider__base"},EB={class:"ui-slider__container"},xB={class:"ui-slider__container ui-slider__container-thumb"},PB={class:"ui-slider__input-wrapper d-flex"},DB=["value"],TB={key:0,class:"ui-slider__error"},AB=l.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(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.reactive({deltaValue:0}),r=l.computed(()=>n.max-n.min),a=l.computed(()=>Nt((n.modelValue??0)+o.deltaValue,n.min,n.max)),d=l.ref(n.modelValue),h=l.computed(()=>{const V=n.modelValue;return Number.isFinite(V)?V<n.min?`Min value: ${n.min}`:V>n.max?`Max value: ${n.max}`:n.error:"Not a number"}),p=l.computed(()=>n),f=Eh(p),m=l.computed(()=>(a.value-n.min)/r.value),v=l.computed(()=>({right:Math.ceil((1-m.value)*100)+"%"})),w=l.computed(()=>({right:`calc(${Math.ceil((1-m.value)*100)}%) `})),S=l.ref(),b=l.ref();l.watch(()=>n.modelValue,V=>{d.value=V});function R(V){const L=Nt(V,n.min,n.max);return Math.round((L+Number.EPSILON)*(1/n.step))/(1/n.step)}un(b,V=>{var L;Et((L=l.unref(S))==null?void 0:L.getBoundingClientRect(),A=>{const{dx:k}=V;o.deltaValue=k/A.width*r.value,d.value=R(Nt((n.modelValue??0)+o.deltaValue,n.min,n.max)),V.stop&&(s("update:modelValue",R(a.value)),o.deltaValue=0)})});function x(V){s("update:modelValue",R(V))}function T(V){x(+V.target.value)}function I(V){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(V.code)&&V.preventDefault();const L=V.code==="ArrowUp"||V.code==="ArrowRight"?n.step*1:V.code==="ArrowDown"||V.code==="ArrowLeft"?n.step*-1:0;x(n.modelValue+L)}return(V,L)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([n.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[l.createElementVNode("div",{class:l.normalizeClass([`ui-slider__mode-${n.mode}`,"ui-slider"])},[l.createElementVNode("div",SB,[l.createElementVNode("div",yB,[V.label?(l.openBlock(),l.createElementBlock("label",bB,[l.createElementVNode("span",null,l.toDisplayString(V.label),1),L[1]||(L[1]=l.createTextVNode()),l.unref(i).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:0,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(V.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),L[2]||(L[2]=l.createTextVNode()),n.mode==="text"?(l.openBlock(),l.createElementBlock("div",RB,l.toDisplayString(d.value)+l.toDisplayString(V.measure),1)):l.createCommentVNode("",!0)]),L[6]||(L[6]=l.createTextVNode()),l.createElementVNode("div",FB,[l.createElementVNode("div",EB,[l.createElementVNode("div",{ref_key:"barRef",ref:S,class:"ui-slider__bar"},[l.createElementVNode("div",{class:"ui-slider__progress",style:l.normalizeStyle(v.value)},null,4)],512)]),L[5]||(L[5]=l.createTextVNode()),l.createElementVNode("div",xB,[n.breakpoints?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(f),(A,k)=>(l.openBlock(),l.createElementBlock("div",{key:k,style:l.normalizeStyle({right:`${A}%`}),class:"ui-slider__thumb-step"},null,4))),128)):l.createCommentVNode("",!0),L[4]||(L[4]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"thumbRef",ref:b,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:l.normalizeStyle(w.value),onKeydown:I},L[3]||(L[3]=[l.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),L[7]||(L[7]=l.createTextVNode()),l.createElementVNode("div",PB,[n.mode==="input"?(l.openBlock(),l.createElementBlock("input",{key:0,value:d.value,class:"ui-slider__value text-s",onChange:L[0]||(L[0]=A=>T(A))},null,40,DB)):l.createCommentVNode("",!0)])],2),L[8]||(L[8]=l.createTextVNode()),h.value?(l.openBlock(),l.createElementBlock("div",TB,l.toDisplayString(h.value),1)):l.createCommentVNode("",!0)],2))}});function MB(e,t=null,i=null){function s(a){const{scrollTop:d,scrollHeight:h,clientHeight:p}=a;if(!(h>p)||!t)return null;const f=h-d-p,m=d>t?t:0,v=f>t?p-t-m:p;return`linear-gradient(
8
+ `,M0=["innerHTML"],P0={class:"dropdown-list-item__title-container"},L0={class:"dropdown-list-item__title text-s"},F0={key:0,class:"dropdown-list-item__description text-description"},$0={key:1,class:"dropdown-list-item__icon flex-self-start"},Qo=n.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(i){const e=i,t=n.computed(()=>{const c=[];return e.size==="small"&&c.push("dropdown-list-item__small"),e.isSelected&&c.push("dropdown-list-item__selected"),e.isHovered&&c.push("hovered-item"),c.join(" ")}),a=n.computed(()=>{const c=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&c.push("checked"),c.join(" ")}),s=n.computed(()=>e.isSelected?I0:D0);return(c,d)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([t.value,"dropdown-list-item"])},[e.useCheckbox?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(a.value),innerHTML:s.value},null,10,M0)):n.createCommentVNode("",!0),d[1]||(d[1]=n.createTextVNode()),n.createElementVNode("div",P0,[n.createElementVNode("div",L0,n.toDisplayString(c.option.label),1),d[0]||(d[0]=n.createTextVNode()),c.option.description?(n.openBlock(),n.createElementBlock("div",F0,n.toDisplayString(c.option.description),1)):n.createCommentVNode("",!0)]),d[2]||(d[2]=n.createTextVNode()),!e.useCheckbox&&e.isSelected?(n.openBlock(),n.createElementBlock("div",$0)):n.createCommentVNode("",!0)],2))}}),Gd=n.defineComponent({__name:"LongText",setup(i){n.useCssVars(g=>({"8d68520c":d.value}));const e=n.ref(!1),t=n.ref(),a=n.ref(!1),s=n.computed(()=>a.value&&e.value?"ui-lt-animate":""),c=Vd(g=>a.value=g,500),d=n.computed(()=>{var g;return t.value?`${((g=t.value)==null?void 0:g.innerHTML.length)*.4}s`:"5s"});function u(){const g=Is(t.value,"span cannot be empty");e.value=g.clientWidth<g.scrollWidth}function p(){u(),c(!0)}function h(){c(!1)}return(g,x)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps(g.$attrs,{class:"ui-lt-container"}),[n.createElementVNode("span",{onMouseover:p,onMouseleave:h},[n.createElementVNode("span",{ref_key:"span",ref:t,class:n.normalizeClass(s.value)},[n.renderSlot(g.$slots,"default")],2)],32)],16))}}),z0={class:"ui-dropdown__envelope"},Z0=["tabindex"],U0={class:"ui-dropdown__container"},j0={class:"ui-dropdown__field"},W0=["disabled","placeholder"],H0={class:"ui-dropdown__controls"},q0={key:0},G0={key:0,class:"required-icon"},K0={key:0,class:"nothing-found"},Y0={key:0,class:"ui-dropdown__error"},J0={key:1,class:"ui-dropdown__helper"},X0={name:"PlDropdown"},Xs=n.defineComponent({...X0,props:{modelValue:{},label:{default:""},options:{},helper:{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(i,{emit:e}){const t=e,a=i,s=n.useSlots(),c=n.ref(),d=n.ref(),u=n.ref(),p=n.reactive({search:"",activeIndex:-1,open:!1}),h=()=>Yo(v.value.findIndex(L=>en(L.value,a.modelValue)),L=>L<0?0:L),g=()=>p.activeIndex=h(),x=n.computed(()=>a.options.findIndex(L=>en(L.value,a.modelValue))),R=n.computed(()=>{if(a.error)return a.error;if(a.modelValue!==void 0&&x.value===-1)return"The selected value is not one of the options"}),T=n.computed(()=>Gr(a.options).map((L,H)=>({...L,index:H,isSelected:H===x.value,isActive:H===p.activeIndex}))),C=n.computed(()=>{const L=n.unref(T).find(H=>en(H.value,a.modelValue));return(L==null?void 0:L.label)||a.modelValue}),k=n.computed(()=>!p.open&&a.modelValue?"":a.modelValue?String(C.value):a.placeholder),S=n.computed(()=>a.modelValue!==void 0&&a.modelValue!==null),v=n.computed(()=>{const L=T.value;return p.search?L.filter(H=>{const oe=p.search.toLowerCase();return H.label.toLowerCase().includes(oe)||H.description&&H.description.toLowerCase().includes(oe)?!0:typeof H.value=="string"?H.value.toLowerCase().includes(oe):H.value===p.search}):L}),I=n.computed(()=>a.disabled?void 0:"0"),K=L=>{var H;t("update:modelValue",L),p.search="",p.open=!1,(H=c==null?void 0:c.value)==null||H.focus()},j=()=>t("update:modelValue",void 0),z=()=>{var L;return(L=u.value)==null?void 0:L.focus()},W=()=>p.open=!p.open,O=()=>p.open=!0,B=L=>{var H;(H=c==null?void 0:c.value)!=null&&H.contains(L.relatedTarget)||(p.search="",p.open=!1)},P=()=>{const L=d.value;L&&at(L.querySelector(".hovered-item"),H=>{Xo(L,H)})},Z=L=>{var H,oe;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(L.code))L.preventDefault();else return;const{open:de,activeIndex:ae}=p;if(!de){L.code==="Enter"&&(p.open=!0);return}L.code==="Escape"&&(p.open=!1,(H=c.value)==null||H.focus());const J=n.unref(v),{length:Ce}=J;if(!Ce)return;L.code==="Enter"&&K((oe=J.find(Et=>Et.index===ae))==null?void 0:oe.value);const Be=J.findIndex(Et=>Et.index===ae)??-1,Ar=L.code==="ArrowDown"?1:L.code==="ArrowUp"?-1:0,or=Math.abs(Be+Ar+Ce)%Ce;p.activeIndex=v.value[or].index??-1};return vr(c),n.watch(()=>a.modelValue,g,{immediate:!0}),n.watch(()=>p.open,L=>{var H;return L?(H=u.value)==null?void 0:H.focus():""}),n.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&P()}),(L,H)=>(n.openBlock(),n.createElementBlock("div",z0,[n.createElementVNode("div",{ref_key:"root",ref:c,tabindex:I.value,class:n.normalizeClass(["ui-dropdown",{open:p.open,error:L.error,disabled:L.disabled}]),onKeydown:Z,onFocusout:B},[n.createElementVNode("div",U0,[n.createElementVNode("div",j0,[n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":H[0]||(H[0]=oe=>p.search=oe),type:"text",tabindex:"-1",disabled:L.disabled,placeholder:k.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O},null,40,W0),[[n.vModelText,p.search]]),H[3]||(H[3]=n.createTextVNode()),p.open?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:z},[n.createVNode(Gd,{class:"input-value"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value),1)]),_:1})])),H[4]||(H[4]=n.createTextVNode()),n.createElementVNode("div",H0,[L.clearable&&S.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"icon-16 icon-clear",onClick:n.withModifiers(j,["stop"])})):n.createCommentVNode("",!0),H[1]||(H[1]=n.createTextVNode()),n.renderSlot(L.$slots,"append"),H[2]||(H[2]=n.createTextVNode()),L.arrowIconLarge?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["arrow-icon",[`icon-24 ${L.arrowIconLarge}`]]),onClick:n.withModifiers(W,["stop"])},null,2)):L.arrowIcon?(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["arrow-icon",[`icon-16 ${L.arrowIcon}`]]),onClick:n.withModifiers(W,["stop"])},null,2)):(n.openBlock(),n.createElementBlock("div",{key:3,class:"arrow-icon arrow-icon-default",onClick:n.withModifiers(W,["stop"])}))])]),H[8]||(H[8]=n.createTextVNode()),L.label?(n.openBlock(),n.createElementBlock("label",q0,[L.required?(n.openBlock(),n.createElementBlock("i",G0)):n.createCommentVNode("",!0),H[5]||(H[5]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(L.label),1),H[6]||(H[6]=n.createTextVNode()),n.unref(s).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(L.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),H[9]||(H[9]=n.createTextVNode()),p.open?(n.openBlock(),n.createElementBlock("div",{key:1,ref_key:"list",ref:d,class:"ui-dropdown__options"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(v.value,(oe,de)=>(n.openBlock(),n.createBlock(Qo,{key:de,option:oe,"is-selected":oe.isSelected,"is-hovered":oe.isActive,size:L.optionSize,onClick:n.withModifiers(ae=>K(oe.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),H[7]||(H[7]=n.createTextVNode()),v.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",K0,"Nothing found"))],512)):n.createCommentVNode("",!0),H[10]||(H[10]=n.createTextVNode()),n.createVNode(Yr,{class:"ui-dropdown__contour"})])],42,Z0),H[11]||(H[11]=n.createTextVNode()),R.value?(n.openBlock(),n.createElementBlock("div",Y0,n.toDisplayString(R.value),1)):L.helper?(n.openBlock(),n.createElementBlock("div",J0,n.toDisplayString(L.helper),1)):n.createCommentVNode("",!0)]))}}),Q0={name:"PlDropdownRef"},ew=n.defineComponent({...Q0,props:{modelValue:{},label:{default:""},options:{},helper:{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(i){const e=i,t=n.computed(()=>e.options.map(s=>({label:s.label,value:s.ref}))),a=n.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,c)=>(n.openBlock(),n.createBlock(n.unref(Xs),n.mergeProps(e,{options:t.value,"arrow-icon-large":a.value,"onUpdate:modelValue":c[0]||(c[0]=d=>s.$emit("update:modelValue",d))}),null,16,["options","arrow-icon-large"]))}});function tw(i,e){return n.computed(()=>{const t=Gr(i.value);return e.value?t.filter(a=>a.label.toLowerCase().includes(e.value.toLowerCase())):t})}const nw={class:"resizable-input"},rw=["placeholder","value","disabled"],iw=n.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(i,{emit:e}){const t=i,a=e,s=n.computed(()=>{var u;return t.placeholder?t.placeholder:(u=t.modelValue||t.value)==null?void 0:u.replace('"',"")}),c=n.computed(()=>{const u={};return t.width&&(u.width=t.width),t.maxWidth&&(u.maxWidth=t.maxWidth),u});function d(u){const p=u.target.value;a("update:modelValue",p)}return(u,p)=>(n.openBlock(),n.createElementBlock("div",nw,[n.createElementVNode("span",{style:n.normalizeStyle(c.value),class:"resizable-input__size-span"},n.toDisplayString(s.value),5),p[0]||(p[0]=n.createTextVNode()),n.createElementVNode("input",n.mergeProps(u.$attrs,{placeholder:u.placeholder,value:t.modelValue,disabled:t.disabled,style:c.value,onInput:d}),null,16,rw)]))}}),ow={class:"dropdown-tab-item__title text-caps13"},aw=n.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(i){const e=i,t=n.computed(()=>e.option.label),a=n.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,c)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([a.value,"dropdown-tab-item"])},[n.createElementVNode("div",ow,n.toDisplayString(t.value),1)],2))}}),sw={class:"ui-line-dropdown__prefix"},lw={class:"ui-line-dropdown__icon-wrapper"},cw={class:"ui-line-dropdown__icon"},dw={key:0,class:"ui-line-dropdown__no-item"},uw={key:0,class:"ui-line-dropdown__no-item"},Kd=n.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(i,{emit:e}){const t=e,a=i,s=n.reactive({isOpen:!1,activeOption:-1}),c=n.ref(),d=n.ref(),u=n.computed(()=>{const P=[];return s.isOpen&&P.push("open"),a.disabled&&P.push("disabled"),P.join(" ")}),p=n.ref(""),h=tw(n.toRef(a,"options"),p),g=n.computed(()=>!!(a.clearable&&s.isOpen&&a.modelValue&&x.value)),x=n.computed(()=>{if(a.modelValue){const P=C();if(P!==-1){const Z=Gr(a.options)[P];return typeof Z.label=="object"?Z.label.title:Z.label}}return""}),R=n.ref(x.value),T=n.computed(()=>s.isOpen&&p.value&&p.value.length>=x.value.length-1?p.value:x.value||"...");Jo(c,()=>{a.mode==="list"&&(s.isOpen=!1)}),n.watch(()=>R.value,P=>{x.value!==P?p.value=P:p.value=""}),n.watch(()=>s.isOpen,P=>{var Z;P&&c.value&&((Z=c.value.querySelector("input"))==null||Z.focus(),n.nextTick(()=>O()))}),n.watch(()=>a.modelValue,()=>k(),{immediate:!0});function C(){return a.options.findIndex(P=>en(P.value,a.modelValue))}function k(){s.activeOption=Yo(h.value.findIndex(P=>en(P.value,a.modelValue)),P=>P<0?0:P),R.value=x.value}function S(){p.value=""}function v(){a.disabled?s.isOpen=!1:n.nextTick(()=>{s.isOpen=!s.isOpen})}function I(){a.mode==="list"&&(s.isOpen=!1)}function K(P){P&&(t("update:modelValue",P.value),I(),S())}function j(P){return en(P.value,a.modelValue)}function z(P){var Z;(Z=c==null?void 0:c.value)!=null&&Z.contains(P.relatedTarget)||(s.isOpen=!1,p.value="")}function W(P){const{activeOption:Z}=s;if(!s.isOpen&&P.code==="Enter"){s.isOpen=!0;return}const{length:L}=h.value;if(!L)return;["ArrowDown","ArrowUp","Enter"].includes(P.code)&&P.preventDefault(),P.code==="Enter"&&K(h.value[Z]);const H=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(Z+H+L)%L,requestAnimationFrame(O)}function O(){const P=d.value;P&&at(P.querySelector(".hovered-item"),Z=>{a.mode==="list"?Xo(P,Z):Z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function B(){t("update:modelValue",void 0)}return(P,Z)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:c,tabindex:"0",class:n.normalizeClass([u.value,"ui-line-dropdown uc-pointer"]),onKeydown:W,onFocusout:z,onClick:v},[n.createElementVNode("div",sw,n.toDisplayString(a==null?void 0:a.prefix),1),Z[6]||(Z[6]=n.createTextVNode()),n.createVNode(iw,{modelValue:R.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>R.value=L),placeholder:T.value,disabled:a.disabled,class:"ui-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),Z[7]||(Z[7]=n.createTextVNode()),n.createElementVNode("div",lw,[n.withDirectives(n.createElementVNode("div",cw,null,512),[[n.vShow,!g.value]]),Z[1]||(Z[1]=n.createTextVNode()),n.withDirectives(n.createElementVNode("div",{class:"ui-line-dropdown__icon-clear",onClick:B},null,512),[[n.vShow,g.value]])]),Z[8]||(Z[8]=n.createTextVNode()),a.mode==="list"?n.withDirectives((n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"list",ref:d,class:"ui-line-dropdown__items"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(h),(L,H)=>n.renderSlot(P.$slots,"item",{key:H,item:L,textItem:"text",isSelected:j(L),isHovered:s.activeOption==H,onClick:n.withModifiers(oe=>K(L),["stop"])},()=>[n.createVNode(Qo,{option:L,"text-item":"text","is-selected":j(L),"is-hovered":s.activeOption==H,size:"medium",onClick:n.withModifiers(oe=>K(L),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),Z[3]||(Z[3]=n.createTextVNode()),n.unref(h).length===0?(n.openBlock(),n.createElementBlock("div",dw,Z[2]||(Z[2]=[n.createElementVNode("div",{class:"ui-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):n.createCommentVNode("",!0)],512)),[[n.vShow,s.isOpen]]):n.createCommentVNode("",!0),Z[9]||(Z[9]=n.createTextVNode()),a.mode==="tabs"?n.withDirectives((n.openBlock(),n.createElementBlock("div",{key:1,ref_key:"list",ref:d,style:n.normalizeStyle(a.tabsContainerStyles),class:"ui-line-dropdown__items-tabs"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(h),(L,H)=>n.renderSlot(P.$slots,"item",{key:H,item:L,isSelected:j(L),isHovered:s.activeOption==H,onClick:n.withModifiers(oe=>K(L),["stop"])},()=>[n.createVNode(aw,{option:L,"is-selected":j(L),"is-hovered":s.activeOption==H,onClick:n.withModifiers(oe=>K(L),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),Z[5]||(Z[5]=n.createTextVNode()),n.unref(h).length===0?(n.openBlock(),n.createElementBlock("div",uw,Z[4]||(Z[4]=[n.createElementVNode("div",{class:"ui-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):n.createCommentVNode("",!0)],4)),[[n.vShow,s.isOpen]]):n.createCommentVNode("",!0)],34))}}),fw={key:0,class:"ui-progress-bar"},pw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},hw={class:"ui-progress-bar__message flex-grow-1"},mw={class:"ui-progress-bar__percent"},gw=n.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(i){const e=i,t=n.computed(()=>e.progress===100?e.completeMessage:"");return(a,s)=>a.loading?(n.openBlock(),n.createElementBlock("div",fw,[n.createElementVNode("div",{class:"ui-progress-bar__indicator",style:n.normalizeStyle({width:a.progress+"%"})},null,4),s[1]||(s[1]=n.createTextVNode()),n.createElementVNode("div",pw,[n.createElementVNode("div",hw,n.toDisplayString(t.value),1),s[0]||(s[0]=n.createTextVNode()),n.createElementVNode("div",mw,n.toDisplayString(a.progress+"%"),1)])])):n.createCommentVNode("",!0)}}),yw={class:"mi-number-field__main-wrapper d-flex"},_w={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},ww={key:0,class:"text-description"},bw=["disabled","placeholder"],kw={class:"mi-number-field__icons d-flex-column"},xw={key:0,class:"mi-number-field__hint text-description"},vw=n.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(i,{emit:e}){const t=i,a=e,s=n.ref(),c=n.useSlots(),d=n.ref();vr(s);const u=n.ref(!0),p=n.computed({get(){return u.value&&t.modelValue!==void 0?new Number(t.modelValue).toString():""},set(v){var I;v=v.replace(/,/g,""),R(v)?(a("update:modelValue",+v),v.toString()!==((I=t.modelValue)==null?void 0:I.toString())&&+v===t.modelValue&&v[v.length-1]!=="."&&(u.value=!1,n.nextTick(()=>{u.value=!0}))):(v.trim()===""&&a("update:modelValue",void 0),u.value=!1,n.nextTick(()=>{u.value=!0}))}}),h=n.computed(()=>{let v=[];return t.errorMessage&&v.push(t.errorMessage),R(t.modelValue)?(t.minValue!==void 0&&t.modelValue!==void 0&&t.modelValue<t.minValue&&v.push(`Model value must be higher than ${t.minValue}`),t.maxValue!==void 0&&t.modelValue!==void 0&&t.modelValue>t.maxValue&&v.push(`Model value must be less than ${t.maxValue}`)):v.push("Model value is not a number."),v=[...v],v.join(" ")}),g=n.computed(()=>!!(t.maxValue&&t.modelValue!==void 0&&(t.modelValue||0)+t.step>t.maxValue)),x=n.computed(()=>!!(t.minValue&&t.modelValue!==void 0&&(t.modelValue||0)-t.step<t.minValue));function R(v){return v!==void 0?(v=v==null?void 0:v.toString(),!isNaN(+v)&&!isNaN(parseFloat(v))):!1}function T(){if(!g.value){let v=0;t.modelValue===void 0?v=t.minValue?t.minValue:0:v=+(t.modelValue||0)+t.step,p.value=v.toString()}}function C(){if(!x.value){let v=0;t.modelValue===void 0?v=0:v=+(t.modelValue||0)-t.step,p.value=t.minValue?Math.max(t.minValue,v).toString():v.toString()}}function k(v){["ArrowDown","ArrowUp"].includes(v.code)&&v.preventDefault(),v.code==="ArrowUp"?T():v.code==="ArrowDown"&&C()}const S=v=>{v.detail>1&&v.preventDefault()};return(v,I)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:s,class:n.normalizeClass([{error:!!h.value.trim(),disabled:v.disabled},"mi-number-field d-flex-column"]),onMousedown:S,onKeydown:I[1]||(I[1]=K=>k(K))},[n.createElementVNode("div",yw,[n.createVNode(Yr,{class:"mi-number-field__contour"}),I[6]||(I[6]=n.createTextVNode()),n.createElementVNode("div",_w,[v.label?(n.openBlock(),n.createElementBlock("label",ww,[n.createTextVNode(n.toDisplayString(v.label)+" ",1),n.unref(c).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(v.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),I[2]||(I[2]=n.createTextVNode()),n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":I[0]||(I[0]=K=>p.value=K),disabled:v.disabled,placeholder:v.placeholder,class:"text-s flex-grow"},null,8,bw),[[n.vModelText,p.value]])]),I[7]||(I[7]=n.createTextVNode()),n.createElementVNode("div",kw,[n.createElementVNode("div",{class:n.normalizeClass([{disabled:g.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:T},I[3]||(I[3]=[n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.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]=n.createTextVNode()),n.createElementVNode("div",{class:n.normalizeClass([{disabled:x.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:C},I[4]||(I[4]=[n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.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]=n.createTextVNode()),h.value.trim()?(n.openBlock(),n.createElementBlock("div",xw,n.toDisplayString(h.value),1)):n.createCommentVNode("",!0)],34))}}),Cw={class:"ui-chip__text"},Qs=n.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(i){const e=n.ref(),t=n.ref(!1);return n.onMounted(()=>{var a;e.value&&(t.value=((a=e.value)==null?void 0:a.clientWidth)>=256)}),(a,s)=>(n.openBlock(),n.createBlock(n.unref(Zt),{position:"top",class:"ui-chip-tooltip",delay:500},n.createSlots({default:n.withCtx(()=>[s[4]||(s[4]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"chip",ref:e,class:n.normalizeClass(["ui-chip",{small:a.small}])},[n.createElementVNode("div",Cw,[n.renderSlot(a.$slots,"default")]),s[3]||(s[3]=n.createTextVNode()),a.closeable?(n.openBlock(),n.createElementBlock("div",{key:0,tabindex:"0",class:"ui-chip__close",onKeydown:s[0]||(s[0]=n.withKeys(c=>a.$emit("close"),["enter"])),onClick:s[1]||(s[1]=n.withModifiers(c=>a.$emit("close"),["stop"]))},s[2]||(s[2]=[n.createElementVNode("div",{class:"ui-chip__close--icon"},null,-1)]),32)):n.createCommentVNode("",!0)],2)]),_:2},[t.value?{name:"tooltip",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),key:"0"}:void 0]),1024))}}),Ew={class:"ui-multi-dropdown__envelope"},Sw=["tabindex"],Tw={class:"ui-multi-dropdown__container"},Vw={class:"ui-multi-dropdown__field"},Nw=["disabled","placeholder"],Bw={class:"ui-multi-dropdown__append"},Ow={key:0},Aw={key:0,class:"required-icon"},Rw={class:"ui-multi-dropdown__open-chips-container"},Dw={key:0,class:"nothing-found"},Iw={key:0,class:"ui-multi-dropdown__error"},Mw={key:1,class:"ui-multi-dropdown__helper"},Pw={name:"PlDropdownMulti"},Lw=n.defineComponent({...Pw,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(i,{emit:e}){const t=e,a=O=>t("update:modelValue",O),s=n.useSlots(),c=i,d=n.ref(),u=n.ref(),p=n.ref(),h=n.reactive({search:"",activeOption:-1,open:!1}),g=n.computed(()=>Array.isArray(c.modelValue)?c.modelValue:[]),x=n.computed(()=>h.open&&c.modelValue.length>0?c.placeholder:c.modelValue.length>0?"":c.placeholder),R=n.computed(()=>Gr(c.options).filter(O=>Js(g.value,O.value))),T=n.computed(()=>{const O=n.unref(g),B=Gr(c.options);return(h.search?B.filter(P=>{const Z=h.search.toLowerCase();return P.label.toLowerCase().includes(Z)?!0:typeof P.value=="string"?P.value.toLowerCase().includes(Z):P.value===h.search}):[...B]).map(P=>({...P,selected:Js(O,P.value)}))}),C=n.computed(()=>c.disabled?void 0:"0"),k=()=>{h.activeOption=Yo(T.value.findIndex(O=>en(O.value,c.modelValue)),O=>O<0?0:O)},S=O=>{var B;const P=n.unref(g);a(Js(P,O)?P.filter(Z=>!en(Z,O)):[...P,O]),h.search="",(B=d==null?void 0:d.value)==null||B.focus()},v=O=>a(n.unref(g).filter(B=>!en(B,O))),I=()=>{var O;return(O=p.value)==null?void 0:O.focus()},K=()=>h.open=!h.open,j=O=>{var B;(B=d==null?void 0:d.value)!=null&&B.contains(O.relatedTarget)||(h.search="",h.open=!1)},z=()=>{const O=u.value;O&&at(O.querySelector(".hovered-item"),B=>{Xo(O,B)})},W=O=>{var B;const{open:P,activeOption:Z}=h;if(!P){O.code==="Enter"&&(h.open=!0);return}O.code==="Escape"&&(h.open=!1,(B=d.value)==null||B.focus());const L=n.unref(T),{length:H}=L;if(!H)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&S(L[Z].value);const oe=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(Z+oe+H)%H,requestAnimationFrame(z)};return vr(d),n.watch(()=>c.modelValue,()=>k(),{immediate:!0}),n.watchPostEffect(()=>{h.search,h.open&&z()}),(O,B)=>(n.openBlock(),n.createElementBlock("div",Ew,[n.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:C.value,class:n.normalizeClass(["ui-multi-dropdown",{open:h.open,error:O.error,disabled:O.disabled}]),onKeydown:W,onFocusout:j},[n.createElementVNode("div",Tw,[n.createElementVNode("div",Vw,[n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":B[0]||(B[0]=P=>h.search=P),type:"text",tabindex:"-1",disabled:O.disabled,placeholder:x.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:B[1]||(B[1]=P=>h.open=!0)},null,40,Nw),[[n.vModelText,h.search]]),B[3]||(B[3]=n.createTextVNode()),h.open?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:"chips-container",onClick:I},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(R.value,(P,Z)=>(n.openBlock(),n.createBlock(n.unref(Qs),{key:Z,closeable:"",small:"",onClick:B[2]||(B[2]=n.withModifiers(L=>h.open=!0,["stop"])),onClose:L=>v(P.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(P.label||P.value),1)]),_:2},1032,["onClose"]))),128))])),B[4]||(B[4]=n.createTextVNode()),n.createElementVNode("div",{class:"arrow",onClick:n.withModifiers(K,["stop"])}),B[5]||(B[5]=n.createTextVNode()),n.createElementVNode("div",Bw,[n.renderSlot(O.$slots,"append")])]),B[10]||(B[10]=n.createTextVNode()),O.label?(n.openBlock(),n.createElementBlock("label",Ow,[O.required?(n.openBlock(),n.createElementBlock("i",Aw)):n.createCommentVNode("",!0),B[6]||(B[6]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(O.label),1),B[7]||(B[7]=n.createTextVNode()),n.unref(s).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(O.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),B[11]||(B[11]=n.createTextVNode()),h.open?(n.openBlock(),n.createElementBlock("div",{key:1,ref_key:"list",ref:u,class:"ui-multi-dropdown__options"},[n.createElementVNode("div",Rw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(R.value,(P,Z)=>(n.openBlock(),n.createBlock(n.unref(Qs),{key:Z,closeable:"",small:"",onClose:L=>v(P.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(P.label||P.value),1)]),_:2},1032,["onClose"]))),128))]),B[8]||(B[8]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.value,(P,Z)=>(n.openBlock(),n.createBlock(Qo,{key:Z,option:P,"text-item":"text","is-selected":P.selected,"is-hovered":h.activeOption==Z,size:"medium","use-checkbox":"",onClick:n.withModifiers(L=>S(P.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),B[9]||(B[9]=n.createTextVNode()),T.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Dw,"Nothing found"))],512)):n.createCommentVNode("",!0),B[12]||(B[12]=n.createTextVNode()),n.createVNode(Yr,{class:"ui-multi-dropdown__contour"})])],42,Sw),B[13]||(B[13]=n.createTextVNode()),O.error?(n.openBlock(),n.createElementBlock("div",Iw,n.toDisplayString(O.error),1)):O.helper?(n.openBlock(),n.createElementBlock("div",Mw,n.toDisplayString(O.helper),1)):n.createCommentVNode("",!0)]))}}),el=n.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i){const e=i,t=n.computed(()=>e.modelValue);return(a,s)=>(n.openBlock(),n.createElementBlock("div",{tabindex:"0",class:n.normalizeClass(["pl-checkbox-base",{checked:t.value,disabled:a.disabled}]),onClick:s[0]||(s[0]=c=>a.$emit("update:modelValue",!a.modelValue)),onKeydown:s[1]||(s[1]=n.withKeys(c=>a.$emit("update:modelValue",!a.modelValue),["enter"]))},null,34))}}),Fw={name:"PlCheckbox"},$w=n.defineComponent({...Fw,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i){const e=i,t=n.useSlots();return(a,s)=>n.unref(t).default?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["pl-checkbox",{disabled:a.disabled}])},[n.createVNode(el,n.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=c=>a.$emit("update:modelValue",c))}),null,16),s[3]||(s[3]=n.createTextVNode()),n.createElementVNode("label",{onClick:s[1]||(s[1]=c=>a.$emit("update:modelValue",!a.$props.modelValue))},[n.renderSlot(a.$slots,"default")])],2)):(n.openBlock(),n.createBlock(el,n.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=c=>a.$emit("update:modelValue",c))}),null,16))}}),zw={key:0},Zw=["onClick"],Uw={name:"PlCheckboxGroup"},jw=n.defineComponent({...Uw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=e,a=i,s=d=>a.modelValue.includes(d),c=d=>{const u=a.modelValue??[];t("update:modelValue",s(d)?u.filter(p=>p!==d):[...u,d])};return(d,u)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["ui-checkbox-group",{disabled:d.disabled}])},[d.label?(n.openBlock(),n.createElementBlock("label",zw,n.toDisplayString(d.label),1)):n.createCommentVNode("",!0),u[1]||(u[1]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,h)=>(n.openBlock(),n.createElementBlock("div",{key:h},[n.createVNode(el,{disabled:d.disabled,label:p.label,"model-value":s(p.value),"onUpdate:modelValue":()=>c(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=n.createTextVNode()),n.createElementVNode("label",{onClick:n.withModifiers(()=>c(p.value),["stop"])},n.toDisplayString(p.label),9,Zw)]))),128))],2))}}),Ww={key:1,class:"pl-dialog-modal__title"},Hw={key:2,class:"pl-dialog-modal__actions"},qw={inheritAttrs:!1},Yd=n.defineComponent({...qw,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},type:{default:"A"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.ref(),d=n.useAttrs();function u(p){c.value&&document.contains(p.target)&&!c.value.contains(p.target)&&a("update:modelValue",!1)}return Ge(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&a("update:modelValue",!1)}),(p,h)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,{name:"dialog"},{default:n.withCtx(()=>[p.modelValue?(n.openBlock(),n.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[n.createElementVNode("div",n.mergeProps(n.unref(d),{ref_key:"modal",ref:c,class:["pl-dialog-modal",[p.type,n.unref(t).title?"has-title":""]],style:{width:p.width,height:p.height,minHeight:p.minHeight}}),[p.closable?(n.openBlock(),n.createElementBlock("div",{key:0,class:"close-dialog-btn",onClick:h[0]||(h[0]=n.withModifiers(g=>a("update:modelValue",!1),["stop"]))})):n.createCommentVNode("",!0),h[1]||(h[1]=n.createTextVNode()),n.unref(t).title?(n.openBlock(),n.createElementBlock("div",Ww,[n.renderSlot(p.$slots,"title")])):n.createCommentVNode("",!0),h[2]||(h[2]=n.createTextVNode()),n.createElementVNode("div",{class:n.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters}])},[n.renderSlot(p.$slots,"default")],2),h[3]||(h[3]=n.createTextVNode()),n.unref(t).actions?(n.openBlock(),n.createElementBlock("div",Hw,[n.renderSlot(p.$slots,"actions")])):n.createCommentVNode("",!0)],16)])):n.createCommentVNode("",!0)]),_:3})]))}}),Gw=n.defineComponent({__name:"TransitionSlidePanel",setup(i){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function t(){window.dispatchEvent(new CustomEvent("adjust"))}return(a,s)=>(n.openBlock(),n.createBlock(n.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:t},{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3}))}}),Kw={key:0,class:"pl-slide-modal__title"},Yw={class:"pl-slide-modal__content"},Jw={key:1,class:"pl-slide-modal__actions"},Xw={name:"PlSlideModal",inheritAttrs:!1},Qw=n.defineComponent({...Xw,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.ref(),d=n.useAttrs();return Jo(c,()=>{s.modelValue&&s.closeOnOutsideClick&&a("update:modelValue",!1)}),Ge(document,"keydown",u=>{u.key==="Escape"&&a("update:modelValue",!1)}),(u,p)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(Gw,null,{default:n.withCtx(()=>[u.modelValue?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,ref_key:"modal",ref:c,style:{width:u.width}},n.unref(d),{class:["pl-slide-modal",{"has-title":n.unref(t).title,"has-actions":n.unref(t).actions}],onKeyup:p[1]||(p[1]=n.withKeys(h=>a("update:modelValue",!1),["esc"]))}),[n.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=h=>a("update:modelValue",!1))}),p[3]||(p[3]=n.createTextVNode()),n.unref(t).title?(n.openBlock(),n.createElementBlock("div",Kw,[n.renderSlot(u.$slots,"title")])):n.createCommentVNode("",!0),p[4]||(p[4]=n.createTextVNode()),n.createElementVNode("div",Yw,[n.renderSlot(u.$slots,"default")]),p[5]||(p[5]=n.createTextVNode()),n.unref(t).actions?(n.openBlock(),n.createElementBlock("div",Jw,[n.renderSlot(u.$slots,"actions")])):n.createCommentVNode("",!0)],16)):n.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=n.createTextVNode()),u.modelValue&&u.shadow?(n.openBlock(),n.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=n.withKeys(h=>a("update:modelValue",!1),["esc"]))},null,32)):n.createCommentVNode("",!0)]))}}),eb={key:0,class:"label"},tb={name:"PlToggleSwitch"},nb=n.defineComponent({...tb,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(i){return(e,t)=>(n.openBlock(),n.createElementBlock("div",{tabindex:"0",class:n.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:t[0]||(t[0]=a=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:t[1]||(t[1]=n.withKeys(a=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[t[2]||(t[2]=n.createElementVNode("div",{class:"ui-toggle-switch__body"},[n.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),t[3]||(t[3]=n.createTextVNode()),e.label?(n.openBlock(),n.createElementBlock("span",eb,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0)],34))}}),Cr=n.defineComponent({__name:"MaskIcon24",props:{name:{},size:{}},setup(i){const e=i,t=n.computed(()=>`mask-24 mask-${e.name}`);return(a,s)=>(n.openBlock(),n.createElementBlock("i",{class:n.normalizeClass(t.value)},null,2))}}),rb={key:0,class:"pl-log-view__error"},ib={name:"PlLogView"},ob=n.defineComponent({...ib,props:{value:{},error:{},output:{}},setup(i){const e=p=>{if(p&&p.ok===!1)return p.errors.join(`
9
+ `)},t=i,a=n.ref(),s=n.computed(()=>t.error??e(t.output)),c=n.computed(()=>t.value??pd(t.output)),d=()=>{t.value&&navigator.clipboard.writeText(t.value)},u=()=>{Gn(a.value,p=>{p.clientHeight+p.scrollTop+100>p.scrollHeight&&p.scrollTo(p.scrollLeft,p.scrollHeight)})};return n.onMounted(u),n.onUpdated(u),(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["pl-log-view",{"has-error":s.value}])},[n.createVNode(Cr,{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:d}),h[0]||(h[0]=n.createTextVNode()),s.value?(n.openBlock(),n.createElementBlock("div",rb,n.toDisplayString(s.value),1)):(n.openBlock(),n.createElementBlock("div",{key:1,ref_key:"contentRef",ref:a,class:"pl-log-view__content"},n.toDisplayString(c.value),513))],2))}});function ab(i){const e=i.split("/"),t=[];for(let a=0;a<e.length;a++)t.push({index:a,name:a===0?"Root":e[a],path:e.slice(0,a+1).join("/")});return t}const sb={class:"file-dialog"},lb={class:"file-dialog__search"},cb={class:"ls-container"},db={class:"ls-head"},ub={class:"ls-head__breadcrumbs"},fb=["title","onClick"],pb={key:0,class:"icon-16 icon-chevron-right"},hb={class:"d-flex ml-auto align-center gap-12"},mb={class:"ls-head__selected"},gb={key:0,class:"ls-loader"},yb={key:1,class:"ls-empty"},_b={key:2,class:"ls-error"},wb={class:"ls-error__message"},bb={key:3,class:"ls-body"},kb=["onClick"],xb=["title"],vb=["onClick"],Cb=["title"],Jd=n.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(i,{emit:e}){const t=e,a=i,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),c=n.reactive(s()),d=n.computed(()=>c.showHiddenItems?c.items:c.items.filter(O=>!O.name.startsWith("."))),u=n.computed(()=>{var O;return{modelValue:a.modelValue,dirPath:c.dirPath,storageHandle:(O=c.storageEntry)==null?void 0:O.handle}}),p=(O,B)=>{window.platforma&&c.currentLoadingPath!==B&&(c.error="",c.items=[],c.lastSelected=void 0,c.currentLoadingPath=B,window.platforma.lsDriver.listFiles(O,B).then(P=>{B===c.dirPath&&(c.items=Ts(P).entries.map(Z=>({path:Z.fullPath,name:Z.name,isDir:Z.type==="dir",canBeSelected:Z.type==="file"&&(!a.extensions||a.extensions.some(L=>Z.fullPath.endsWith(L))),handle:Z.type==="file"?Z.handle:void 0,selected:!1})).sort((Z,L)=>Z.isDir&&!L.isDir?-1:!Z.isDir&&L.isDir?1:Z.name.localeCompare(L.name)).map((Z,L)=>({id:L,...Z})),c.lastSelected=void 0)}).catch(P=>c.error=String(P)).finally(()=>{c.currentLoadingPath=void 0}))},h=()=>{const{storageHandle:O,dirPath:B,modelValue:P}=u.value;O&&P&&p(O,B)},g=wd(O=>{O&&(c.dirPath=O)},1e3),x=n.computed(()=>ab(c.dirPath)),R=n.computed(()=>c.items.filter(O=>O.canBeSelected&&O.selected&&!O.isDir)),T=n.computed(()=>R.value.length>0),C=()=>{t("update:modelValue",!1)},k=()=>{var O;T.value&&(O=c.storageEntry)!=null&&O.handle&&(t("import:files",{storageHandle:c.storageEntry.handle,files:R.value.map(B=>B.handle)}),C())},S=O=>{c.dirPath=O,c.storageEntry&&h()},v=(O,B)=>{const{shiftKey:P,metaKey:Z}=O,{lastSelected:L}=c;if(O.preventDefault(),B.canBeSelected){if(a.multi||c.items.forEach(H=>H.selected=!1),B.selected=!0,!a.multi)return;!Z&&!P&&c.items.forEach(H=>{H.id!==B.id&&(H.selected=!1)}),P&&L!==void 0&&c.items.forEach(H=>{cd(H.id,L,B.id)&&(H.selected=!0)}),B.selected&&(c.lastSelected=B.id)}},I=O=>{O&&!a.multi||c.items.filter(B=>B.canBeSelected).forEach(B=>{B.selected=O})},K=()=>I(!0),j=()=>I(!1),z=()=>{if(c.error="",c.lastSelected=void 0,j(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(O=>{c.storageOptions=O.map(B=>({text:B.name,value:B})),a.autoSelectStorage&&Gn(O.find(B=>B.isInitialPathHome),B=>{c.storageEntry=B,c.dirPath=B.initialFullPath})}).catch(O=>c.error=String(O))};n.watch(n.toRef(c,"storageEntry"),O=>{c.dirPath=(O==null?void 0:O.initialFullPath)??""}),n.watch([()=>c.dirPath,()=>c.storageEntry],()=>{h()}),n.watch(()=>a.modelValue,O=>{O?z():Object.assign(c,s())},{immediate:!0}),Ge(document,"keydown",O=>{a.modelValue&&O.target===document.body&&(O.metaKey&&O.code==="KeyA"&&(O.preventDefault(),K()),O.metaKey&&O.shiftKey&&O.code==="Period"&&(O.preventDefault(),c.showHiddenItems=!c.showHiddenItems),O.code==="Enter"&&k())}),n.onUpdated(z);const W={mounted:O=>{if(O.clientWidth<O.scrollWidth){const B=O.innerText;O.innerText=B.substring(0,57)+"..."+B.substring(B.length-10)}}};return(O,B)=>(n.openBlock(),n.createBlock(n.unref(Yd),{"no-content-gutters":!0,class:"split","model-value":O.modelValue,width:"688px",height:"720px","onUpdate:modelValue":C,onClick:n.withModifiers(j,["stop"])},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(O.title??"Select files"),1)]),actions:n.withCtx(()=>[n.createVNode(n.unref(Md),{style:{"min-width":"160px"},disabled:!T.value,onClick:n.withModifiers(k,["stop"])},{default:n.withCtx(()=>B[14]||(B[14]=[n.createTextVNode("Import")])),_:1},8,["disabled"]),B[16]||(B[16]=n.createTextVNode()),n.createVNode(n.unref(Pd),{"justify-center":!1,onClick:n.withModifiers(C,["stop"])},{default:n.withCtx(()=>B[15]||(B[15]=[n.createTextVNode("Cancel")])),_:1})]),default:n.withCtx(()=>[B[17]||(B[17]=n.createTextVNode()),n.createElementVNode("div",sb,[n.createElementVNode("div",lb,[n.createVNode(n.unref(Xs),{modelValue:c.storageEntry,"onUpdate:modelValue":B[0]||(B[0]=P=>c.storageEntry=P),label:"Select storage",options:c.storageOptions},null,8,["modelValue","options"]),B[1]||(B[1]=n.createTextVNode()),n.createVNode(n.unref(jd),{"model-value":c.dirPath,label:"Enter path","onUpdate:modelValue":n.unref(g)},null,8,["model-value","onUpdate:modelValue"])]),B[13]||(B[13]=n.createTextVNode()),n.createElementVNode("div",cb,[n.createElementVNode("div",db,[n.createElementVNode("div",ub,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(x.value,(P,Z)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:Z},[n.createElementVNode("div",{title:P.path,onClick:L=>S(P.path)},n.toDisplayString(P.name),9,fb),B[2]||(B[2]=n.createTextVNode()),P.index!==x.value.length-1?(n.openBlock(),n.createElementBlock("i",pb)):n.createCommentVNode("",!0)],64))),128))]),B[3]||(B[3]=n.createTextVNode()),n.createElementVNode("div",hb,[n.createElementVNode("span",mb,"Selected: "+n.toDisplayString(R.value.length),1)])]),B[12]||(B[12]=n.createTextVNode()),c.currentLoadingPath!==void 0?(n.openBlock(),n.createElementBlock("div",gb,B[4]||(B[4]=[n.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):c.storageEntry?c.error?(n.openBlock(),n.createElementBlock("div",_b,[B[6]||(B[6]=n.createElementVNode("div",{class:"ls-error__cat"},null,-1)),B[7]||(B[7]=n.createTextVNode()),n.createElementVNode("div",wb,n.toDisplayString(c.error),1)])):(n.openBlock(),n.createElementBlock("div",bb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,P=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:P.id},[P.isDir?(n.openBlock(),n.createElementBlock("div",{key:0,class:"isDir",onClick:Z=>S(P.path)},[B[8]||(B[8]=n.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),B[9]||(B[9]=n.createTextVNode()),n.withDirectives((n.openBlock(),n.createElementBlock("span",{title:P.name},[n.createTextVNode(n.toDisplayString(P.name),1)],8,xb)),[[W]])],8,kb)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass({canBeSelected:P.canBeSelected,selected:P.selected}),onClick:n.withModifiers(Z=>v(Z,P),["stop"])},[B[10]||(B[10]=n.createElementVNode("i",{class:"mask-16 mask-comp isFile"},null,-1)),B[11]||(B[11]=n.createTextVNode()),n.withDirectives((n.openBlock(),n.createElementBlock("span",{title:P.name},[n.createTextVNode(n.toDisplayString(P.name),1)],8,Cb)),[[W]])],10,vb))],64))),128))])):(n.openBlock(),n.createElementBlock("div",yb,B[5]||(B[5]=[n.createElementVNode("div",{class:"ls-empty__cat"},null,-1),n.createTextVNode(),n.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),B[18]||(B[18]=n.createTextVNode())]),_:1},8,["model-value"]))}});var Ie;(function(i){i.assertEqual=s=>s;function e(s){}i.assertIs=e;function t(s){throw new Error}i.assertNever=t,i.arrayToEnum=s=>{const c={};for(const d of s)c[d]=d;return c},i.getValidEnumValues=s=>{const c=i.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),d={};for(const u of c)d[u]=s[u];return i.objectValues(d)},i.objectValues=s=>i.objectKeys(s).map(function(c){return s[c]}),i.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const c=[];for(const d in s)Object.prototype.hasOwnProperty.call(s,d)&&c.push(d);return c},i.find=(s,c)=>{for(const d of s)if(c(d))return d},i.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,c=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(c)}i.joinValues=a,i.jsonStringifyReplacer=(s,c)=>typeof c=="bigint"?c.toString():c})(Ie||(Ie={}));var tl;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(tl||(tl={}));const ne=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yn=i=>{switch(typeof i){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(i)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(i)?ne.array:i===null?ne.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ne.promise:typeof Map<"u"&&i instanceof Map?ne.map:typeof Set<"u"&&i instanceof Set?ne.set:typeof Date<"u"&&i instanceof Date?ne.date:ne.object;default:return ne.unknown}},G=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"]),Eb=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(c){return c.message},a={_errors:[]},s=c=>{for(const d of c.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)a._errors.push(t(d));else{let u=a,p=0;for(;p<d.path.length;){const h=d.path[p];p===d.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(d))):u[h]=u[h]||{_errors:[]},u=u[h],p++}}};return s(this),a}static assert(e){if(!(e instanceof Ot))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=t=>t.message){const t={},a=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}Ot.create=i=>new Ot(i);const Jr=(i,e)=>{let t;switch(i.code){case G.invalid_type:i.received===ne.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case G.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,Ie.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ie.joinValues(i.keys,", ")}`;break;case G.invalid_union:t="Invalid input";break;case G.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ie.joinValues(i.options)}`;break;case G.invalid_enum_value:t=`Invalid enum value. Expected ${Ie.joinValues(i.options)}, received '${i.received}'`;break;case G.invalid_arguments:t="Invalid function arguments";break;case G.invalid_return_type:t="Invalid function return type";break;case G.invalid_date:t="Invalid date";break;case G.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:Ie.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case G.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case G.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case G.custom:t="Invalid input";break;case G.invalid_intersection_types:t="Intersection results could not be merged";break;case G.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case G.not_finite:t="Number must be finite";break;default:t=e.defaultError,Ie.assertNever(i)}return{message:t}};let Xd=Jr;function Sb(i){Xd=i}function ea(){return Xd}const ta=i=>{const{data:e,path:t,errorMaps:a,issueData:s}=i,c=[...t,...s.path||[]],d={...s,path:c};if(s.message!==void 0)return{...s,path:c,message:s.message};let u="";const p=a.filter(h=>!!h).slice().reverse();for(const h of p)u=h(d,{data:e,defaultError:u}).message;return{...s,path:c,message:u}},Tb=[];function ee(i,e){const t=ea(),a=ta({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===Jr?void 0:Jr].filter(s=>!!s)});i.common.issues.push(a)}class pt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const s of t){const c=await s.key,d=await s.value;a.push({key:c,value:d})}return pt.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:c,value:d}=s;if(c.status==="aborted"||d.status==="aborted")return _e;c.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),c.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(a[c.value]=d.value)}return{status:e.value,value:a}}}const _e=Object.freeze({status:"aborted"}),na=i=>({status:"dirty",value:i}),wt=i=>({status:"valid",value:i}),nl=i=>i.status==="aborted",rl=i=>i.status==="dirty",Hi=i=>i.status==="valid",qi=i=>typeof Promise<"u"&&i instanceof Promise;function ra(i,e,t,a){if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(i)}function Qd(i,e,t,a,s){if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(i,t),t}var ce;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));var Gi,Ki;class xn{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 eu=(i,e)=>{if(Hi(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Ot(i.common.issues);return this._error=t,this._error}}};function ve(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:s}=i;if(e&&(t||a))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,d)=>{var u,p;const{message:h}=i;return c.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:(u=h??a)!==null&&u!==void 0?u:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(p=h??t)!==null&&p!==void 0?p:d.defaultError}},description:s}}class Te{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 Yn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pt,ctx:{common:e.parent.common,data:e.data,parsedType:Yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(qi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const s={common:{issues:[],async:(a=t==null?void 0:t.async)!==null&&a!==void 0?a:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yn(e)},c=this._parseSync({data:e,path:s.path,parent:s});return eu(s,c)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yn(e)},s=this._parse({data:e,path:a.path,parent:a}),c=await(qi(s)?s:Promise.resolve(s));return eu(a,c)}refine(e,t){const a=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,c)=>{const d=e(s),u=()=>c.addIssue({code:G.custom,...a(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,t){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof t=="function"?t(a,s):t),!1))}_refinement(e){return new rn({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Cn.create(this,this._def)}nullable(){return tr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nn.create(this,this._def)}promise(){return ti.create(this,this._def)}or(e){return Qi.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new rn({...ve(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new oo({...ve(this._def),innerType:this,defaultValue:t,typeName:ge.ZodDefault})}brand(){return new al({typeName:ge.ZodBranded,type:this,...ve(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ao({...ve(this._def),innerType:this,catchValue:t,typeName:ge.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return so.create(this,e)}readonly(){return lo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vb=/^c[^\s-]{8,}$/i,Nb=/^[0-9a-z]+$/,Bb=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ob=/^[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,Ab=/^[a-z0-9_-]{21}$/i,Rb=/^[-+]?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)?)??$/,Db=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ib="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let il;const Mb=/^(?:(?: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])$/,Pb=/^(([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})))$/,Lb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tu="((\\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])))",Fb=new RegExp(`^${tu}$`);function nu(i){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`),e}function $b(i){return new RegExp(`^${nu(i)}$`)}function ru(i){let e=`${tu}T${nu(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function zb(i,e){return!!((e==="v4"||!e)&&Mb.test(i)||(e==="v6"||!e)&&Pb.test(i))}class tn extends Te{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ne.string){const s=this._getOrReturnCtx(e);return ee(s,{code:G.invalid_type,expected:ne.string,received:s.parsedType}),_e}const t=new pt;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if(s.kind==="length"){const c=e.data.length>s.value,d=e.data.length<s.value;(c||d)&&(a=this._getOrReturnCtx(e,a),c?ee(a,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&ee(a,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if(s.kind==="email")Db.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"email",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="emoji")il||(il=new RegExp(Ib,"u")),il.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"emoji",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="uuid")Ob.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"uuid",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="nanoid")Ab.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"nanoid",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="cuid")Vb.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"cuid",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="cuid2")Nb.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"cuid2",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="ulid")Bb.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"ulid",code:G.invalid_string,message:s.message}),t.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),ee(a,{validation:"url",code:G.invalid_string,message:s.message}),t.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"regex",code:G.invalid_string,message:s.message}),t.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),ee(a,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.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)||(a=this._getOrReturnCtx(e,a),ee(a,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),ee(a,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):s.kind==="datetime"?ru(s).test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{code:G.invalid_string,validation:"datetime",message:s.message}),t.dirty()):s.kind==="date"?Fb.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{code:G.invalid_string,validation:"date",message:s.message}),t.dirty()):s.kind==="time"?$b(s).test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{code:G.invalid_string,validation:"time",message:s.message}),t.dirty()):s.kind==="duration"?Rb.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"duration",code:G.invalid_string,message:s.message}),t.dirty()):s.kind==="ip"?zb(e.data,s.version)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"ip",code:G.invalid_string,message:s.message}),t.dirty()):s.kind==="base64"?Lb.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"base64",code:G.invalid_string,message:s.message}),t.dirty()):Ie.assertNever(s);return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement(s=>e.test(s),{validation:t,code:G.invalid_string,...ce.errToObj(a)})}_addCheck(e){return new tn({...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 t,a;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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!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,t){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...ce.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ce.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ce.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ce.errToObj(t)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new tn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new tn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new tn({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}tn.create=i=>{var e;return new tn({checks:[],typeName:ge.ZodString,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...ve(i)})};function Zb(i,e){const t=(i.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=t>a?t:a,c=parseInt(i.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return c%d/Math.pow(10,s)}class Jn extends Te{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)!==ne.number){const s=this._getOrReturnCtx(e);return ee(s,{code:G.invalid_type,expected:ne.number,received:s.parsedType}),_e}let t;const a=new pt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ee(t,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),ee(t,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),ee(t,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Zb(e.data,s.value)!==0&&(t=this._getOrReturnCtx(e,t),ee(t,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ee(t,{code:G.not_finite,message:s.message}),a.dirty()):Ie.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ce.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ce.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ce.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ce.toString(t))}setLimit(e,t,a,s){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:ce.toString(s)}]})}_addCheck(e){return new Jn({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(t)})}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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.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,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Jn.create=i=>new Jn({checks:[],typeName:ge.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...ve(i)});class Xn extends Te{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)!==ne.bigint){const s=this._getOrReturnCtx(e);return ee(s,{code:G.invalid_type,expected:ne.bigint,received:s.parsedType}),_e}let t;const a=new pt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),ee(t,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),ee(t,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),ee(t,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):Ie.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ce.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ce.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ce.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ce.toString(t))}setLimit(e,t,a,s){return new Xn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:ce.toString(s)}]})}_addCheck(e){return new Xn({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Xn.create=i=>{var e;return new Xn({checks:[],typeName:ge.ZodBigInt,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...ve(i)})};class Yi extends Te{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ne.boolean){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.boolean,received:t.parsedType}),_e}return wt(e.data)}}Yi.create=i=>new Yi({typeName:ge.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...ve(i)});class Er extends Te{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ne.date){const s=this._getOrReturnCtx(e);return ee(s,{code:G.invalid_type,expected:ne.date,received:s.parsedType}),_e}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ee(s,{code:G.invalid_date}),_e}const t=new pt;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):Ie.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ce.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Er.create=i=>new Er({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:ge.ZodDate,...ve(i)});class ia extends Te{_parse(e){if(this._getType(e)!==ne.symbol){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.symbol,received:t.parsedType}),_e}return wt(e.data)}}ia.create=i=>new ia({typeName:ge.ZodSymbol,...ve(i)});class Ji extends Te{_parse(e){if(this._getType(e)!==ne.undefined){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.undefined,received:t.parsedType}),_e}return wt(e.data)}}Ji.create=i=>new Ji({typeName:ge.ZodUndefined,...ve(i)});class Xi extends Te{_parse(e){if(this._getType(e)!==ne.null){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.null,received:t.parsedType}),_e}return wt(e.data)}}Xi.create=i=>new Xi({typeName:ge.ZodNull,...ve(i)});class Xr extends Te{constructor(){super(...arguments),this._any=!0}_parse(e){return wt(e.data)}}Xr.create=i=>new Xr({typeName:ge.ZodAny,...ve(i)});class Sr extends Te{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wt(e.data)}}Sr.create=i=>new Sr({typeName:ge.ZodUnknown,...ve(i)});class On extends Te{_parse(e){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.never,received:t.parsedType}),_e}}On.create=i=>new On({typeName:ge.ZodNever,...ve(i)});class oa extends Te{_parse(e){if(this._getType(e)!==ne.undefined){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.void,received:t.parsedType}),_e}return wt(e.data)}}oa.create=i=>new oa({typeName:ge.ZodVoid,...ve(i)});class nn extends Te{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==ne.array)return ee(t,{code:G.invalid_type,expected:ne.array,received:t.parsedType}),_e;if(s.exactLength!==null){const d=t.data.length>s.exactLength.value,u=t.data.length<s.exactLength.value;(d||u)&&(ee(t,{code:d?G.too_big:G.too_small,minimum:u?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(ee(t,{code:G.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(ee(t,{code:G.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((d,u)=>s.type._parseAsync(new xn(t,d,t.path,u)))).then(d=>pt.mergeArray(a,d));const c=[...t.data].map((d,u)=>s.type._parseSync(new xn(t,d,t.path,u)));return pt.mergeArray(a,c)}get element(){return this._def.type}min(e,t){return new nn({...this._def,minLength:{value:e,message:ce.toString(t)}})}max(e,t){return new nn({...this._def,maxLength:{value:e,message:ce.toString(t)}})}length(e,t){return new nn({...this._def,exactLength:{value:e,message:ce.toString(t)}})}nonempty(e){return this.min(1,e)}}nn.create=(i,e)=>new nn({type:i,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...ve(e)});function Qr(i){if(i instanceof Ke){const e={};for(const t in i.shape){const a=i.shape[t];e[t]=Cn.create(Qr(a))}return new Ke({...i._def,shape:()=>e})}else return i instanceof nn?new nn({...i._def,type:Qr(i.element)}):i instanceof Cn?Cn.create(Qr(i.unwrap())):i instanceof tr?tr.create(Qr(i.unwrap())):i instanceof vn?vn.create(i.items.map(e=>Qr(e))):i}class Ke extends Te{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(),t=Ie.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ne.object){const p=this._getOrReturnCtx(e);return ee(p,{code:G.invalid_type,expected:ne.object,received:p.parsedType}),_e}const{status:t,ctx:a}=this._processInputParams(e),{shape:s,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof On&&this._def.unknownKeys==="strip"))for(const p in a.data)c.includes(p)||d.push(p);const u=[];for(const p of c){const h=s[p],g=a.data[p];u.push({key:{status:"valid",value:p},value:h._parse(new xn(a,g,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof On){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of d)u.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(p==="strict")d.length>0&&(ee(a,{code:G.unrecognized_keys,keys:d}),t.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of d){const g=a.data[h];u.push({key:{status:"valid",value:h},value:p._parse(new xn(a,g,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of u){const g=await h.key,x=await h.value;p.push({key:g,value:x,alwaysSet:h.alwaysSet})}return p}).then(p=>pt.mergeObjectSync(t,p)):pt.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var s,c,d,u;const p=(d=(c=(s=this._def).errorMap)===null||c===void 0?void 0:c.call(s,t,a).message)!==null&&d!==void 0?d:a.defaultError;return t.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,t){return this.augment({[e]:t})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const t={};return Ie.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])}),new Ke({...this._def,shape:()=>t})}omit(e){const t={};return Ie.objectKeys(this.shape).forEach(a=>{e[a]||(t[a]=this.shape[a])}),new Ke({...this._def,shape:()=>t})}deepPartial(){return Qr(this)}partial(e){const t={};return Ie.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];e&&!e[a]?t[a]=s:t[a]=s.optional()}),new Ke({...this._def,shape:()=>t})}required(e){const t={};return Ie.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])t[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof Cn;)s=s._def.innerType;t[a]=s}}),new Ke({...this._def,shape:()=>t})}keyof(){return iu(Ie.objectKeys(this.shape))}}Ke.create=(i,e)=>new Ke({shape:()=>i,unknownKeys:"strip",catchall:On.create(),typeName:ge.ZodObject,...ve(e)}),Ke.strictCreate=(i,e)=>new Ke({shape:()=>i,unknownKeys:"strict",catchall:On.create(),typeName:ge.ZodObject,...ve(e)}),Ke.lazycreate=(i,e)=>new Ke({shape:i,unknownKeys:"strip",catchall:On.create(),typeName:ge.ZodObject,...ve(e)});class Qi extends Te{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function s(c){for(const u of c)if(u.result.status==="valid")return u.result;for(const u of c)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;const d=c.map(u=>new Ot(u.ctx.common.issues));return ee(t,{code:G.invalid_union,unionErrors:d}),_e}if(t.common.async)return Promise.all(a.map(async c=>{const d={...t,common:{...t.common,issues:[]},parent:null};return{result:await c._parseAsync({data:t.data,path:t.path,parent:d}),ctx:d}})).then(s);{let c;const d=[];for(const p of a){const h={...t,common:{...t.common,issues:[]},parent:null},g=p._parseSync({data:t.data,path:t.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!c&&(c={result:g,ctx:h}),h.common.issues.length&&d.push(h.common.issues)}if(c)return t.common.issues.push(...c.ctx.common.issues),c.result;const u=d.map(p=>new Ot(p));return ee(t,{code:G.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}Qi.create=(i,e)=>new Qi({options:i,typeName:ge.ZodUnion,...ve(e)});const Qn=i=>i instanceof no?Qn(i.schema):i instanceof rn?Qn(i.innerType()):i instanceof ro?[i.value]:i instanceof er?i.options:i instanceof io?Ie.objectValues(i.enum):i instanceof oo?Qn(i._def.innerType):i instanceof Ji?[void 0]:i instanceof Xi?[null]:i instanceof Cn?[void 0,...Qn(i.unwrap())]:i instanceof tr?[null,...Qn(i.unwrap())]:i instanceof al||i instanceof lo?Qn(i.unwrap()):i instanceof ao?Qn(i._def.innerType):[];class aa extends Te{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ne.object)return ee(t,{code:G.invalid_type,expected:ne.object,received:t.parsedType}),_e;const a=this.discriminator,s=t.data[a],c=this.optionsMap.get(s);return c?t.common.async?c._parseAsync({data:t.data,path:t.path,parent:t}):c._parseSync({data:t.data,path:t.path,parent:t}):(ee(t,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const c of t){const d=Qn(c.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,c)}}return new aa({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...ve(a)})}}function ol(i,e){const t=Yn(i),a=Yn(e);if(i===e)return{valid:!0,data:i};if(t===ne.object&&a===ne.object){const s=Ie.objectKeys(e),c=Ie.objectKeys(i).filter(u=>s.indexOf(u)!==-1),d={...i,...e};for(const u of c){const p=ol(i[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(t===ne.array&&a===ne.array){if(i.length!==e.length)return{valid:!1};const s=[];for(let c=0;c<i.length;c++){const d=i[c],u=e[c],p=ol(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return t===ne.date&&a===ne.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}class eo extends Te{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(c,d)=>{if(nl(c)||nl(d))return _e;const u=ol(c.value,d.value);return u.valid?((rl(c)||rl(d))&&t.dirty(),{status:t.value,value:u.data}):(ee(a,{code:G.invalid_intersection_types}),_e)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,d])=>s(c,d)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}eo.create=(i,e,t)=>new eo({left:i,right:e,typeName:ge.ZodIntersection,...ve(t)});class vn extends Te{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==ne.array)return ee(a,{code:G.invalid_type,expected:ne.array,received:a.parsedType}),_e;if(a.data.length<this._def.items.length)return ee(a,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&a.data.length>this._def.items.length&&(ee(a,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map((c,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new xn(a,c,a.path,d)):null}).filter(c=>!!c);return a.common.async?Promise.all(s).then(c=>pt.mergeArray(t,c)):pt.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new vn({...this._def,rest:e})}}vn.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vn({items:i,typeName:ge.ZodTuple,rest:null,...ve(e)})};class to extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==ne.object)return ee(a,{code:G.invalid_type,expected:ne.object,received:a.parsedType}),_e;const s=[],c=this._def.keyType,d=this._def.valueType;for(const u in a.data)s.push({key:c._parse(new xn(a,u,a.path,u)),value:d._parse(new xn(a,a.data[u],a.path,u)),alwaysSet:u in a.data});return a.common.async?pt.mergeObjectAsync(t,s):pt.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof Te?new to({keyType:e,valueType:t,typeName:ge.ZodRecord,...ve(a)}):new to({keyType:tn.create(),valueType:e,typeName:ge.ZodRecord,...ve(t)})}}class sa extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==ne.map)return ee(a,{code:G.invalid_type,expected:ne.map,received:a.parsedType}),_e;const s=this._def.keyType,c=this._def.valueType,d=[...a.data.entries()].map(([u,p],h)=>({key:s._parse(new xn(a,u,a.path,[h,"key"])),value:c._parse(new xn(a,p,a.path,[h,"value"]))}));if(a.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){const h=await p.key,g=await p.value;if(h.status==="aborted"||g.status==="aborted")return _e;(h.status==="dirty"||g.status==="dirty")&&t.dirty(),u.set(h.value,g.value)}return{status:t.value,value:u}})}else{const u=new Map;for(const p of d){const h=p.key,g=p.value;if(h.status==="aborted"||g.status==="aborted")return _e;(h.status==="dirty"||g.status==="dirty")&&t.dirty(),u.set(h.value,g.value)}return{status:t.value,value:u}}}}sa.create=(i,e,t)=>new sa({valueType:e,keyType:i,typeName:ge.ZodMap,...ve(t)});class Tr extends Te{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==ne.set)return ee(a,{code:G.invalid_type,expected:ne.set,received:a.parsedType}),_e;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(ee(a,{code:G.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(ee(a,{code:G.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const c=this._def.valueType;function d(p){const h=new Set;for(const g of p){if(g.status==="aborted")return _e;g.status==="dirty"&&t.dirty(),h.add(g.value)}return{status:t.value,value:h}}const u=[...a.data.values()].map((p,h)=>c._parse(new xn(a,p,a.path,h)));return a.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,t){return new Tr({...this._def,minSize:{value:e,message:ce.toString(t)}})}max(e,t){return new Tr({...this._def,maxSize:{value:e,message:ce.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Tr.create=(i,e)=>new Tr({valueType:i,minSize:null,maxSize:null,typeName:ge.ZodSet,...ve(e)});class ei extends Te{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ne.function)return ee(t,{code:G.invalid_type,expected:ne.function,received:t.parsedType}),_e;function a(u,p){return ta({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ea(),Jr].filter(h=>!!h),issueData:{code:G.invalid_arguments,argumentsError:p}})}function s(u,p){return ta({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ea(),Jr].filter(h=>!!h),issueData:{code:G.invalid_return_type,returnTypeError:p}})}const c={errorMap:t.common.contextualErrorMap},d=t.data;if(this._def.returns instanceof ti){const u=this;return wt(async function(...p){const h=new Ot([]),g=await u._def.args.parseAsync(p,c).catch(R=>{throw h.addIssue(a(p,R)),h}),x=await Reflect.apply(d,this,g);return await u._def.returns._def.type.parseAsync(x,c).catch(R=>{throw h.addIssue(s(x,R)),h})})}else{const u=this;return wt(function(...p){const h=u._def.args.safeParse(p,c);if(!h.success)throw new Ot([a(p,h.error)]);const g=Reflect.apply(d,this,h.data),x=u._def.returns.safeParse(g,c);if(!x.success)throw new Ot([s(g,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ei({...this._def,args:vn.create(e).rest(Sr.create())})}returns(e){return new ei({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ei({args:e||vn.create([]).rest(Sr.create()),returns:t||Sr.create(),typeName:ge.ZodFunction,...ve(a)})}}class no extends Te{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}no.create=(i,e)=>new no({getter:i,typeName:ge.ZodLazy,...ve(e)});class ro extends Te{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ee(t,{received:t.data,code:G.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}ro.create=(i,e)=>new ro({value:i,typeName:ge.ZodLiteral,...ve(e)});function iu(i,e){return new er({values:i,typeName:ge.ZodEnum,...ve(e)})}class er extends Te{constructor(){super(...arguments),Gi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return ee(t,{expected:Ie.joinValues(a),received:t.parsedType,code:G.invalid_type}),_e}if(ra(this,Gi)||Qd(this,Gi,new Set(this._def.values)),!ra(this,Gi).has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return ee(t,{received:t.data,code:G.invalid_enum_value,options:a}),_e}return wt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return er.create(e,{...this._def,...t})}exclude(e,t=this._def){return er.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}Gi=new WeakMap,er.create=iu;class io extends Te{constructor(){super(...arguments),Ki.set(this,void 0)}_parse(e){const t=Ie.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==ne.string&&a.parsedType!==ne.number){const s=Ie.objectValues(t);return ee(a,{expected:Ie.joinValues(s),received:a.parsedType,code:G.invalid_type}),_e}if(ra(this,Ki)||Qd(this,Ki,new Set(Ie.getValidEnumValues(this._def.values))),!ra(this,Ki).has(e.data)){const s=Ie.objectValues(t);return ee(a,{received:a.data,code:G.invalid_enum_value,options:s}),_e}return wt(e.data)}get enum(){return this._def.values}}Ki=new WeakMap,io.create=(i,e)=>new io({values:i,typeName:ge.ZodNativeEnum,...ve(e)});class ti extends Te{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ne.promise&&t.common.async===!1)return ee(t,{code:G.invalid_type,expected:ne.promise,received:t.parsedType}),_e;const a=t.parsedType===ne.promise?t.data:Promise.resolve(t.data);return wt(a.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ti.create=(i,e)=>new ti({type:i,typeName:ge.ZodPromise,...ve(e)});class rn extends Te{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:t,ctx:a}=this._processInputParams(e),s=this._def.effect||null,c={addIssue:d=>{ee(a,d),d.fatal?t.abort():t.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),s.type==="preprocess"){const d=s.transform(a.data,c);if(a.common.async)return Promise.resolve(d).then(async u=>{if(t.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:a.path,parent:a});return p.status==="aborted"?_e:p.status==="dirty"||t.value==="dirty"?na(p.value):p});{if(t.value==="aborted")return _e;const u=this._def.schema._parseSync({data:d,path:a.path,parent:a});return u.status==="aborted"?_e:u.status==="dirty"||t.value==="dirty"?na(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,c);if(a.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(a.common.async===!1){const u=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return u.status==="aborted"?_e:(u.status==="dirty"&&t.dirty(),d(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&t.dirty(),d(u.value).then(()=>({status:t.value,value:u.value}))))}if(s.type==="transform")if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Hi(d))return d;const u=s.transform(d.value,c);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>Hi(d)?Promise.resolve(s.transform(d.value,c)).then(u=>({status:t.value,value:u})):d);Ie.assertNever(s)}}rn.create=(i,e,t)=>new rn({schema:i,typeName:ge.ZodEffects,effect:e,...ve(t)}),rn.createWithPreprocess=(i,e,t)=>new rn({schema:e,effect:{type:"preprocess",transform:i},typeName:ge.ZodEffects,...ve(t)});class Cn extends Te{_parse(e){return this._getType(e)===ne.undefined?wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cn.create=(i,e)=>new Cn({innerType:i,typeName:ge.ZodOptional,...ve(e)});class tr extends Te{_parse(e){return this._getType(e)===ne.null?wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tr.create=(i,e)=>new tr({innerType:i,typeName:ge.ZodNullable,...ve(e)});class oo extends Te{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===ne.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}oo.create=(i,e)=>new oo({innerType:i,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ve(e)});class ao extends Te{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return qi(s)?s.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Ot(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ao.create=(i,e)=>new ao({innerType:i,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ve(e)});class la extends Te{_parse(e){if(this._getType(e)!==ne.nan){const t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ne.nan,received:t.parsedType}),_e}return{status:"valid",value:e.data}}}la.create=i=>new la({typeName:ge.ZodNaN,...ve(i)});const Ub=Symbol("zod_brand");class al extends Te{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class so extends Te{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?_e:s.status==="dirty"?(t.dirty(),na(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?_e:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,t){return new so({in:e,out:t,typeName:ge.ZodPipeline})}}class lo extends Te{_parse(e){const t=this._def.innerType._parse(e),a=s=>(Hi(s)&&(s.value=Object.freeze(s.value)),s);return qi(t)?t.then(s=>a(s)):a(t)}unwrap(){return this._def.innerType}}lo.create=(i,e)=>new lo({innerType:i,typeName:ge.ZodReadonly,...ve(e)});function ou(i,e={},t){return i?Xr.create().superRefine((a,s)=>{var c,d;if(!i(a)){const u=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,p=(d=(c=u.fatal)!==null&&c!==void 0?c:t)!==null&&d!==void 0?d:!0,h=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...h,fatal:p})}}):Xr.create()}const jb={object:Ke.lazycreate};var ge;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(ge||(ge={}));const Wb=(i,e={message:`Input not instance of ${i.name}`})=>ou(t=>t instanceof i,e),au=tn.create,su=Jn.create,Hb=la.create,qb=Xn.create,lu=Yi.create,Gb=Er.create,Kb=ia.create,Yb=Ji.create,Jb=Xi.create,Xb=Xr.create,Qb=Sr.create,ek=On.create,tk=oa.create,nk=nn.create,rk=Ke.create,ik=Ke.strictCreate,ok=Qi.create,ak=aa.create,sk=eo.create,lk=vn.create,ck=to.create,dk=sa.create,uk=Tr.create,fk=ei.create,pk=no.create,hk=ro.create,mk=er.create,gk=io.create,yk=ti.create,cu=rn.create,_k=Cn.create,wk=tr.create,bk=rn.createWithPreprocess,kk=so.create;var ca=Object.freeze({__proto__:null,defaultErrorMap:Jr,setErrorMap:Sb,getErrorMap:ea,makeIssue:ta,EMPTY_PATH:Tb,addIssueToContext:ee,ParseStatus:pt,INVALID:_e,DIRTY:na,OK:wt,isAborted:nl,isDirty:rl,isValid:Hi,isAsync:qi,get util(){return Ie},get objectUtil(){return tl},ZodParsedType:ne,getParsedType:Yn,ZodType:Te,datetimeRegex:ru,ZodString:tn,ZodNumber:Jn,ZodBigInt:Xn,ZodBoolean:Yi,ZodDate:Er,ZodSymbol:ia,ZodUndefined:Ji,ZodNull:Xi,ZodAny:Xr,ZodUnknown:Sr,ZodNever:On,ZodVoid:oa,ZodArray:nn,ZodObject:Ke,ZodUnion:Qi,ZodDiscriminatedUnion:aa,ZodIntersection:eo,ZodTuple:vn,ZodRecord:to,ZodMap:sa,ZodSet:Tr,ZodFunction:ei,ZodLazy:no,ZodLiteral:ro,ZodEnum:er,ZodNativeEnum:io,ZodPromise:ti,ZodEffects:rn,ZodTransformer:rn,ZodOptional:Cn,ZodNullable:tr,ZodDefault:oo,ZodCatch:ao,ZodNaN:la,BRAND:Ub,ZodBranded:al,ZodPipeline:so,ZodReadonly:lo,custom:ou,Schema:Te,ZodSchema:Te,late:jb,get ZodFirstPartyTypeKind(){return ge},coerce:{string:i=>tn.create({...i,coerce:!0}),number:i=>Jn.create({...i,coerce:!0}),boolean:i=>Yi.create({...i,coerce:!0}),bigint:i=>Xn.create({...i,coerce:!0}),date:i=>Er.create({...i,coerce:!0})},any:Xb,array:nk,bigint:qb,boolean:lu,date:Gb,discriminatedUnion:ak,effect:cu,enum:mk,function:fk,instanceof:Wb,intersection:sk,lazy:pk,literal:hk,map:dk,nan:Hb,nativeEnum:gk,never:ek,null:Jb,nullable:wk,number:su,object:rk,oboolean:()=>lu().optional(),onumber:()=>su().optional(),optional:_k,ostring:()=>au().optional(),pipeline:kk,preprocess:bk,promise:yk,record:ck,set:uk,strictObject:ik,string:au,symbol:Kb,transformer:cu,tuple:lk,undefined:Yb,union:ok,unknown:Qb,void:tk,NEVER:_e,ZodIssueCode:G,quotelessJson:Eb,ZodError:Ot});function xk(i){throw new Error("Unexpected object: "+i)}const du="upload://upload/",uu="index://index/";function vk(i){return i.startsWith(du)}function Ck(i){return i.startsWith(uu)}function Ek(i){if(Ck(i)){const e=i.slice(uu.length);return JSON.parse(decodeURIComponent(e)).path}else if(vk(i)){const e=i.slice(du.length);return JSON.parse(decodeURIComponent(e)).localPath}xk(i)}ca.object({__isRef:ca.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ca.string().describe("Upstream block id"),name:ca.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 Sk(i){return i.replace(/^.*[\\/]/,"")}const Tk={class:"pl-file-input__envelope"},Vk={key:0,ref:"label"},Nk={key:0,class:"required-icon"},Bk=["data-placeholder"],Ok={key:5,class:"pl-file-input__stats"},Ak={key:0,class:"pl-file-input__error"},Rk={key:1,class:"upl-file-input__helper"},Dk=n.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}},emits:["update:modelValue"],setup(i,{emit:e}){const t=n.reactive({fileDialogOpen:!1}),a=n.useSlots(),s=e,c=i,d=n.computed(()=>{if(c.modelValue)try{const v=Ek(c.modelValue).trim();return c.showFilenameOnly?Sk(v):v}catch(v){return console.error(v),c.modelValue}return""}),u=n.computed(()=>c.progress&&!c.progress.done),p=n.computed(()=>c.progress&&c.progress.done),h=n.computed(()=>{var v;return c.error||((v=c.progress)==null?void 0:v.lastError)}),g=n.computed(()=>{var v;return c.error??((v=c.progress)==null?void 0:v.lastError)}),x=n.computed(()=>{const{status:v,done:I}=c.progress??{};return!v||!v.bytesTotal?"":v.bytesProcessed&&!I?As(v.bytesProcessed,{})+" / "+As(v.bytesTotal,{}):As(v.bytesTotal,{})}),R=n.computed(()=>{var v;const{progress:I}=c;return I?{width:I.done?"100%":Math.round((((v=I.status)==null?void 0:v.progress)??0)*100)+"%"}:{}}),T=()=>{t.fileDialogOpen=!0},C=v=>{v.files.length&&s("update:modelValue",v.files[0])},k=()=>s("update:modelValue",void 0),S=n.ref();return vr(S),(v,I)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",Tk,[n.createElementVNode("div",{ref_key:"rootRef",ref:S,class:n.normalizeClass(["pl-file-input",{dashed:v.dashed,error:h.value}]),tabindex:"0",onKeyup:n.withKeys(T,["enter"])},[n.createElementVNode("div",{class:"pl-file-input__progress",style:n.normalizeStyle(R.value)},null,4),I[3]||(I[3]=n.createTextVNode()),v.label?(n.openBlock(),n.createElementBlock("label",Vk,[v.required?(n.openBlock(),n.createElementBlock("i",Nk)):n.createCommentVNode("",!0),I[1]||(I[1]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(v.label),1),I[2]||(I[2]=n.createTextVNode()),n.unref(a).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(v.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0),I[4]||(I[4]=n.createTextVNode()),h.value?(n.openBlock(),n.createBlock(Cr,{key:1,name:"restart"})):u.value?(n.openBlock(),n.createBlock(Cr,{key:2,name:"cloud-up"})):p.value?(n.openBlock(),n.createBlock(Cr,{key:3,name:"success"})):(n.openBlock(),n.createBlock(Cr,{key:4,name:"paper-clip"})),I[5]||(I[5]=n.createTextVNode()),n.createElementVNode("div",{"data-placeholder":v.placeholder??"Choose file",class:"pl-file-input__filename",onClick:n.withModifiers(T,["stop"])},n.toDisplayString(d.value),9,Bk),I[6]||(I[6]=n.createTextVNode()),x.value?(n.openBlock(),n.createElementBlock("div",Ok,n.toDisplayString(x.value),1)):n.createCommentVNode("",!0),I[7]||(I[7]=n.createTextVNode()),v.modelValue?(n.openBlock(),n.createBlock(Cr,{key:6,name:"close",onClick:n.withModifiers(k,["stop"])})):n.createCommentVNode("",!0),I[8]||(I[8]=n.createTextVNode()),n.createVNode(Yr,{class:"pl-file-input__contour"})],34),I[9]||(I[9]=n.createTextVNode()),h.value?(n.openBlock(),n.createElementBlock("div",Ak,n.toDisplayString(g.value),1)):v.helper?(n.openBlock(),n.createElementBlock("div",Rk,n.toDisplayString(v.helper),1)):n.createCommentVNode("",!0)]),I[10]||(I[10]=n.createTextVNode()),n.createVNode(n.unref(Jd),{modelValue:t.fileDialogOpen,"onUpdate:modelValue":I[0]||(I[0]=K=>t.fileDialogOpen=K),extensions:v.extensions,title:v.fileDialogTitle,"onImport:files":C},null,8,["modelValue","extensions","title"])],64))}}),Ik=n.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(i){const e=i;return n.provide(e.contextKey,n.computed(()=>e.context)),(t,a)=>n.renderSlot(t.$slots,"default")}});function ht(i,e,t){return e>i?e:i>t?t:i}const sl=i=>n.computed(()=>{const e=[100],{min:t,max:a,step:s}=i.value;let c=t;for(;c<a;){c+=s;const d=(1-(ht(c,t,a)-t)/(a-t))*100;e.push(d)}return e}),Mk={class:"ui-slider__wrapper"},Pk={class:"ui-slider__label-section"},Lk={key:0,class:"text-s"},Fk={key:1,class:"ui-slider__value-static text-s"},$k={class:"ui-slider__base"},zk={class:"ui-slider__container"},Zk={class:"ui-slider__container ui-slider__container-thumb"},Uk={class:"ui-slider__input-wrapper d-flex"},jk=["value"],Wk={key:0,class:"ui-slider__error"},Hk=n.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(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.reactive({deltaValue:0}),d=n.computed(()=>s.max-s.min),u=n.computed(()=>ht((s.modelValue??0)+c.deltaValue,s.min,s.max)),p=n.ref(s.modelValue),h=n.computed(()=>{const z=s.modelValue;return Number.isFinite(z)?z<s.min?`Min value: ${s.min}`:z>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),g=n.computed(()=>s),x=sl(g),R=n.computed(()=>(u.value-s.min)/d.value),T=n.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"})),C=n.computed(()=>({right:`calc(${Math.ceil((1-R.value)*100)}%) `})),k=n.ref(),S=n.ref();n.watch(()=>s.modelValue,z=>{p.value=z});function v(z){const W=ht(z,s.min,s.max);return Math.round((W+Number.EPSILON)*(1/s.step))/(1/s.step)}Kn(S,z=>{var W;at((W=n.unref(k))==null?void 0:W.getBoundingClientRect(),O=>{const{dx:B}=z;c.deltaValue=B/O.width*d.value,p.value=v(ht((s.modelValue??0)+c.deltaValue,s.min,s.max)),z.stop&&(a("update:modelValue",v(u.value)),c.deltaValue=0)})});function I(z){a("update:modelValue",v(z))}function K(z){I(+z.target.value)}function j(z){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(z.code)&&z.preventDefault();const W=z.code==="ArrowUp"||z.code==="ArrowRight"?s.step*1:z.code==="ArrowDown"||z.code==="ArrowLeft"?s.step*-1:0;I(s.modelValue+W)}return(z,W)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[n.createElementVNode("div",{class:n.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[n.createElementVNode("div",Mk,[n.createElementVNode("div",Pk,[z.label?(n.openBlock(),n.createElementBlock("label",Lk,[n.createElementVNode("span",null,n.toDisplayString(z.label),1),W[1]||(W[1]=n.createTextVNode()),n.unref(t).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(z.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),W[2]||(W[2]=n.createTextVNode()),s.mode==="text"?(n.openBlock(),n.createElementBlock("div",Fk,n.toDisplayString(p.value)+n.toDisplayString(z.measure),1)):n.createCommentVNode("",!0)]),W[6]||(W[6]=n.createTextVNode()),n.createElementVNode("div",$k,[n.createElementVNode("div",zk,[n.createElementVNode("div",{ref_key:"barRef",ref:k,class:"ui-slider__bar"},[n.createElementVNode("div",{class:"ui-slider__progress",style:n.normalizeStyle(T.value)},null,4)],512)]),W[5]||(W[5]=n.createTextVNode()),n.createElementVNode("div",Zk,[s.breakpoints?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(x),(O,B)=>(n.openBlock(),n.createElementBlock("div",{key:B,style:n.normalizeStyle({right:`${O}%`}),class:"ui-slider__thumb-step"},null,4))),128)):n.createCommentVNode("",!0),W[4]||(W[4]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef",ref:S,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:n.normalizeStyle(C.value),onKeydown:j},W[3]||(W[3]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),W[7]||(W[7]=n.createTextVNode()),n.createElementVNode("div",Uk,[s.mode==="input"?(n.openBlock(),n.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:W[0]||(W[0]=O=>K(O))},null,40,jk)):n.createCommentVNode("",!0)])],2),W[8]||(W[8]=n.createTextVNode()),h.value?(n.openBlock(),n.createElementBlock("div",Wk,n.toDisplayString(h.value),1)):n.createCommentVNode("",!0)],2))}});function qk(i,e=null,t=null){function a(u){const{scrollTop:p,scrollHeight:h,clientHeight:g}=u;if(!(h>g)||!e)return null;const x=h-p-g,R=p>e?e:0,T=x>e?g-e-R:g;return`linear-gradient(
206
10
  to bottom,
207
11
  transparent,
208
- black ${m}px,
209
- black ${v}px,
12
+ black ${R}px,
13
+ black ${T}px,
210
14
  transparent 100%
211
- )`}function n(a){const{scrollLeft:d,scrollWidth:h,clientWidth:p}=a;if(!(h>p)||!i)return null;const f=h-d-p,m=d>i?i:0,v=f>i?p-i-m:p;return`linear-gradient(
15
+ )`}function s(u){const{scrollLeft:p,scrollWidth:h,clientWidth:g}=u;if(!(h>g)||!t)return null;const x=h-p-g,R=p>t?t:0,T=x>t?g-t-R:g;return`linear-gradient(
212
16
  to right,
213
17
  transparent,
214
- black ${m}px,
215
- black ${v}px,
18
+ black ${R}px,
19
+ black ${T}px,
216
20
  transparent 100%
217
- )`}function o(){const a=e.value;if(!a)return;const d=[s(a),n(a)].filter(h=>h!==null);a.style.setProperty("-webkit-mask-image",d.join(",")),a.style.setProperty("mask-image",d.join(",")),d.length>1&&(a.style.setProperty("-webkit-mask-composite","source-in"),a.style.setProperty("mask-composite","source-in"))}const r=eh(o);l.onMounted(o),dt(window,"scroll",r,!0),dt(window,"resize",r,!0)}function av(e,t){_C(()=>{Et(l.unref(e),i=>{OC(i,()=>t(i))})}),l.onUnmounted(()=>{Et(l.unref(e),i=>{VC(i)})})}const vn={item:"sortable__item",animate:"sortable__animate"},Pl=e=>e.getBoundingClientRect().y,cv=e=>{const{y:t,height:i}=e.getBoundingClientRect();return t+Math.ceil(i/2)},kB=e=>{const{y:t,height:i}=e.getBoundingClientRect();return t+i};function IB(e,t){const i={item:void 0,options(){var v;return[...((v=e.value)==null?void 0:v.children)??[]]}},s=l.computed(()=>i.options()),n=t.shakeBuffer??10,o=t.reorderDelay??100;function r(v){const w=t.handle?this.querySelector(t.handle):null;w&&!w.contains(v.target)||(this.classList.remove(vn.animate),this.classList.add(vn.item),i.item={el:this,y:v.y,dy:0,orderChanged:!1})}function a(v){const w=i.options();return w.slice(0,w.indexOf(v))}function d(v){const w=i.options();return w.slice(w.indexOf(v)+1)}function h(v,w){const S=i.options().filter(R=>R!==w),b=S.indexOf(v);return S.splice(b,0,w),S}function p(v,w){const S=i.options().filter(R=>R!==w),b=S.indexOf(v);return S.splice(b+1,0,w),S}function f(v,w){v.dy=w-v.y,v.el.style.setProperty("transform",`translateY(${v.dy}px)`)}function m(v){var w;if(!i.item)return;const{el:S}=i.item;if(!S.isConnected){i.item=void 0;return}const b=v.map(L=>Pl(L)),R=Pl(S);(w=e.value)==null||w.replaceChildren(...v);const x=Pl(S),T=v.map(L=>Pl(L)),I=[];for(let L=0;L<T.length;L++){const A=v[L];if(A===i.item.el)continue;const k=T[L],N=b[L]-k;A.style.transform=`translateY(${N}px)`,I.push(A)}const V=x-R;i.item.y=i.item.y+V,i.item.dy=i.item.dy-V,i.item.orderChanged=!0,i.item.el.style.setProperty("transform",`translateY(${i.item.dy}px)`),I.forEach(L=>L.classList.remove(vn.animate)),requestAnimationFrame(function(){I.forEach(L=>{L.classList.add(vn.animate),L.style.transform="",L.addEventListener("transitionend",()=>{L.classList.remove(vn.animate)})})})}dt(window,"mousemove",v=>{if(!i.item)return;const{el:w}=i.item;f(i.item,v.y);const S=Pl(i.item.el),b=kB(i.item.el),R=a(w),x=d(w);R.forEach(T=>{const I=cv(T);S+n<I&&m(h(T,w))}),x.forEach(T=>{const I=cv(T);b-n>I&&m(p(T,w))})}),dt(window,"mouseup",()=>{if(!i.item)return;const{el:v,orderChanged:w}=i.item;v.classList.add(vn.animate),v.style.removeProperty("transform"),v.addEventListener("transitionend",()=>{v.classList.remove(vn.animate,vn.item)}),setTimeout(()=>{if(!w)return;const S=i.options().map(R=>Number(R.getAttribute("data-index"))),b=e.value;if(b){for(const R of i.options())b.removeChild(R);s.value.forEach(R=>{b.appendChild(R)})}t.onChange(S)},o),i.item=void 0}),l.watchEffect(()=>{s.value.forEach((v,w)=>{v.removeEventListener("mousedown",r),v.addEventListener("mousedown",r),v.setAttribute("data-index",String(w))})})}function LB(e,t){let i;l.onMounted(()=>{i=setInterval(e,t)}),l.onUnmounted(()=>clearInterval(i))}function _B(e,t,i){const s=l.reactive({data:qu.deepClone(t(e.value)),changed:!1});return l.watch(()=>s.data,n=>{s.changed?i(qu.deepClone(n)):s.changed=!0},{deep:!0}),l.watch(e,n=>{Object.assign(s,{data:qu.deepClone(t(n)),changed:!1})},{deep:!0,immediate:!0}),s}function OB(e){const t=l.reactive({isLoading:!1,result:void 0,error:void 0,async run(...i){this.isLoading=!0,this.error=void 0;try{this.result=await e(...i)}catch(s){this.error=s}finally{this.isLoading=!1}},debounce(i,s=1e3){return fC(()=>{const n=i();this.run(...n).catch(console.error)},s)}});return t.run=t.run.bind(t),t}function VB(e,t){function i(r,a){const d=l.unref(e);if(!d)return;const h=`translate(${a.x-r.x}px, ${a.y-r.y}px)`;d.style.setProperty("transform",h),t(a)}function s(r){const a=d=>i(r,d);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{const d=l.unref(e);document.removeEventListener("mousemove",a),d&&(d.style.setProperty("transition","all .3s ease-in-out"),d.style.removeProperty("transform"),d.addEventListener("transitionend",()=>{d.style.removeProperty("transition")}))},{once:!0})}function n(){var r;(r=l.unref(e))==null||r.addEventListener("mousedown",s)}function o(){var r;(r=l.unref(e))==null||r.removeEventListener("mousedown",s)}l.onMounted(n),l.onUnmounted(o)}const NB={class:"ui-slider__wrapper"},BB={class:"ui-slider__label-section"},GB={key:0,class:"text-s"},HB={class:"ui-slider__base"},WB={class:"ui-slider__container"},zB={class:"ui-slider__container ui-slider__container-thumb"},UB=["data-percent"],$B=["data-percent"],KB=["data-percent"],jB={key:0,class:"ui-slider__error"},ZB=l.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(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),r=l.ref(),a=l.ref(),d=l.ref(),h=l.ref(),p=l.computed(()=>n.max-n.min),f=l.computed(()=>n),m=Eh(f),v=l.computed(()=>Nt((n.modelValue[0]??0)+o.deltaValue1,n.min,n.max)),w=l.computed(()=>Nt((n.modelValue[1]??0)+o.deltaValue2,n.min,n.max)),S=l.computed(()=>Nt((n.modelValue[2]??0)+o.deltaValue3,n.min,n.max)),b=l.computed(()=>{const ue=n.modelValue;if(!(Array.isArray(ue)&&ue.length===3&&ue.every(Me=>Number.isFinite(Me))))return"Expected model [number, number, number]";const ie=[];return[...n.modelValue].forEach(Me=>{Me>n.max&&ie.push(`Max model value must be lower than max props ${n.max}.`),Me<n.min&&ie.push("Min model value must be greater than max props.")}),ie.length>0?ie.join(" "):n.error}),R=l.computed(()=>(v.value-n.min)/p.value),x=l.computed(()=>(w.value-n.min)/p.value),T=l.computed(()=>(S.value-n.min)/p.value),I=l.computed(()=>$()),V=l.computed(()=>({right:I.value[0]+"%",left:100-I.value[2]+"%"})),L=l.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"})),A=l.computed(()=>({right:Math.ceil((1-x.value)*100)+"%"})),k=l.computed(()=>({right:Math.ceil((1-T.value)*100)+"%"}));un(a,ue=>{var ie;Et((ie=l.unref(r))==null?void 0:ie.getBoundingClientRect(),Me=>{const{dx:Ge}=ue;o.deltaValue1=Ge/Me.width*p.value,a.value&&N(a.value,n.modelValue[0],o.deltaValue1),ue.stop&&(Q([U(v.value),U(w.value),U(S.value)]),o.deltaValue1=0)})}),un(d,ue=>{var ie;Et((ie=l.unref(r))==null?void 0:ie.getBoundingClientRect(),Me=>{const{dx:Ge}=ue;o.deltaValue2=Ge/Me.width*p.value,d.value&&N(d.value,n.modelValue[1],o.deltaValue2),ue.stop&&(Q([U(v.value),U(w.value),U(S.value)]),o.deltaValue2=0)})}),un(h,ue=>{var ie;Et((ie=l.unref(r))==null?void 0:ie.getBoundingClientRect(),Me=>{const{dx:Ge}=ue;o.deltaValue3=Ge/Me.width*p.value,h.value&&N(h.value,n.modelValue[2],o.deltaValue3),ue.stop&&(Q([U(v.value),U(w.value),U(S.value)]),o.deltaValue3=0)})});function N(ue,ie,Me){const Ge=U(Nt((ie??0)+Me,n.min,n.max));ue.dataset.percent=`${Ge}${n.measure}`,ce()}function $(){const ue=Math.ceil((1-R.value)*100),ie=Math.ceil((1-x.value)*100),Me=Math.ceil((1-T.value)*100);return[ue,ie,Me].sort((Ge,ro)=>Ge-ro)}function U(ue){const ie=Nt(ue,n.min,n.max);return Math.round((ie+Number.EPSILON)*(1/n.step))/(1/n.step)}function Q(ue){s("update:modelValue",ue)}function ce(){const ue=Number(L.value.right.substring(0,L.value.right.length-1)),ie=Number(A.value.right.substring(0,A.value.right.length-1)),Me=Number(k.value.right.substring(0,k.value.right.length-1)),Ge=[{r:ue,th:a},{r:ie,th:d},{r:Me,th:h}].sort((ro,yn)=>ro.r-yn.r);Ge[0].th.value&&(Ge[0].th.value.dataset.hint="high"),Ge[1].th.value&&(Ge[1].th.value.dataset.hint="mid"),Ge[2].th.value&&(Ge[2].th.value.dataset.hint="low")}function me(ue,ie){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ue.code)&&ue.preventDefault();const Me=ue.code==="ArrowUp"||ue.code==="ArrowRight"?n.step*1:ue.code==="ArrowDown"||ue.code==="ArrowLeft"?n.step*-1:0,Ge=[...n.modelValue];Ge[ie]=Nt(Ge[ie]+Me,n.min,n.max),Q(Ge),ce()}return l.onMounted(()=>{ce()}),(ue,ie)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([n.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[l.createElementVNode("div",{class:l.normalizeClass([`ui-slider__mode-${n.mode}`,"ui-slider"])},[l.createElementVNode("div",NB,[l.createElementVNode("div",BB,[ue.label?(l.openBlock(),l.createElementBlock("label",GB,[l.createElementVNode("span",null,l.toDisplayString(ue.label),1),ie[3]||(ie[3]=l.createTextVNode()),l.unref(i).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:0,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(ue.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]),ie[11]||(ie[11]=l.createTextVNode()),l.createElementVNode("div",HB,[l.createElementVNode("div",WB,[l.createElementVNode("div",{ref_key:"barRef",ref:r,class:"ui-slider__bar"},[l.createElementVNode("div",{class:"ui-slider__progress",style:l.normalizeStyle(V.value)},null,4)],512)]),ie[10]||(ie[10]=l.createTextVNode()),l.createElementVNode("div",zB,[n.breakpoints?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(m),(Me,Ge)=>(l.openBlock(),l.createElementBlock("div",{key:Ge,style:l.normalizeStyle({right:`${Me}%`}),class:"ui-slider__thumb-step"},null,4))),128)):l.createCommentVNode("",!0),ie[7]||(ie[7]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"thumbRef1",ref:a,style:l.normalizeStyle(L.value),"data-percent":n.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:ie[0]||(ie[0]=Me=>me(Me,0))},ie[4]||(ie[4]=[l.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,UB),ie[8]||(ie[8]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"thumbRef2",ref:d,style:l.normalizeStyle(A.value),"data-percent":n.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:ie[1]||(ie[1]=Me=>me(Me,1))},ie[5]||(ie[5]=[l.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,$B),ie[9]||(ie[9]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:l.normalizeStyle(k.value),"data-percent":n.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:ie[2]||(ie[2]=Me=>me(Me,2))},ie[6]||(ie[6]=[l.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,KB)])])]),ie[12]||(ie[12]=l.createTextVNode()),ie[13]||(ie[13]=l.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),ie[14]||(ie[14]=l.createTextVNode()),b.value?(l.openBlock(),l.createElementBlock("div",jB,l.toDisplayString(b.value),1)):l.createCommentVNode("",!0)],2))}}),qB={class:"ui-input-range__separator"},YB=l.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const i=e,s=t,n=l.reactive({left:i.modelValue[0],right:i.modelValue[1]}),o=l.ref(!1),r=l.computed(()=>(o.value,"ui-input-range-focused")),a=l.computed({get(){return{left:Math.min(...i.modelValue),right:Math.max(...i.modelValue)}},set(){}});l.watch(()=>a.value,p=>(n.left=p.left)&&(n.right=p.right));function d(){s("update:modelValue",[+n.left,+n.right]),s("change",[+n.left,+n.right])}function h(p,f){const m=f.target.value;/^[0-9]{0,2}$/.test(m)?p?n.left=+m:n.right=+m:p?n.left=+m.slice(0,m.length-1):n.right=+m.slice(0,m.length-1)}return(p,f)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({class:[r.value,"ui-input-range"]},p.$attrs),[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=m=>a.value.left=m),class:"text-s",type:"text",onChange:d,onFocus:f[1]||(f[1]=m=>o.value=!0),onFocusout:f[2]||(f[2]=m=>o.value=!1),onInput:f[3]||(f[3]=m=>h(!0,m))},null,544),[[l.vModelText,a.value.left]]),f[8]||(f[8]=l.createTextVNode()),l.createElementVNode("div",qB,l.toDisplayString(i.separator),1),f[9]||(f[9]=l.createTextVNode()),l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":f[4]||(f[4]=m=>a.value.right=m),class:"text-s",type:"text",onChange:d,onFocus:f[5]||(f[5]=m=>o.value=!0),onFocusout:f[6]||(f[6]=m=>o.value=!1),onInput:f[7]||(f[7]=m=>h(!1,m))},null,544),[[l.vModelText,a.value.right]])],16))}}),QB={class:"ui-slider__wrapper"},XB={class:"ui-slider__label-section"},JB={key:0,class:"text-s"},e1={key:1,class:"ui-slider__value-static text-s"},t1={class:"ui-slider__base"},i1={class:"ui-slider__container"},s1={class:"ui-slider__container ui-slider__container-thumb"},n1={class:"ui-slider__input-wrapper d-flex"},o1={key:0,class:"ui-slider__error"},r1=l.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(e,{emit:t}){const i=l.useSlots(),s=t,n=e,o=l.reactive({deltaValue1:0,deltaValue2:0}),r=l.ref(),a=l.ref(),d=l.ref(),h=l.ref(n.modelValue),p=l.ref(n.modelValue[0]),f=l.ref(n.modelValue[1]),m=l.computed(()=>n),v=Eh(m),w=l.computed(()=>[p.value,f.value].sort((ce,me)=>ce-me).join("-")),S=l.computed(()=>n.max-n.min),b=l.computed(()=>Nt((n.modelValue[0]??0)+o.deltaValue1,n.min,n.max)),R=l.computed(()=>Nt((n.modelValue[1]??0)+o.deltaValue2,n.min,n.max)),x=l.computed(()=>{const ce=n.modelValue;return Array.isArray(ce)&&ce.length===2&&ce.every(me=>Number.isFinite(me))?n.error:"Expected model [number, number]"}),T=l.computed(()=>(b.value-n.min)/S.value),I=l.computed(()=>(R.value-n.min)/S.value),V=l.computed(()=>N()),L=l.computed(()=>({right:V.value[0]+"%",left:100-V.value[1]+"%"})),A=l.computed(()=>({right:Math.ceil((1-T.value)*100)+"%"})),k=l.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"}));l.watch(()=>n.modelValue,ce=>{h.value=ce,p.value=+ce[0],f.value=+ce[1]},{immediate:!0}),un(a,ce=>{var me;Et((me=l.unref(r))==null?void 0:me.getBoundingClientRect(),ue=>{const{dx:ie}=ce;o.deltaValue1=ie/ue.width*S.value,p.value=$(Nt((n.modelValue[0]??0)+o.deltaValue1,n.min,n.max)),h.value=[p.value,f.value].sort((Me,Ge)=>Me-Ge),ce.stop&&(U([$(b.value),$(R.value)]),o.deltaValue1=0)})}),un(d,ce=>{var me;Et((me=l.unref(r))==null?void 0:me.getBoundingClientRect(),ue=>{const{dx:ie}=ce;o.deltaValue2=ie/ue.width*S.value,f.value=$(Nt((n.modelValue[1]??0)+o.deltaValue2,n.min,n.max)),h.value=[p.value,f.value].sort((Me,Ge)=>Me-Ge),ce.stop&&(U([$(b.value),$(R.value)]),o.deltaValue2=0)})});function N(){const ce=Math.ceil((1-T.value)*100),me=Math.ceil((1-I.value)*100);return[ce,me].sort((ue,ie)=>ue-ie)}function $(ce){const me=Nt(ce,n.min,n.max);return Math.round((me+Number.EPSILON)*(1/n.step))/(1/n.step)}function U(ce){s("update:modelValue",ce)}function Q(ce,me){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ce.code)&&ce.preventDefault();const ue=ce.code==="ArrowUp"||ce.code==="ArrowRight"?n.step*1:ce.code==="ArrowDown"||ce.code==="ArrowLeft"?n.step*-1:0,ie=[...n.modelValue];ie[me]=Nt(ie[me]+ue,n.min,n.max),U(ie)}return(ce,me)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([n.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[l.createElementVNode("div",{class:l.normalizeClass([`ui-slider__mode-${n.mode}`,"ui-slider"])},[l.createElementVNode("div",QB,[l.createElementVNode("div",XB,[ce.label?(l.openBlock(),l.createElementBlock("label",JB,[l.createElementVNode("span",null,l.toDisplayString(ce.label),1),me[3]||(me[3]=l.createTextVNode()),l.unref(i).tooltip?(l.openBlock(),l.createBlock(l.unref(Ti),{key:0,class:"info",position:"top"},{tooltip:l.withCtx(()=>[l.renderSlot(ce.$slots,"tooltip")]),_:3})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),me[4]||(me[4]=l.createTextVNode()),n.mode==="text"?(l.openBlock(),l.createElementBlock("div",e1,l.toDisplayString(w.value),1)):l.createCommentVNode("",!0)]),me[10]||(me[10]=l.createTextVNode()),l.createElementVNode("div",t1,[l.createElementVNode("div",i1,[l.createElementVNode("div",{ref_key:"barRef",ref:r,class:"ui-slider__bar"},[l.createElementVNode("div",{class:"ui-slider__progress",style:l.normalizeStyle(L.value)},null,4)],512)]),me[9]||(me[9]=l.createTextVNode()),l.createElementVNode("div",s1,[n.breakpoints?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(v),(ue,ie)=>(l.openBlock(),l.createElementBlock("div",{key:ie,style:l.normalizeStyle({right:`${ue}%`}),class:"ui-slider__thumb-step"},null,4))),128)):l.createCommentVNode("",!0),me[7]||(me[7]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"thumbRef1",ref:a,style:l.normalizeStyle(A.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:me[0]||(me[0]=ue=>Q(ue,0))},me[5]||(me[5]=[l.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),me[8]||(me[8]=l.createTextVNode()),l.createElementVNode("div",{ref_key:"thumbRef2",ref:d,style:l.normalizeStyle(k.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:me[1]||(me[1]=ue=>Q(ue,1))},me[6]||(me[6]=[l.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),me[11]||(me[11]=l.createTextVNode()),l.createElementVNode("div",n1,[n.mode==="input"?(l.openBlock(),l.createBlock(YB,{key:0,modelValue:h.value,"onUpdate:modelValue":me[2]||(me[2]=ue=>h.value=ue),class:"ui-focused-border",onChange:U},null,8,["modelValue"])):l.createCommentVNode("",!0)])],2),me[12]||(me[12]=l.createTextVNode()),x.value?(l.openBlock(),l.createElementBlock("div",o1,l.toDisplayString(x.value),1)):l.createCommentVNode("",!0)],2))}}),l1=l.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(e,{emit:t}){const i=t,s=e,n=l.ref(),o=l.computed(()=>s.clientHeight/(s.scrollHeight||1)),r=l.computed(()=>o.value<1),a=l.computed(()=>{const d=l.unref(o);return{top:s.scrollTop*d+"px",height:Math.floor(s.clientHeight*d)+"px"}});return dt(n,"pointerdown",d=>{const h={clientY:d.clientY},p=gh(document,"mousemove",f=>{const m=(f.clientY-h.clientY)/o.value;i("update:scrollTop",s.scrollTop+m),h.clientY=f.clientY});["mouseup","pointercancel"].forEach(f=>{document.addEventListener(f,p,{once:!0})})}),(d,h)=>r.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:n,class:"v-scroll"},[l.createElementVNode("div",{class:"v-scroll__scrollbar",style:l.normalizeStyle(a.value)},null,4)],512)):l.createCommentVNode("",!0)}}),a1=l.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(e,{emit:t}){const i=t,s=e,n=l.ref(),o=l.computed(()=>s.clientWidth/(s.scrollWidth||1)),r=l.computed(()=>o.value<1),a=l.computed(()=>{const d=l.unref(o);return{left:s.scrollLeft*d+"px",width:Math.floor(s.clientWidth*d)+"px"}});return dt(n,"pointerdown",d=>{const h={clientX:d.clientX},p=gh(document,"mousemove",f=>{const m=(f.clientX-h.clientX)/o.value;i("update:scrollLeft",s.scrollLeft+m),h.clientX=f.clientX});["mouseup","pointercancel"].forEach(f=>{document.addEventListener(f,p,{once:!0})})}),(d,h)=>r.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:n,class:"h-scroll"},[l.createElementVNode("div",{class:"h-scroll__scrollbar",style:l.normalizeStyle(a.value)},null,4)],512)):l.createCommentVNode("",!0)}}),c1={class:"ui-scrollable"},d1=l.defineComponent({__name:"Scrollable",setup(e){const t=l.ref(),i=l.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function s(a){k_(i,a,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const n=a=>{a.preventDefault();const d=a.currentTarget;d.scrollTop+=a.deltaY,d.scrollLeft+=a.deltaX,s(d)};function o(a){Et(l.unref(t),d=>{d.scrollTop=a,s(d)})}function r(a){Et(l.unref(t),d=>{d.scrollLeft=a,s(d)})}return av(t,a=>{Et(a,d=>s(d))}),l.onMounted(()=>{Et(l.unref(t),a=>{s(a),a.addEventListener("wheel",n)})}),l.onUnmounted(()=>{Et(l.unref(t),a=>a.removeEventListener("wheel",n))}),(a,d)=>(l.openBlock(),l.createElementBlock("div",c1,[l.createElementVNode("div",{ref_key:"containerRef",ref:t,class:"ui-scrollable__container",onWheel:n},[l.renderSlot(a.$slots,"default")],544),d[2]||(d[2]=l.createTextVNode()),l.createVNode(l1,{"scroll-top":i.scrollTop,"client-height":i.clientHeight,"scroll-height":i.scrollHeight,onWheel:d[0]||(d[0]=l.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":o},null,8,["scroll-top","client-height","scroll-height"]),d[3]||(d[3]=l.createTextVNode()),l.createVNode(a1,{"scroll-left":i.scrollLeft,"client-width":i.clientWidth,"scroll-width":i.scrollWidth,onWheel:d[1]||(d[1]=l.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":r},null,8,["scroll-left","client-width","scroll-width"])]))}}),u1="add.svg",h1="checkmark.svg",p1="clear.svg",g1="clipboard.svg",f1="close.svg",m1="comp.svg",C1="compare.svg",v1="copy.svg",w1="edit.svg",S1="error.svg",y1="filter.svg",b1="help.svg",R1="info.svg",F1="link.svg",E1="loading.svg",x1="lock.svg",P1="maximize.svg",D1="minimize.svg",T1="minus.svg",A1="open.svg",M1="pause.svg",k1="play.svg",I1="required.svg",L1="restart.svg",_1="sort.svg",O1="sorter.svg",V1="stop.svg",N1="success.svg",B1="warning.svg",G1="zip.svg",H1={add:u1,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:h1,"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",clear:p1,"clipboard-copied":"clipboard-copied.svg",clipboard:g1,close:f1,comp:m1,compare:C1,copy:v1,"data-dimentions":"data-dimentions.svg",delete:"delete.svg","drag-dots":"drag-dots.svg",edit:w1,error:S1,export:"export.svg","filter-2":"filter-2.svg",filter:y1,help:b1,import:"import.svg",info:R1,"link-arrow":"link-arrow.svg",link:F1,loading:E1,lock:x1,maximize:P1,minimize:D1,minus:T1,"more-horizontal":"more-horizontal.svg",open:A1,pause:M1,play:k1,required:I1,restart:L1,"settings-2":"settings-2.svg",sort:_1,sorter:O1,stop:V1,success:N1,warning:B1,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:G1},W1="add.svg",z1="annotate.svg",U1="annotation.svg",$1="area.svg",K1="axes.svg",j1="bar.svg",Z1="bindot.svg",q1="boxplot.svg",Y1="bubble.svg",Q1="canvas.svg",X1="checkbox.svg",J1="checkmark.svg",eG="clipboard.svg",tG="close.svg",iG="code.svg",sG="color.svg",nG="columns.svg",oG="copy.svg",rG="cpu.svg",lG="dna.svg",aG="duplicate.svg",cG="edit.svg",dG="error.svg",uG="filter.svg",hG="generate.svg",pG="graph.svg",gG="heatmap.svg",fG="help.svg",mG="hide.svg",CG="jitter.svg",vG="layers.svg",wG="learn.svg",SG="legend.svg",yG="line.svg",bG="linetype.svg",RG="link.svg",FG="loading.svg",EG="local.svg",xG="logout.svg",PG="menu.svg",DG="minus.svg",TG="pin.svg",AG="position.svg",MG="progress.svg",kG="publications.svg",IG="restart.svg",LG="reverse.svg",_G="rotation.svg",OG="save.svg",VG="search.svg",NG="show.svg",BG="sina.svg",GG="skatterplot.svg",HG="sort.svg",WG="statistics.svg",zG="stroke.svg",UG="success.svg",$G="table.svg",KG="template.svg",jG="venn.svg",ZG="violin.svg",qG="warning.svg",YG="wetlab.svg",QG={"add-layer":"add-layer.svg",add:W1,annotate:z1,annotation:U1,area:$1,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:K1,"bar-error":"bar-error.svg","bar-trend":"bar-trend.svg",bar:j1,bindot:Z1,"box-dot":"box-dot.svg","boxplot-1":"boxplot-1.svg","boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:q1,bubble:Y1,canvas:Q1,checkbox:X1,checkmark:J1,"chevron-down":"chevron-down.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:eG,close:tG,"cloud-down":"cloud-down.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-up":"cloud-up.svg","code-2":"code-2.svg",code:iG,color:sG,columns:nG,"connected-points":"connected-points.svg",copy:oG,cpu:rG,"cross-bars":"cross-bars.svg","dark-mode":"dark-mode.svg",delete:"delete.svg","dendrogram-X-1":"dendrogram-X-1.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-1":"dendrogram-Y-1.svg","dendrogram-Y":"dendrogram-Y.svg",dna:lG,"download-files":"download-files.svg",duplicate:aG,edit:cG,"error-bar":"error-bar.svg",error:dG,"expand-left":"expand-left.svg","expand-right":"expand-right.svg","export-2":"export-2.svg",export:"export.svg","external-link":"external-link.svg","fill-color":"fill-color.svg","filter-on":"filter-on.svg",filter:uG,"filters-gate":"filters-gate.svg","fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type":"frame-type.svg",generate:hG,graph:pG,heatmap:gG,help:fG,hide:mG,"import-2":"import-2.svg","import-download":"import-download.svg","info-circle-outline":"info-circle-outline.svg",jitter:CG,layers:vG,learn:wG,legend:SG,"light-mode":"light-mode.svg","line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:yG,linetype:bG,"link-disabled":"link-disabled.svg",link:RG,loading:FG,local:EG,logout:xG,menu:PG,minus:DG,"more-horizontal":"more-horizontal.svg","outlier-shape":"outlier-shape.svg","paper-clip":"paper-clip.svg",pin:TG,position:AG,"progress-2":"progress-2.svg",progress:MG,publications:kG,"radio-btn":"radio-btn.svg",restart:IG,reverse:LG,rotation:_G,save:OG,search:VG,"server-2":"server-2.svg","settings-2":"settings-2.svg",show:NG,sina:BG,skatterplot:GG,"social-media":"social-media.svg",sort:HG,"stacked-bar":"stacked-bar.svg",statistics:WG,"strip-plot":"strip-plot.svg","stroke-non":"stroke-non.svg",stroke:zG,success:UG,"table-upload":"table-upload.svg",table:$G,template:KG,"title-position":"title-position.svg","upload-files":"upload-files.svg",venn:jG,"violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:ZG,warning:qG,wetlab:YG,"zoom-in":"zoom-in.svg"};function XG(){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 JG=["checkmark","import","clear","chevron-right","add","play","loading","arrow-right","clipboard","link","comp","close","restart","stop","settings-2"],eH=["paper-clip","cloud-up","success","restart","close","clipboard"],tH={allCssVariables:XG(),icons16:H1,icons24:QG},iH={class:"block__not-found"},sH=l.defineComponent({__name:"NotFound",setup(e){const i=zu().useApp(),s=()=>{i.updateNavigationState(n=>{n.href="/"})};return(n,o)=>(l.openBlock(),l.createElementBlock("div",iH,[l.createElementVNode("h1",null,"Not found route: "+l.toDisplayString(l.unref(i).navigationState.href),1),l.createVNode(l.unref(dh),{onClick:l.withModifiers(s,["stop"])},{default:l.withCtx(()=>o[0]||(o[0]=[l.createTextVNode("Return to main page")])),_:1})]))}}),xh=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},nH={},oH={class:"block__loader-page"};function rH(e,t){return l.openBlock(),l.createElementBlock("div",oH,t[0]||(t[0]=[l.createElementVNode("div",{class:"loader-container"},[l.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const lH=xh(nH,[["render",rH]]),aH={class:"block block__layout"},cH={key:0},dH=l.defineComponent({__name:"BlockLayout",setup(e){const t=zu(),i=o=>{try{return new URL(o,"http://dummy").pathname}catch{console.error("Invalid href",o);return}},s=l.computed(()=>t.loaded?t.useApp().href:void 0),n=l.computed(()=>{if(t.loaded){const o=t.useApp(),r=i(o.navigationState.href);return r?o.routes[r]:void 0}});return(o,r)=>(l.openBlock(),l.createElementBlock("div",aH,[l.unref(t).error?(l.openBlock(),l.createElementBlock("div",cH,l.toDisplayString(l.unref(t).error),1)):l.unref(t).loaded?n.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.value),{key:s.value})):(l.openBlock(),l.createBlock(sH,{key:3})):(l.openBlock(),l.createBlock(lH,{key:1},{default:l.withCtx(()=>r[0]||(r[0]=[l.createTextVNode("Loading...")])),_:1}))]))}});var uH="ROOT_NODE_ID",Ph=0,hH=class{constructor(e,t,i,s,n,o){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=o,this.selectionService=n,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=uH,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return Ng(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){z("rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map((s,n)=>this.createNode(s,this.rootNode,Ph,n)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const t={rowNodeTransaction:{remove:[],update:[],add:[]},rowsInserted:!1},i=[];return this.executeRemove(e,t,i),this.executeUpdate(e,t,i),this.executeAdd(e,t),this.updateSelection(i,"rowDataChanged"),t}updateRowOrderFromRowData(e){const t=this.rootNode.allLeafChildren,i=(t==null?void 0:t.length)??0,s=new Map;let n=-1,o=-1;for(let r=0;r<i;++r){const a=t[r],d=a.data;d!==e[r]&&(o<0&&(n=r),o=r,s.set(d,a))}if(n<0)return!1;for(let r=n;r<=o;++r){const a=s.get(e[r]);a!==void 0&&(t[r]=a,a.sourceRowIndex=r)}return!0}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){this.eventService.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}updateSelection(e,t){const i=e.length>0;i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i&&this.eventService.dispatchEvent({type:"selectionChanged",source:t})}executeAdd(e,t){const i=e.add;if(Tt(i))return;const s=this.rootNode.allLeafChildren;let n=s.length;if(typeof e.addIndex=="number"&&(n=this.sanitizeAddIndex(e.addIndex),n>0&&this.gos.get("treeData")))for(let d=0;d<s.length;d++){const h=s[d];if((h==null?void 0:h.rowIndex)==n-1){n=d+1;break}}const o=i.map((a,d)=>this.createNode(a,this.rootNode,Ph,n+d));if(n<s.length){const a=s.slice(0,n),d=s.slice(n,s.length),h=a.length+o.length;for(let p=0,f=d.length;p<f;++p)d[p].sourceRowIndex=h+p;this.rootNode.allLeafChildren=[...a,...o,...d],t.rowsInserted=!0}else this.rootNode.allLeafChildren=s.concat(o);const r=this.rootNode.sibling;r&&(r.allLeafChildren=s),t.rowNodeTransaction.add=o}sanitizeAddIndex(e){var i;const t=((i=this.rootNode.allLeafChildren)==null?void 0:i.length)??0;return e<0||e>=t||Number.isNaN(e)?t:Math.ceil(e)}executeRemove(e,{rowNodeTransaction:t},i){var r,a;const{remove:s}=e;if(Tt(s))return;const n={};s.forEach(d=>{const h=this.lookupRowNode(d);h&&(h.isSelected()&&i.push(h),h.clearRowTopAndRowIndex(),n[h.id]=!0,delete this.allNodesMap[h.id],t.remove.push(h))}),this.rootNode.allLeafChildren=((r=this.rootNode.allLeafChildren)==null?void 0:r.filter(d=>!n[d.id]))??null,(a=this.rootNode.allLeafChildren)==null||a.forEach((d,h)=>{d.sourceRowIndex=h});const o=this.rootNode.sibling;o&&(o.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,{rowNodeTransaction:t},i){const{update:s}=e;Tt(s)||s.forEach(n=>{const o=this.lookupRowNode(n);o&&(o.updateData(n),!o.selectable&&o.isSelected()&&i.push(o),this.setMasterForRow(o,n,Ph,!1),t.update.push(o))})}lookupRowNode(e){var s;const t=bo(this.gos);let i;if(t){const n=t({data:e,level:0});if(i=this.allNodesMap[n],!i)return We(`could not find row id=${n}, data item was not found for this id`),null}else if(i=(s=this.rootNode.allLeafChildren)==null?void 0:s.find(n=>n.data===e),!i)return We("could not find data item as object was not found",e),We("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i,s){const n=new Ls(this.beans);return n.sourceRowIndex=s,n.group=!1,this.setMasterForRow(n,e,i,!0),t&&(n.parent=t),n.level=i,n.setDataAndId(e,this.nextId.toString()),this.allNodesMap[n.id]&&z(`duplicate node id '${n.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[n.id]=n,this.nextId++,n}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const r=this.gos.get("isRowMaster");r?e.setMaster(r(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const r=this.funcColsService.getRowGroupColumns(),a=r?r.length:0,d=i+a;e.expanded=e.master?this.isExpanded(d):!1}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return t===-1?!0:e<t}},pH=class extends G{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=Wt(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:Be.EVERYTHING}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:Be.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:Be.PIVOT}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new Ls(this.beans),this.nodeManager=new hH(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),n=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),o=new Set(["postSortRows","groupDisplayType","accentedSort"]),r=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),d=[...e,...t,...i,...s,...s,...n,...o,...r,...a];this.addManagedPropertyListeners(d,h=>{var m;const p=(m=h.changeSet)==null?void 0:m.properties;if(!p)return;const f=v=>p.some(w=>v.has(w));if(f(e)){this.setRowData(this.rootNode.allLeafChildren.map(v=>v.data));return}if(f(t)){this.refreshModel({step:Be.EVERYTHING});return}if(f(i)){this.refreshModel({step:Be.FILTER});return}if(f(s)){this.refreshModel({step:Be.PIVOT});return}if(f(n)){this.refreshModel({step:Be.AGGREGATE});return}if(f(o)){this.refreshModel({step:Be.SORT});return}if(f(r)){this.refreshModel({step:Be.FILTER_AGGREGATES});return}f(a)&&this.refreshModel({step:Be.MAP})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let n,o=!1;do{n=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(r,i),h=Math.min(a,s);for(let p=d;p<=h;p++){const f=this.getRow(p);if(f.rowHeightEstimated){const m=qs(this.gos,f);f.setRowHeight(m.height),n=!0,o=!0}}n&&this.setRowTopAndRowIndex()}while(n);return o}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=Ft(this.gos,"normal");for(let n=0;n<this.rowsToDisplay.length;n++){const o=this.rowsToDisplay[n];if(o.id!=null&&i.add(o.id),o.rowHeight==null){const r=qs(this.gos,o,s,e);o.setRowHeight(r.height,r.estimated)}o.setRowTop(t),o.setRowIndex(n),t+=o.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=o=>{o&&o.id!=null&&!t.has(o.id)&&o.clearRowTopAndRowIndex()},n=o=>{if(s(o),s(o.detailNode),s(o.sibling),o.hasChildren()&&o.childrenAfterGroup){const r=o.level==-1;i&&!r&&!o.expanded||o.childrenAfterGroup.forEach(n)}};n(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),n=this.getRow(s),o=!this.gos.get("suppressAnimationFrame");if(n===e[0])return!1;const r=this.rootNode.allLeafChildren;return e.forEach(a=>{kt(r,a)}),e.forEach((a,d)=>{aa(r,a,Math.max(s+i,0)+d)}),e.forEach((a,d)=>{a.sourceRowIndex=d}),this.refreshModel({step:Be.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:o,rowNodesOrderChanged:!0}),!0}highlightRowAtPixel(e,t){const i=t!=null?this.getRowIndexAtPixel(t):null,s=i!=null?this.getRow(i):null;if(!s||!e||s===e||t==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const n=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(n),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const n=this.getRowIndexAtPixel(e);if(t=this.getRow(n||0),!t)return Fa.Below}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?Fa.Above:Fa.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay.length===0)return 0;if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.childrenAfterAggFilter,i=this.rootNode.sibling?1:0;return(t?t.length:0)+i}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=e;if(this.rowsToDisplay[0].footer){if(e===0)return 0;i-=1}const s=this.rowsToDisplay[this.rowsToDisplay.length-1],n=i>=this.rootNode.childrenAfterSort.length;if(s.footer&&n)return s.rowIndex;let o=this.rootNode.childrenAfterSort[i];if(this.gos.get("groupHideOpenParents"))for(;o.expanded&&o.childrenAfterSort&&o.childrenAfterSort.length>0;)o=o.childrenAfterSort[0];return o.rowIndex}getRowBounds(e){if(Ve(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=yo(this.gos);this.refreshModel({step:Be.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=yo(this.gos),s=e.columns.length===0||e.columns.some(n=>n.isPrimary())?Be.FILTER:Be.FILTER_AGGREGATES;this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=yo(this.gos);this.refreshModel({step:Be.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:Be.PIVOT}):this.refreshModel({step:Be.AGGREGATE})}createChangePath(e){const t=Tt(e),i=new Wr(!1,this.rootNode);return t&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||e.rowNodeTransactions==null)return!1;const t=e.rowNodeTransactions.filter(s=>s.add!=null&&s.add.length>0||s.remove!=null&&s.remove.length>0);return t==null||t.length==0}buildRefreshModelParams(e){let t=Be.EVERYTHING;const i={everything:Be.EVERYTHING,group:Be.EVERYTHING,filter:Be.FILTER,map:Be.MAP,aggregate:Be.AGGREGATE,sort:Be.SORT,pivot:Be.PIVOT};if(q(e)&&(t=i[e]),Ve(t)){We(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return}const s=!this.gos.get("suppressAnimationFrame");return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t=typeof e=="object"&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case Be.EVERYTHING:this.doRowGrouping(t.rowNodeTransactions,i,!!t.rowNodesOrderChanged,!!t.afterColumnsChanged);case Be.FILTER:this.doFilter(i);case Be.PIVOT:this.doPivot(i);case Be.AGGREGATE:this.doAggregate(i);case Be.FILTER_AGGREGATES:this.doFilterAggregates(i);case Be.SORT:this.doSort(t.rowNodeTransactions,i);case Be.MAP:this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1,this.eventService.dispatchEvent({type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack})}isEmpty(){const e=Ve(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return Ve(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return q(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const n=[],o=Nn(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(i&&(r===t||r===e)&&(s=!0,r.group&&o)){n.push(...r.allLeafChildren);return}if(!i){if(r!==t&&r!==e)return;i=!0}if(!r.group||!o){n.push(r);return}}),n}setDatasource(e){We("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(he(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let n=-1,o=-1;for(;;){const r=Math.floor((t+i)/2),a=this.rowsToDisplay[r];if(this.isRowInPixel(a,e)||(a.rowTop<e?t=r+1:a.rowTop>e&&(i=r-1),n===t&&o===i))return r;n=t,o=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:n}=e;let{index:o}=e;const r=a=>{var v;const d=(v=t[0])==null?void 0:v.parent;if(!d)return;const h=n&&xg(this.gos),p=Pg(this.gos),f=n&&p({node:d});if(d===this.rootNode){h===a&&(d.createFooter(),i(d.sibling,o++));return}f===a&&(d.createFooter(),i(d.sibling,o++))};r("top");for(let a=0;a<t.length;a++){const d=t[a];if(i(d,o++),d.hasChildren()&&!d.footer){let h=null;switch(s){case 0:h=d.childrenAfterGroup;break;case 1:h=d.childrenAfterAggFilter;break;case 2:h=d.childrenAfterSort;break;case 3:h=d.leafGroup?null:d.childrenAfterSort;break}h&&(o=this.recursivelyWalkNodesAndCallback({nodes:[...h],callback:i,recursionType:s,index:o,includeFooterNodes:n}))}}return r("bottom"),o}doAggregate(e){var t;(t=this.aggregationStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=n=>{n&&n.forEach(o=>{const r=()=>{o.expanded=e,s(o.childrenAfterGroup)};if(t){q(o.childrenAfterGroup)&&r();return}if(i){!o.leafGroup&&r();return}o.group&&r()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:Be.MAP}),this.eventService.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage)e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodesOrderChanged:i,changedPath:t}):this.groupStage.execute({rowNode:this.rootNode,changedPath:t,afterColumnsChanged:s}),Nn(this.gos)&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",t)&&this.eventService.dispatchEvent({type:"selectionChanged",source:"rowGroupChanged"});else{const n=this.rootNode,o=n.sibling;n.childrenAfterGroup=n.allLeafChildren,o&&(o.childrenAfterGroup=n.childrenAfterGroup),this.rootNode.updateHasChildren()}this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;(t=this.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getNodeManager(){return this.nodeManager}getRowNode(e){if(typeof e=="string"&&e.indexOf(Ls.ID_PREFIX_ROW_GROUP)==0){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:Be.EVERYTHING,newData:!0})}batchUpdateRowData(e,t){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const i=this.gos.get("asyncTransactionWaitMillis");this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.isAlive()&&this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var s;this.valueCache.onDataChanged();const e=[],t=[];let i=!1;(s=this.rowDataTransactionBatch)==null||s.forEach(n=>{const{rowNodeTransaction:o,rowsInserted:r}=this.nodeManager.updateRowData(n.rowDataTransaction);r&&(i=!0),t.push(o),n.callback&&e.push(n.callback.bind(null,o))}),this.commonUpdateRowData(t,i),e.length>0&&window.setTimeout(()=>{e.forEach(n=>n())},0),t.length>0&&this.eventService.dispatchEvent({type:"asyncTransactionsFlushed",results:t}),this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e){this.valueCache.onDataChanged();const{rowNodeTransaction:t,rowsInserted:i}=this.nodeManager.updateRowData(e);return this.commonUpdateRowData([t],i),t}afterImmutableDataChange(e,t){this.commonUpdateRowData([e],t)}commonUpdateRowData(e,t){if(!this.hasStarted)return;const i=!this.gos.get("suppressAnimationFrame");this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:Be.EVERYTHING,rowNodeTransactions:e,rowNodesOrderChanged:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:Be.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};function gH(e){e.expansionService.onGroupExpandedOrCollapsed()}function fH(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.refreshModel(t)}function mH(e){var t,i;return((i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null?void 0:i.isEmpty())??!0}function CH(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachLeafNode(t)}function vH(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachNodeAfterFilter(t)}function wH(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachNodeAfterFilterAndSort(t)}function SH(e){var t,i;if(e.columnModel.isAutoRowHeightActive()){z("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}(i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null||i.resetRowHeights()}function yH(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var i,s;return(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null?void 0:s.updateRowData(t)})}function bH(e,t,i){e.frameworkOverrides.wrapIncoming(()=>{var s,n;return(n=(s=e.rowModelHelperService)==null?void 0:s.getClientSideRowModel())==null?void 0:n.batchUpdateRowData(t,i)})}function RH(e){e.frameworkOverrides.wrapIncoming(()=>{var t,i;return(i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null?void 0:i.flushAsyncTransactions()})}function FH(e){return e.selectionService.getBestCostNodeSelection()}var EH=class extends G{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var i;const t=!!((i=this.filterManager)!=null&&i.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const i=(s,n)=>{s.hasChildren()&&e&&!n?s.childrenAfterFilter=s.childrenAfterGroup.filter(o=>{const r=o.childrenAfterFilter&&o.childrenAfterFilter.length>0,a=o.data&&this.filterManager.doesRowPassFilter({rowNode:o});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(o,r)=>{if(o.childrenAfterGroup)for(let a=0;a<o.childrenAfterGroup.length;a++){const d=o.childrenAfterGroup[a],h=r||this.filterManager.doesRowPassFilter({rowNode:d});d.childrenAfterGroup?s(o.childrenAfterGroup[a],h):i(d,h)}i(o,r)},n=o=>s(o,!1);t.executeFromRootNode(n)}else{const s=n=>i(n,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},xH=class extends G{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),n=s&&t.leafGroup,o=n?[t]:t.childrenAfterSort,r=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(r,o,i,s,0);const a=i.length>0;if(!n&&a&&r.grandTotalRow){t.createFooter();const h=r.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(r,t.sibling,i,0,h)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:Dg(this.gos),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:xg(this.gos),groupTotalRow:Pg(this.gos)}}recursivelyAddToRowsToDisplay(e,t,i,s,n){if(!Tt(t))for(let o=0;o<t.length;o++){const r=t[o],a=r.hasChildren(),d=s&&!a,h=e.groupRemoveSingleChildren&&a&&r.childrenAfterGroup.length===1,p=e.groupRemoveLowestSingleChildren&&a&&r.leafGroup&&r.childrenAfterGroup.length===1,f=s&&r.leafGroup,m=e.hideOpenParents&&r.expanded&&!r.master&&!f;if(!d&&!m&&!h&&!p&&this.addRowNodeToRowsToDisplay(e,r,i,n),!(s&&r.leafGroup)){if(a){const w=h||p;if(r.expanded||w){const S=e.groupTotalRow({node:r});S||r.destroyFooter();const b=w?n:n+1;S==="top"&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,b)),this.recursivelyAddToRowsToDisplay(e,r.childrenAfterSort,i,s,b),S==="bottom"&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,b))}}else if(r.master&&r.expanded){const w=this.createDetailNode(r);this.addRowNodeToRowsToDisplay(e,w,i,n)}}}}addRowNodeToRowsToDisplay(e,t,i,s,n){n?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(q(e.detailNode))return e.detailNode;const t=new Ls(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,q(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},PH=class extends G{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){st(this.gos)&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const i=this.clientSideRowModel.getNodeManager(),{rowNodeTransaction:s,rowsInserted:n}=i.updateRowData(t);let o=!1;this.gos.get("suppressMaintainUnsortedOrder")||(o=i.updateRowOrderFromRowData(e)),this.clientSideRowModel.afterImmutableDataChange(s,o||n)}createTransactionForRowData(e){if(!st(this.gos))return We("ImmutableService only works with ClientSideRowModel"),null;const t=bo(this.gos);if(t==null)return We("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!"),null;const i=this.clientSideRowModel.getNodeManager().getCopyOfNodesMap(),s=[],n=[],o=[];return q(e)&&e.forEach(r=>{const a=t({data:r,level:0}),d=i[a];d?(d.data!==r&&n.push(r),i[a]=void 0):o.push(r)}),Ei(i,(r,a)=>{a&&s.push(a.data)}),{remove:s,update:n,add:o}}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},DH=class extends G{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,n,o){const r=this.gos.get("groupMaintainOrder"),a=this.columnModel.getCols().some(m=>m.isRowGroupActive());let d={};i&&s&&(d=this.calculateDirtyNodes(s));const h=this.columnModel.isPivotMode(),p=this.gos.getCallback("postSortRows"),f=m=>{var S;this.pullDownGroupDataForHideOpenParents(m.childrenAfterAggFilter,!0);const v=h&&m.leafGroup;if(r&&a&&!m.leafGroup&&!o){const b=(S=this.funcColsService.getRowGroupColumns())==null?void 0:S[m.level+1],R=(b==null?void 0:b.getSort())===null,x=m.childrenAfterAggFilter.slice(0);if(m.childrenAfterSort&&!R){const T={};m.childrenAfterSort.forEach((I,V)=>{T[I.id]=V}),x.sort((I,V)=>(T[I.id]??0)-(T[V.id]??0))}m.childrenAfterSort=x}else!t||v?m.childrenAfterSort=m.childrenAfterAggFilter.slice(0):i?m.childrenAfterSort=this.doDeltaSort(m,d,n,e):m.childrenAfterSort=this.rowNodeSorter.doFullSort(m.childrenAfterAggFilter,e);if(m.sibling&&(m.sibling.childrenAfterSort=m.childrenAfterSort),this.updateChildIndexes(m),p){const b={nodes:m.childrenAfterSort};p(b)}};n&&n.forEachChangedNodeDepthFirst(f),this.updateGroupDataForHideOpenParents(n)}calculateDirtyNodes(e){const t={},i=s=>{s&&s.forEach(n=>t[n.id]=!0)};return e&&e.forEach(s=>{i(s.add),i(s.update),i(s.remove)}),t}doDeltaSort(e,t,i,s){const n=e.childrenAfterAggFilter,o=e.childrenAfterSort;if(!o)return this.rowNodeSorter.doFullSort(n,s);const r={},a=[];n.forEach(f=>{t[f.id]||!i.canSkip(f)?a.push(f):r[f.id]=!0});const d=o.filter(f=>r[f.id]),h=(f,m)=>({currentPos:m,rowNode:f}),p=a.map(h).sort((f,m)=>this.rowNodeSorter.compareRowNodes(s,f,m));return this.mergeSortedArrays(s,p,d.map(h)).map(({rowNode:f})=>f)}mergeSortedArrays(e,t,i){const s=[];let n=0,o=0;for(;n<t.length&&o<i.length;)this.rowNodeSorter.compareRowNodes(e,t[n],i[o])<0?s.push(t[n++]):s.push(i[o++]);for(;n<t.length;)s.push(t[n++]);for(;o<i.length;)s.push(i[o++]);return s}updateChildIndexes(e){if(Ve(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],n=i===0,o=i===e.childrenAfterSort.length-1;s.setFirstChild(n),s.setLastChild(o),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return z("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=i=>{this.pullDownGroupDataForHideOpenParents(i.childrenAfterSort,!1),i.childrenAfterSort.forEach(s=>{s.hasChildren()&&t(s)})};e&&e.executeFromRootNode(i=>t(i))}pullDownGroupDataForHideOpenParents(e,t){!this.gos.get("groupHideOpenParents")||Ve(e)||e.forEach(i=>{var n;(((n=this.showRowGroupColsService)==null?void 0:n.getShowRowGroupCols())??[]).forEach(o=>{const r=o.getColDef().showRowGroup;if(typeof r!="string"){We("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const a=r,d=this.columnModel.getColDefCol(a);if(d!==i.rowGroupColumn)if(t)i.setGroupValue(o.getId(),void 0);else{const p=this.getFirstChildOfFirstChild(i,d);p&&i.setGroupValue(o.getId(),p.key)}})})}getFirstChildOfFirstChild(e,t){let i=e;for(;i;){const s=i.parent;if(s&&i.firstChild){if(s.rowGroupColumn===t)return s}else return null;i=s}return null}},TH=class extends G{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=q(t)&&t.length>0,s=i&&q(e.rowNodeTransactions)&&this.gos.get("deltaSort"),n=t.some(o=>us(this.gos)?o.column.isPrimary()&&o.column.isRowGroupActive():!!o.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,n)}},Dh="32.2.2",dv={version:Dh,moduleName:`${Rt.ClientSideRowModelModule}-core`,rowModel:"clientSide",beans:[pH,EH,TH,xH,DH,PH]},AH={version:Dh,moduleName:`${Rt.ClientSideRowModelModule}-api`,beans:[Om],apiFunctions:{onGroupExpandedOrCollapsed:gH,refreshClientSideRowModel:fH,isRowDataEmpty:mH,forEachLeafNode:CH,forEachNodeAfterFilter:vH,forEachNodeAfterFilterAndSort:wH,resetRowHeights:SH,applyTransaction:yH,applyTransactionAsync:bH,flushAsyncTransactions:RH,getBestCostNodeSelection:FH},dependantModules:[dv,XA]},MH={version:Dh,moduleName:Rt.ClientSideRowModelModule,dependantModules:[dv,AH]},kH=class extends I0{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){q(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Ve(this.params.datasource.getRows)){z("datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,n)=>{this.startRow+n<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new Ls(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,s)=>{const n=e.rowData?e.rowData[s]:void 0;!i.id&&i.alreadyRendered&&n&&(this.rowNodes[s]=new Ls(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),this.rowNodes[s].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],n,this.startRow+s)});const t=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()}),super.destroy()}},IH=2,LH=class extends G{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new kH(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e)),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&Fi(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),i=(r,a)=>a.getLastAccessed()-r.getLastAccessed();t.sort(i);const s=this.params.maxBlocksInCache>0,n=s?this.params.maxBlocksInCache-1:null,o=IH-1;t.forEach((r,a)=>{const d=r.getState()==="needsLoading"&&a>=o,h=s?a>=n:!1;if(d||h){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const s=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<s&&(this.rowCount=s)}}setRowCount(e,t){this.rowCount=e,q(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new To;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,s)=>i.getId()-s.getId();return Qs(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventService.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,n=!1;const o=new To;let r=!1;return this.getBlocksInOrder().forEach(d=>{if(!r){if(n&&s+1!==d.getId()){r=!0;return}s=d.getId(),d.forEachNode(h=>{const p=h===e||h===t;(n||p)&&i.push(h),p&&(n=!n)},o,this.rowCount)}}),r||n?[]:i}},_H=class extends G{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.get("rowModelType")==="infinite"&&(this.rowHeight=On(this.gos),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&z("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=On(this.gos),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!Sr(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;bo(this.gos)!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventService.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){var e;this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:((e=this.filterManager)==null?void 0:e.getFilterModel())??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:On(this.gos),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new To},this.infiniteCache=this.createBean(new LH(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){this.dispatchModelUpdatedEvent()}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};function OH(e){var t,i;(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null||i.refreshCache()}function VH(e){var t,i;(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null||i.purgeCache()}function NH(e){var t,i;return(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null?void 0:i.getRowCount()}var Th="32.2.2",uv={version:Th,moduleName:`${Rt.InfiniteRowModelModule}-core`,rowModel:"infinite",beans:[_H],dependantModules:[_0]},BH={version:Th,moduleName:`${Rt.InfiniteRowModelModule}-api`,beans:[Om],apiFunctions:{refreshInfiniteCache:OH,purgeInfiniteCache:VH,getInfiniteRowCount:NH},dependantModules:[uv,JA]},GH={version:Th,moduleName:Rt.InfiniteRowModelModule,dependantModules:[uv,BH]},HH=e=>typeof e=="symbol",WH=(e,t,i,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:i})};new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(HH));function Ah(e){const t=e&&e.__v_raw;return t?Ah(t):e}function Mh(e){return Object.isExtensible(e)&&WH(e,"__v_skip",!0),e}var zH=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),UH=e=>`on${e.charAt(0).toUpperCase()}${e.substring(1,e.length)}`,hv=e=>e&&(Object.isFrozen(e)?e:l.markRaw(l.toRaw(e))),$H=()=>{const e={};Hi.PUBLIC_EVENTS.map(n=>UH(zH(n))).forEach(n=>e[n]=void 0);const i={},s={modelValue:{handler(n,o){!this.gridCreated||!this.api||n!==o&&(n&&o&&n.length===o.length&&n.every((r,a)=>r===o[a])||zd({rowData:n},this.api))},deep:!0}};return Hi.ALL_PROPERTIES.filter(n=>n!="gridOptions").forEach(n=>{e[n]={default:Hi.VUE_OMITTED_PROPERTY},s[n]={handler(o,r){let a=o;n==="rowData"&&o!=Hi.VUE_OMITTED_PROPERTY&&(a=hv(o)),this.batchChanges[n]=a===Hi.VUE_OMITTED_PROPERTY?void 0:a,this.batchTimeout==null&&(this.batchTimeout=setTimeout(()=>{this.batchTimeout=null,zd(this.batchChanges,this.api),this.batchChanges=l.markRaw({})},0))},deep:!0}}),[e,i,s]};function pv(e){We(`Could not find component with name of ${e}. Is it in Vue.components?`)}var kh=class by{static getComponentDefinition(t,i){let s;return typeof t=="string"?s=this.searchForComponentInstance(i,t):s={extends:l.defineComponent({...t})},s||pv(t),s.extends?(s.extends.setup&&(s.setup=s.extends.setup),s.extends.props=this.addParamsToProps(s.extends.props)):s.props=this.addParamsToProps(s.props),s}static addParamsToProps(t){return!t||Array.isArray(t)&&t.indexOf("params")===-1?t=["params",...t||[]]:typeof t=="object"&&!t.params&&(t.params={type:Object}),t}static createAndMountComponent(t,i,s,n){const o=by.getComponentDefinition(t,s);if(!o)return;const{vNode:r,destroy:a,el:d}=this.mount(o,{params:Object.freeze(i)},s,n||{});return{componentInstance:r.component.proxy,element:d,destroy:a}}static mount(t,i,s,n){let o=l.createVNode(t,i);o.appContext=s.$.appContext,o.appContext.provides={...n,...o.appContext.provides?o.appContext.provides:{},...s.$parent.$options.provide?s.$parent.$options.provide:{}};let r=document.createElement("div");return l.render(o,r),{vNode:o,destroy:()=>{r&&l.render(null,r),r=null,o=null},el:r}}static searchForComponentInstance(t,i,s=10,n=!1){let o=null,r=t.$parent,a=0;for(;!o&&r&&r.$options&&++a<s;){const d=r;d.$options&&d.$options.components&&d.$options.components[i]?o=d.$options.components[i]:d[i]&&(o=d[i]),r=r.$parent}if(!o){const d=t.$.appContext.components;d&&d[i]&&(o=d[i])}return!o&&!n?(pv(i),null):o}},KH=class ad extends eM{constructor(t,i){super(),this.parent=t,ad.provides||(ad.provides=i)}createWrapper(t){const i=this;class s extends jH{init(r){super.init(r)}hasMethod(r){const a=n.getFrameworkComponentInstance();return a[r]?!0:a.$.setupState[r]!=null}callMethod(r,a){var p;const d=this.getFrameworkComponentInstance(),h=n.getFrameworkComponentInstance();return h[r]?h[r].apply(d,a):(p=h.$.setupState[r])==null?void 0:p.apply(d,a)}addMethod(r,a){n[r]=a}processMethod(r,a){return r==="refresh"&&(this.getFrameworkComponentInstance().params=a[0]),this.hasMethod(r)?this.callMethod(r,a):r==="refresh"}createComponent(r){return i.createComponent(t,r)}}const n=new s;return n}createComponent(t,i){return kh.createAndMountComponent(t,i,this.parent,ad.provides)}createMethodProxy(t,i,s){return function(){return t.hasMethod(i)?t.callMethod(i,arguments):(s&&z("Framework component is missing the method "+i+"()"),null)}}destroy(){this.parent=null}},jH=class{getGui(){return this.element}destroy(){this.getFrameworkComponentInstance()&&typeof this.getFrameworkComponentInstance().destroy=="function"&&this.getFrameworkComponentInstance().destroy(),this.unmount()}getFrameworkComponentInstance(){return this.componentInstance}init(e){const{componentInstance:t,element:i,destroy:s}=this.createComponent(e);this.componentInstance=t,this.unmount=s,this.element=i.firstElementChild??i}},ZH=class extends vm{constructor(e){super("vue"),this.parent=e}frameworkComponent(e,t){let i=kh.searchForComponentInstance(this.parent,e,10,!0)?e:null;if(!i&&t&&t[e]){const s=t[e];i=kh.searchForComponentInstance(this.parent,s,10,!0)?s:null}return i}isFrameworkComponent(e){return typeof e=="object"}},qH=new Set(["rowDataUpdated","cellValueChanged","rowValueChanged"]),gv="onUpdate:modelValue",YH="update:modelValue",[QH,XH,JH]=$H(),eW=l.defineComponent({render(){return l.h("div")},props:{gridOptions:{type:Object,default:()=>({})},componentDependencies:{type:Array,default:()=>[]},plugins:[],modules:{type:Array,default:()=>[]},modelValue:{type:Array,default:void 0,required:!1},...QH},data(){return{api:void 0,gridCreated:!1,isDestroyed:!1,gridReadyFired:!1,emitRowModel:void 0,batchTimeout:null,batchChanges:Mh({})}},computed:XH,watch:JH,methods:{globalEventListenerFactory(e){return t=>{if(this.isDestroyed)return;t==="gridReady"&&(this.gridReadyFired=!0);const i=Hr.has(t);i&&!e||!i&&e||this.updateModelIfUsed(t)}},processChanges(e,t,i){if(this.gridCreated){if(this.skipChange(e,t,i))return;const s={[e]:e==="rowData"?Object.isFrozen(t)?t:Mh(Ah(t)):t};zd(s,this.api)}},checkForBindingConflicts(){const e=this;(e.rowData&&e.rowData!=="AG-VUE-OMITTED-PROPERTY"||this.gridOptions.rowData)&&e.modelValue&&z("Using both rowData and v-model. rowData will be ignored.")},getRowData(){var t;const e=[];return(t=this.api)==null||t.forEachNode(i=>{e.push(i.data)}),e},updateModelIfUsed(e){this.gridReadyFired&&this.$attrs[gv]&&qH.has(e)&&this.emitRowModel&&this.emitRowModel()},getRowDataBasedOnBindings(){const e=this,t=e.modelValue;return t||(e.rowData?e.rowData:e.gridOptions.rowData)},getProvides(){let e=l.getCurrentInstance(),t={};for(;e;)e&&e.provides&&(t={...t,...e.provides}),e=e.parent;return t},skipChange(e,t,i){if(this.gridReadyFired&&e==="rowData"&&this.$attrs[gv]){if(t===i)return!0;if(t&&i){const s=t,n=i;if(s.length===n.length){for(let o=0;o<s.length;o++)if(s[o]!==n[o])return!1;return!0}}}return!1},debounce(e,t){let i;return()=>{const s=function(){e()};window.clearTimeout(i),i=window.setTimeout(s,t)}}},mounted(){this.emitRowModel=this.debounce(()=>{this.$emit(YH,Object.freeze(this.getRowData()))},20);const e=this.getProvides(),t=new KH(this,e),i=Mh(xb(Ah(this.gridOptions),this));this.checkForBindingConflicts();const s=this.getRowDataBasedOnBindings();s!==Hi.VUE_OMITTED_PROPERTY&&(i.rowData=hv(s));const n={globalEventListener:this.globalEventListenerFactory().bind(this),globalSyncEventListener:this.globalEventListenerFactory(!0).bind(this),frameworkOverrides:new ZH(this),providedBeanInstances:{frameworkComponentWrapper:t},modules:this.modules};this.api=zA(this.$el,i,n),this.gridCreated=!0},unmounted(){var e;this.gridCreated&&((e=this.api)==null||e.destroy(),this.isDestroyed=!0)}}),tW=class extends G{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},iW=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:n,gos:o,processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:d,processRowGroupCallback:h}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=n,this.gos=o,this.processCellCallback=r,this.processHeaderCallback=a,this.processGroupHeaderCallback=d,this.processRowGroupCallback=h}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,n){const r=(!this.gos.get("groupHideOpenParents")||n.footer)&&this.shouldRenderGroupSummaryCell(n,e,t)?this.createValueForGroupNode(e,n):this.valueService.getValue(e,n);return this.processCell({accumulatedRowIndex:i,rowNode:n,column:e,value:r,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var r;if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(((r=e.groupData)==null?void 0:r[t.getId()])!=null||xs(this.gos)&&e.group)return!0;if(e.footer&&e.level===-1){const a=t.getColDef();return a==null||a.showRowGroup===!0||a.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const o=oa(this.gos,this.columnModel.isPivotMode());return i===0&&o}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),n=d=>{var p;if(i||s)return d.key;const h=(p=d.groupData)==null?void 0:p[e.getId()];return!h||!d.rowGroupColumn||d.rowGroupColumn.getColDef().useValueFormatterForExport===!1?h:this.valueService.formatValue(d.rowGroupColumn,d,h)??h},o=t.footer,r=[n(t)];if(!Dg(this.gos))for(;t.parent;)t=t.parent,r.push(n(t));const a=r.reverse().join(" -> ");return o?`Total ${a}`:a}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:n,processCellCallback:o,type:r}=e;return o?{value:o(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:n,type:r,parseValue:a=>this.valueService.parseValue(s,i,a,this.valueService.getValue(s,i)),formatValue:a=>this.valueService.formatValue(s,i,a)??a}))??""}:s.getColDef().useValueFormatterForExport!==!1?{value:n??"",valueFormatted:this.valueService.formatValue(s,i,n)}:{value:n??""}}},sW=class{static download(e,t){const i=document.defaultView||window;if(!i){z("There is no `window` associated with the current `document`");return}const s=document.createElement("a"),n=i.URL.createObjectURL(t);s.setAttribute("href",n),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(n)},0)}},fv=`\r
218
- `,nW=class extends iW{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,fv),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((i,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i.data.value||""),i.mergeAcross&&this.appendEmptyCells(i.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){i!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(z("unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=fv),this.isFirstLine=!1}},oW=class extends tW{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){z("Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\uFEFF",i],{type:"text/plain"}),n=typeof t.fileName=="function"?t.fileName(this.gos.getGridCommonParams()):t.fileName;sW.download(this.getFileName(n),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:n,gos:o}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:d,processRowGroupCallback:h,suppressQuotes:p,columnSeparator:f}=e;return new nW({columnModel:t,columnNameService:i,funcColsService:s,valueService:n,gos:o,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:d||void 0,processRowGroupCallback:h||void 0,suppressQuotes:p||!1,columnSeparator:f||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function rW(e,t){var i;return(i=e.csvCreator)==null?void 0:i.getDataAsCsv(t)}function lW(e,t){var i;(i=e.csvCreator)==null||i.exportDataAsCsv(t)}var aW=class extends G{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:n}=t,o=this.getColumnsToExport(i,n,s);return Vy(this.prepareSession(o),this.prependContent(t),this.exportColumnGroups(t,o),this.exportHeaders(t,o),this.processPinnedTopRows(t,o),this.processRows(t,o),this.processPinnedBottomRows(t,o),this.appendContent(t))(e).parse()}processRow(e,t,i,s){var R;const n=t.shouldRowBeSkipped||(()=>!1),o=this.gos.get("groupRemoveSingleChildren"),r=this.gos.get("groupRemoveLowestSingleChildren"),d=t.rowPositions!=null||!!t.onlySelected,h=this.gos.get("groupHideOpenParents")&&!d,p=this.columnModel.isPivotMode()?s.leafGroup:!s.group,f=!!s.footer,m=r&&s.leafGroup,v=s.allChildrenCount===1&&((R=s.childrenAfterGroup)==null?void 0:R.length)===1&&(o||m);if(!p&&!f&&(t.skipRowGroups||v||h)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!p&&!f||n(this.gos.addGridCommonParams({node:s})))return;const b=e.onNewBodyRow(s);if(i.forEach((x,T)=>{b.onColumn(x,T,s)}),t.getCustomContentBelowRow){const x=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));x&&e.addCustomContent(x)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new $g,n=this.visibleColsService.createGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(n,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const s=i.onNewHeaderRow();t.forEach((n,o)=>{s.onColumn(n,o,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(n=>n.rowPinned==="top").sort((n,o)=>n.rowIndex-o.rowIndex).map(n=>this.pinnedRowModel.getPinnedTopRow(n.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedRow("top",s),i}}processRows(e,t){return i=>{const s=this.rowModel,n=st(this.gos),o=xs(this.gos),r=!n&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:d="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(h=>h.rowPinned==null).sort((h,p)=>h.rowIndex-p.rowIndex).map(h=>s.getRow(h.rowIndex)).forEach(a);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(a,!0):o?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(a)}else d==="all"?s.forEachNode(a):n||o?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(s,n)=>{var o,r;return s.rowIndex!=null&&n.rowIndex!=null?s.rowIndex-n.rowIndex:s.level===n.level?((o=s.parent)==null?void 0:o.id)===((r=n.parent)==null?void 0:r.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:s,currentPos:s.rowIndex??-1},{rowNode:n,currentPos:n.rowIndex??-1}):i(s.parent,n.parent):s.level>n.level?i(s.parent,n):i(s,n.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(n=>n.rowPinned==="bottom").sort((n,o)=>n.rowIndex-o.rowIndex).map(n=>this.pinnedRowModel.getPinnedBottomRow(n.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedRow("bottom",s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getColsForKeys(i);const n=this.gos.get("treeData");let o=[];return e&&!s?o=this.columnModel.getCols():o=this.visibleColsService.getAllCols(),t&&!n&&(o=o.filter(r=>Od(r)||Eo(r))),o}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(n=>{const o=n;o.getChildren&&o.getChildren().forEach(r=>s.push(r))}),e.length>0&&mt(e[0])&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let n=0;t.forEach(o=>{const r=o;let a;i?a=i(this.gos.addGridCommonParams({columnGroup:r})):a=this.columnNameService.getDisplayNameForColumnGroup(r,"header");const d=r.getLeafColumns().reduce((h,p,f,m)=>{let v=he(h);return p.getColumnGroupShow()==="open"?(!v||v[1]!=null)&&(v=[f],h.push(v)):v&&v[1]==null&&(v[1]=f-1),f===m.length-1&&v&&v[1]==null&&(v[1]=f),h},[]);s.onColumn(r,a||"",n++,r.getLeafColumns().length-1,d)})}},Ih="32.2.2",mv={version:Ih,moduleName:`${Rt.CsvExportModule}-core`,beans:[oW,aW]},cW={version:Ih,moduleName:`${Rt.CsvExportModule}-api`,apiFunctions:{getDataAsCsv:rW,exportDataAsCsv:lW},dependantModules:[mv]},dW={version:Ih,moduleName:Rt.CsvExportModule,dependantModules:[mv,cW]};function uW(e,t){var i;(i=e.clipboardService)==null||i.copyToClipboard(t)}function hW(e,t){var i;(i=e.clipboardService)==null||i.cutToClipboard(t)}function pW(e,t){var i;(i=e.clipboardService)==null||i.copySelectedRowsToClipboard(t)}function gW(e,t){var i;(i=e.clipboardService)==null||i.copySelectedRangeToClipboard(t)}function fW(e){var t;(t=e.clipboardService)==null||t.copyRangeDown()}function mW(e){var t;(t=e.clipboardService)==null||t.pasteFromClipboard()}var Lh="paste",_h="dragCopy",Cv="clipboard",vv=e=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,CW=class Ry extends G{constructor(){super(...arguments),this.beanName="clipboardService",this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}wireBeans(t){this.csvCreator=t.csvCreator,this.selectionService=t.selectionService,this.rowModel=t.rowModel,this.ctrlsService=t.ctrlsService,this.valueService=t.valueService,this.focusService=t.focusService,this.rowRenderer=t.rowRenderer,this.visibleColsService=t.visibleColsService,this.funcColsService=t.funcColsService,this.cellNavigationService=t.cellNavigationService,this.cellPositionUtils=t.cellPositionUtils,this.rowPositionUtils=t.rowPositionUtils,this.rangeService=t.rangeService}postConstruct(){st(this.gos)&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(this,t=>{this.gridCtrl=t.gridCtrl})}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(i=>{z(`${i}
219
- ${vv("readText")}`),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let t=!1;const i=s=>{const n=new Date().getTime();n-this.lastPasteOperationTime<50&&(t=!0,s.preventDefault()),this.lastPasteOperationTime=n};this.executeOnTempElement(s=>{s.addEventListener("paste",i),s.focus({preventScroll:!0})},s=>{const n=s.value;t?this.refocusLastFocusedCell():this.processClipboardData(n),s.removeEventListener("paste",i)})}refocusLastFocusedCell(){const t=this.focusService.getFocusedCell();t&&this.focusService.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const t=this.gos.get("clipboardDelimiter");return q(t)?t:" "}processClipboardData(t){if(t==null)return;let i=Ry.stringToArray(t,this.getClipboardDelimiter());const s=this.gos.getCallback("processDataFromClipboard");if(s&&(i=s({data:i})),i==null)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(i);const n=(o,r,a,d)=>{var f;((f=this.rangeService)==null?void 0:f.isMoreThanOneCell())&&!this.hasOnlyOneValueToPaste(i)?this.pasteIntoActiveRange(this.rangeService,i,o,r,d):this.pasteStartingFromFocusedCell(i,o,r,a,d)};this.doPasteOperation(n)}static stringToArray(t,i=","){const s=[],n=r=>r==="\r"||r===`
220
- `;let o=!1;if(t==="")return[[""]];for(let r=0,a=0,d=0;d<t.length;d++){const h=t[d-1],p=t[d],f=t[d+1],m=()=>{s[r]||(s[r]=[]),s[r][a]||(s[r][a]="")};if(m(),p==='"'&&(o?f==='"'?(s[r][a]+='"',d++):o=!1:(h===void 0||h===i||n(h))&&(o=!0)),!o&&p!=='"'){if(p===i){a++,m();continue}else if(n(p)){a=0,r++,m(),p==="\r"&&f===`
221
- `&&d++;continue}}s[r][a]+=p}return s}doPasteOperation(t){const i="clipboard";this.eventService.dispatchEvent({type:"pasteStart",source:i});let s;if(this.clientSideRowModel){const d=this.gos.get("aggregateOnlyChangedColumns");s=new Wr(d,this.clientSideRowModel.getRootNode())}const n={},o=[],r=this.focusService.getFocusedCell();t(n,o,r,s);const a=[...o];s&&(this.clientSideRowModel.doAggregate(s),s.forEachChangedNodeDepthFirst(d=>{a.push(d)})),this.rowRenderer.refreshCells({rowNodes:a}),this.dispatchFlashCells(n),this.fireRowChanged(o),this.refocusLastFocusedCell(),this.eventService.dispatchEvent({type:"pasteEnd",source:i})}pasteIntoActiveRange(t,i,s,n,o){const r=this.getRangeSize(t)%i.length!=0;let a=0,d=0;const h=(p,f,m,v)=>{if(v-a>=i.length){if(r)return;a+=d,d=0}const S=i[v-a];n.push(f);const b=this.gos.getCallback("processCellFromClipboard");m.forEach((R,x)=>{if(!R.isCellEditable(f)||R.isSuppressPaste(f))return;x>=S.length&&(x=x%S.length);const T=this.processCell(f,R,S[x],_h,b,!0);f.setDataValue(R,T,Lh),o&&o.addParentNode(f.parent,[R]);const{rowIndex:I,rowPinned:V}=p,L=this.cellPositionUtils.createIdFromValues({rowIndex:I,column:R,rowPinned:V});s[L]=!0}),d++};this.iterateActiveRanges(!1,h)}getDisplayedColumnsStartingAt(t){let i=t;const s=[];for(;i!=null;)s.push(i),i=this.visibleColsService.getColAfter(i);return s}pasteStartingFromFocusedCell(t,i,s,n,o){if(!n)return;const r={rowIndex:n.rowIndex,rowPinned:n.rowPinned},a=this.getDisplayedColumnsStartingAt(n.column);this.isPasteSingleValueIntoRange(t)?this.pasteSingleValueIntoRange(t,s,i,o):this.pasteMultipleValues(t,r,s,a,i,Cv,o)}isPasteSingleValueIntoRange(t){return this.hasOnlyOneValueToPaste(t)&&this.rangeService!=null&&!this.rangeService.isEmpty()}pasteSingleValueIntoRange(t,i,s,n){const o=t[0][0],r=(a,d,h)=>{i.push(d),h.forEach(p=>this.updateCellValue(d,p,o,s,Cv,n))};this.iterateActiveRanges(!1,r)}hasOnlyOneValueToPaste(t){return t.length===1&&t[0].length===1}copyRangeDown(){if(!this.rangeService||this.rangeService.isEmpty())return;const t=[],i=(s,n,o,r)=>{const a=this.gos.getCallback("processCellForClipboard"),d=this.gos.getCallback("processCellFromClipboard"),h=(p,f,m)=>{t.length?(n.push(f),m.forEach((v,w)=>{if(!v.isCellEditable(f)||v.isSuppressPaste(f))return;const S=this.processCell(f,v,t[w],_h,d,!0);f.setDataValue(v,S,Lh),r&&r.addParentNode(f.parent,[v]);const{rowIndex:b,rowPinned:R}=p,x=this.cellPositionUtils.createIdFromValues({rowIndex:b,column:v,rowPinned:R});s[x]=!0})):m.forEach(v=>{const w=this.processCell(f,v,this.valueService.getValue(v,f),_h,a,!1,!0);t.push(w)})};this.iterateActiveRanges(!0,h)};this.doPasteOperation(i)}removeLastLineIfBlank(t){const i=he(t);if(i&&i.length===1&&i[0]===""){if(t.length===1)return;kt(t,i)}}fireRowChanged(t){this.gos.get("editType")==="fullRow"&&t.forEach(i=>{this.eventService.dispatchEvent({type:"rowValueChanged",node:i,data:i.data,rowIndex:i.rowIndex,rowPinned:i.rowPinned})})}pasteMultipleValues(t,i,s,n,o,r,a){let d=i;const h=this.clientSideRowModel!=null&&!this.gos.get("enableGroupEdit")&&!this.gos.get("treeData"),p=()=>{for(;;){if(!d)return null;const f=this.rowPositionUtils.getRowNode(d);if(d=this.cellNavigationService.getRowBelow({rowPinned:d.rowPinned,rowIndex:d.rowIndex}),f==null)return null;if(!(f.detail||f.footer||h&&f.group))return f}};t.forEach(f=>{const m=p();m&&(f.forEach((v,w)=>this.updateCellValue(m,n[w],v,o,r,a)),s.push(m))})}updateCellValue(t,i,s,n,o,r){if(!t||!i||!i.isCellEditable(t)||i.isSuppressPaste(t))return;const a=this.processCell(t,i,s,o,this.gos.getCallback("processCellFromClipboard"),!0);t.setDataValue(i,a,Lh);const{rowIndex:d,rowPinned:h}=t,p=this.cellPositionUtils.createIdFromValues({rowIndex:d,column:i,rowPinned:h});n[p]=!0,r&&r.addParentNode(t.parent,[i])}copyToClipboard(t={}){this.copyOrCutToClipboard(t)}cutToClipboard(t={},i="api"){this.gos.get("suppressCutToClipboard")||(this.eventService.dispatchEvent({type:"cutStart",source:i}),this.copyOrCutToClipboard(t,!0),this.eventService.dispatchEvent({type:"cutEnd",source:i}))}copyOrCutToClipboard(t,i){let{includeHeaders:s,includeGroupHeaders:n}=t;s==null&&(s=this.gos.get("copyHeadersToClipboard")),n==null&&(n=this.gos.get("copyGroupHeadersToClipboard"));const o={includeHeaders:s,includeGroupHeaders:n},r=this.gos.get("rowSelection"),a=this.gos.get("cellSelection");let d=null;this.shouldCopyCells(a,r)?(this.copySelectedRangeToClipboard(o),d=0):this.shouldCopyRows(r)?(this.copySelectedRowsToClipboard(o),d=1):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(o),d=2),i&&d!==null&&this.clearCellsAfterCopy(d)}shouldCopyCells(t,i){if(!this.rangeService||this.rangeService.isEmpty())return!1;if(t)return!(typeof i=="object"&&i.copySelectedRows&&!this.selectionService.isEmpty());{const s=this.gos.get("suppressCopySingleCellRanges");return!(!this.rangeService.isMoreThanOneCell()&&s)}}shouldCopyRows(t){return this.selectionService.isEmpty()?!1:t&&typeof t!="string"?t.copySelectedRows??!1:!this.gos.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(t){if(this.eventService.dispatchEvent({type:"keyShortcutChangedCellStart"}),t===0)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(t===1)this.clearSelectedRows();else{const i=this.focusService.getFocusedCell();if(i==null)return;const s=this.rowPositionUtils.getRowNode(i);s&&this.clearCellValue(s,i.column)}this.eventService.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const t=this.selectionService.getSelectedNodes(),i=this.visibleColsService.getAllCols();for(const s of t)for(const n of i)this.clearCellValue(s,n)}clearCellValue(t,i){if(!i.isCellEditable(t))return;const s=this.valueService.getDeleteValue(i,t);t.setDataValue(i,s,"clipboardService")}iterateActiveRanges(t,i,s){if(!this.rangeService||this.rangeService.isEmpty())return;const n=this.rangeService.getCellRanges();t?this.iterateActiveRange(n[0],i,s,!0):n.forEach((o,r)=>this.iterateActiveRange(o,i,s,r===n.length-1))}iterateActiveRange(t,i,s,n){if(!this.rangeService)return;let o=this.rangeService.getRangeStartRow(t);const r=this.rangeService.getRangeEndRow(t);s&&t.columns&&s(t.columns);let a=0,d=!1;for(;!d&&o!=null;){const h=this.rowPositionUtils.getRowNode(o);d=this.rowPositionUtils.sameRow(o,r),i(o,h,t.columns,a++,d&&n),o=this.cellNavigationService.getRowBelow(o)}}copySelectedRangeToClipboard(t={}){if(!this.rangeService||this.rangeService.isEmpty())return;const i=this.rangeService.areAllRangesAbleToMerge(),{data:s,cellsToFlash:n}=i?this.buildDataFromMergedRanges(this.rangeService,t):this.buildDataFromRanges(this.rangeService,t);this.copyDataToClipboard(s),this.dispatchFlashCells(n)}buildDataFromMergedRanges(t,i){const s=new Set,n=t.getCellRanges(),o=new Map,r=[],a={};n.forEach(f=>{f.columns.forEach(w=>s.add(w));const{rowPositions:m,cellsToFlash:v}=this.getRangeRowPositionsAndCellsToFlash(t,f);m.forEach(w=>{const S=`${w.rowIndex}-${w.rowPinned||"null"}`;o.get(S)||(o.set(S,!0),r.push(w))}),Object.assign(a,v)});const d=this.visibleColsService.getAllCols(),h=Array.from(s);return h.sort((f,m)=>{const v=d.indexOf(f),w=d.indexOf(m);return v-w}),{data:this.buildExportParams({columns:h,rowPositions:r,includeHeaders:i.includeHeaders,includeGroupHeaders:i.includeGroupHeaders}),cellsToFlash:a}}buildDataFromRanges(t,i){const s=t.getCellRanges(),n=[],o={};return s.forEach(r=>{const{rowPositions:a,cellsToFlash:d}=this.getRangeRowPositionsAndCellsToFlash(t,r);Object.assign(o,d),n.push(this.buildExportParams({columns:r.columns,rowPositions:a,includeHeaders:i.includeHeaders,includeGroupHeaders:i.includeGroupHeaders}))}),{data:n.join(`
222
- `),cellsToFlash:o}}getRangeRowPositionsAndCellsToFlash(t,i){const s=[],n={},o=t.getRangeStartRow(i),r=t.getRangeEndRow(i);let a=o;for(;a&&(s.push(a),i.columns.forEach(d=>{const{rowIndex:h,rowPinned:p}=a,f=this.cellPositionUtils.createIdFromValues({rowIndex:h,column:d,rowPinned:p});n[f]=!0}),!this.rowPositionUtils.sameRow(a,r));)a=this.cellNavigationService.getRowBelow(a);return{rowPositions:s,cellsToFlash:n}}getCellsToFlashFromRowNodes(t){const i=this.visibleColsService.getAllCols(),s={};for(let n=0;n<t.length;n++){const{rowIndex:o,rowPinned:r}=t[n];if(o!=null)for(let a=0;a<i.length;a++){const d=i[a],h=this.cellPositionUtils.createIdFromValues({rowIndex:o,column:d,rowPinned:r});s[h]=!0}}return s}copyFocusedCellToClipboard(t={}){const i=this.focusService.getFocusedCell();if(i==null)return;const s=this.cellPositionUtils.createId(i),n={rowPinned:i.rowPinned,rowIndex:i.rowIndex},o=i.column,r=this.buildExportParams({columns:[o],rowPositions:[n],includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders});this.copyDataToClipboard(r),this.dispatchFlashCells({[s]:!0})}copySelectedRowsToClipboard(t={}){const{columnKeys:i,includeHeaders:s,includeGroupHeaders:n}=t,o=this.buildExportParams({columns:i,includeHeaders:s,includeGroupHeaders:n});this.copyDataToClipboard(o);const r=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(r))}buildExportParams(t){const{columns:i,rowPositions:s,includeHeaders:n=!1,includeGroupHeaders:o=!1}=t,r={columnKeys:i,rowPositions:s,skipColumnHeaders:!n,skipColumnGroupHeaders:!o,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:a=>this.processRowGroupCallback(a),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(r,!0)}processRowGroupCallback(t){const{node:i,column:s}=t,n=this.gos.get("treeData"),o=this.gos.get("suppressGroupMaintainValueType");let a=(()=>{var p;if(n||o||!s)return i.key;const h=(p=i.groupData)==null?void 0:p[s.getId()];return!h||!i.rowGroupColumn||i.rowGroupColumn.getColDef().useValueFormatterForExport===!1?h:this.valueService.formatValue(i.rowGroupColumn,i,h)??h})();if(t.node.footer){let h="";a&&a.length&&(h=` ${a}`),a=`Total${h}`}const d=this.gos.getCallback("processCellForClipboard");if(d){let h=i.rowGroupColumn;return!h&&i.footer&&i.level===-1&&(h=this.funcColsService.getRowGroupColumns()[0]),d({value:a,node:i,column:h,type:"clipboard",formatValue:p=>this.valueService.formatValue(h,i,p)??p,parseValue:p=>this.valueService.parseValue(h,i,p,this.valueService.getValue(h,i))})}return a}dispatchFlashCells(t){window.setTimeout(()=>{this.eventService.dispatchEvent({type:"flashCells",cells:t})},0)}processCell(t,i,s,n,o,r,a){return o?o({column:i,node:t,value:s,type:n,formatValue:h=>this.valueService.formatValue(i,t??null,h)??h,parseValue:h=>this.valueService.parseValue(i,t??null,h,this.valueService.getValue(i,t))}):r&&i.getColDef().useValueParserForImport!==!1?this.valueService.parseValue(i,t??null,s,this.valueService.getValue(i,t)):a&&i.getColDef().useValueFormatterForExport!==!1?this.valueService.formatValue(i,t??null,s)??s:s}copyDataToClipboard(t){const i=this.gos.getCallback("sendToClipboard");if(i){i({data:t});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(t).catch(n=>{z(`${n}
223
- ${vv("writeText")}`),this.copyDataToClipboardLegacy(t)});return}this.copyDataToClipboardLegacy(t)}copyDataToClipboardLegacy(t){this.executeOnTempElement(i=>{const s=lt(this.gos),n=Je(this.gos);i.value=t||" ",i.select(),i.focus({preventScroll:!0}),s.execCommand("copy")||z("Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),n!=null&&n.focus!=null&&n.focus({preventScroll:!0})})}executeOnTempElement(t,i){const s=lt(this.gos),n=s.createElement("textarea");n.style.width="1px",n.style.height="1px",n.style.top=s.documentElement.scrollTop+"px",n.style.left=s.documentElement.scrollLeft+"px",n.style.position="absolute",n.style.opacity="0";const o=this.gridCtrl.getGui();o.appendChild(n);try{t(n)}catch{z("Browser does not support document.execCommand('copy') for clipboard operations")}i?window.setTimeout(()=>{i(n),o.removeChild(n)},100):o.removeChild(n)}getRangeSize(t){const i=t.getCellRanges();let s=0,n=0;return i.length>0&&(s=t.getRangeStartRow(i[0]).rowIndex,n=t.getRangeEndRow(i[0]).rowIndex),s-n+1}},Oh="32.2.2",wv={version:Oh,moduleName:`${Rt.ClipboardModule}-core`,beans:[CW],dependantModules:[Gm,dW]},vW={version:Oh,moduleName:`${Rt.ClipboardModule}-api`,apiFunctions:{copyToClipboard:uW,cutToClipboard:hW,copySelectedRowsToClipboard:pW,copySelectedRangeToClipboard:gW,copySelectedRangeDown:fW,pasteFromClipboard:mW},dependantModules:[wv]},wW={version:Oh,moduleName:Rt.ClipboardModule,dependantModules:[wv,vW]};function SW(e){var t;return((t=e.rangeService)==null?void 0:t.getCellRanges())??null}function yW(e,t){var i;(i=e.rangeService)==null||i.addCellRange(t)}function Sv(e){var t;(t=e.rangeService)==null||t.removeAllCellRanges()}var bW=class extends G{constructor(){super(...arguments),this.beanName="rangeService",this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragService=e.dragService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),i=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:i,columnMoved:i,columnPinned:i}),this.ctrlsService.whenReady(this,s=>{const n=s.gridBodyCtrl;this.autoScrollService=new bf({scrollContainer:n.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>n.getScrollFeature().getVScrollPosition().top,setVerticalPosition:o=>n.getScrollFeature().setVerticalScrollPosition(o),getHorizontalPosition:()=>n.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:o=>n.getScrollFeature().setHorizontalScrollPosition(o),shouldSkipVerticalScroll:()=>!Ft(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!n.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleColsService.getAllCols();this.cellRanges.forEach(i=>{const s=i.columns;i.columns=i.columns.filter(o=>o.isVisible()&&e.indexOf(o)!==-1),!hs(s,i.columns)&&this.dispatchChangedEvent(!1,!0,i.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(i=>i.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=he(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const i=this.visibleColsService.getAllCols(),s=t.map(n=>i.indexOf(n)).sort((n,o)=>n-o);return he(s)-s[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!ei(this.gos))return;const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;(Rr(this.gos)||!t||Ve(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},o={startRow:n,endRow:n,columns:i,startColumn:e.column};this.cellRanges.push(o),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=he(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,i=!1){const s=t.column,n=this.calculateColumnsBetween(e.startColumn,s);!n||this.isLastCellOfRange(e,t)||(e.columns=n,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},i||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:i}=e,s=(d,h)=>{const p=e.columns.filter(f=>f!==d);d?(e.startColumn=d,e.columns=h?[d,...p]:[...p,d]):e.columns=p},{left:n,right:o}=this.getRangeEdgeColumns(e);if(t===i[0]&&t!==n){s(n,!0);return}if(t===he(i)&&t===o){s(o,!1);return}}getRangeEdgeColumns(e){const t=this.visibleColsService.getAllCols(),i=e.columns.map(s=>t.indexOf(s)).filter(s=>s>-1).sort((s,n)=>s-n);return{left:t[i[0]],right:t[he(i)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,i=e.ctrlKey||e.metaKey,s=he(this.cellRanges),n=this.newestRangeStartCell,o=s.columns[0],r=he(s.columns),a=s.endRow.rowIndex,d=s.endRow.rowPinned,p={column:n.column===o?r:o,rowIndex:a,rowPinned:d},f=this.cellNavigationService.getNextCellToFocus(t,p,i);if(f)return this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:f.rowIndex,rowEndPinned:f.rowPinned,columnStart:n.column,columnEnd:f.column}),f}setCellRange(e){ei(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){jy(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(t=>{t.columns&&t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),this.cellRanges.push(t)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:i="rangeService",dispatchWrapperEvents:s,wrapperEventSource:n="deleteKey"}=e;s&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteStart",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteStart",source:n})),t||(t=this.cellRanges),t.forEach(o=>{this.forEachRowInRange(o,r=>{const a=this.rowPositionUtils.getRowNode(r);if(a)for(let d=0;d<o.columns.length;d++){const h=this.columnModel.getCol(o.columns[d]);if(!h||!h.isCellEditable(a))continue;const p=this.valueService.getDeleteValue(h,a);a.setDataValue(h,p,i)}})}),s&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteEnd",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteEnd",source:n}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let i,s=!1;if(e.columns)i=e.columns.map(r=>this.columnModel.getCol(r)).filter(r=>r);else{const r=this.columnModel.getCol(e.columnStart),a=this.columnModel.getCol(e.columnEnd);if(!r||!a)return;i=this.calculateColumnsBetween(r,a),i&&i.length&&(s=i[0]!==r)}if(!i||!t&&i.length===0)return;const n=e.rowStartIndex!=null?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,o=e.rowEndIndex!=null?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0;return{startRow:n,endRow:o,columns:i,startColumn:s?he(i):i[0]}}addCellRange(e){const t=this.gos;if(!ei(t))return;if(Tg(t)&&Rr(t)&&this.cellRanges.length>0)return z("cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`");const i=this.createCellRangeFromCellRangeParams(e);i&&(i.startRow&&this.setNewestRangeStartCell({rowIndex:i.startRow.rowIndex,rowPinned:i.startRow.rowPinned,column:i.startColumn}),this.cellRanges.push(i),this.dispatchChangedEvent(!1,!0,i.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],i=this.getRangeStartRow(t),s=this.getRangeEndRow(t);return i.rowPinned!==s.rowPinned||i.rowIndex!==s.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(s=>{this.forEachRowInRange(s,n=>{const o=`${n.rowPinned||"normal"}_${n.rowIndex}`,r=e.get(o),a=s.columns.map(d=>d.getId());if(r){const d=a.filter(h=>r.indexOf(h)===-1);r.push(...d)}else e.set(o,a)})});let i;for(const s of e.values()){const n=s.sort().join();if(i===void 0){i=n;continue}if(i!==n)return!1}return!0}forEachRowInRange(e,t){const i=this.getRangeStartRow(e),s=this.getRangeEndRow(e);let n=i;for(;n&&(t(n),!this.rowPositionUtils.sameRow(n,s));)n=this.cellNavigationService.getRowBelow(n)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const i=t.columns!==null&&Ps(t.columns,e.column),s=this.isRowInRange(e.rowIndex,e.rowPinned,t);return i&&s}isLastCellOfRange(e,t){const{startRow:i,endRow:s}=e,n=this.rowPositionUtils.before(i,s)?s:i,o=t.rowIndex===n.rowIndex&&t.rowPinned===n.rowPinned,r=e.columns[0],a=he(e.columns),d=e.startColumn===r?a:r;return t.column===d&&o}isBottomRightCell(e,t){const i=this.visibleColsService.getAllCols(),s=e.columns.map(h=>i.indexOf(h)).sort((h,p)=>h-p),{startRow:n,endRow:o}=e,r=this.rowPositionUtils.before(n,o)?o:n,a=i.indexOf(t.column)===he(s),d=t.rowIndex===r.rowIndex&&Gi(t.rowPinned)===Gi(r.rowPinned);return a&&d}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,i){const s=this.getRangeStartRow(i),n=this.getRangeEndRow(i),o={rowIndex:e,rowPinned:t||null},r=o.rowIndex===s.rowIndex&&o.rowPinned==s.rowPinned,a=o.rowIndex===n.rowIndex&&o.rowPinned==n.rowPinned;if(r||a)return!0;const d=!this.rowPositionUtils.before(o,s),h=this.rowPositionUtils.before(o,n);return d&&h}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!ei(this.gos))return;const{ctrlKey:t,metaKey:i,shiftKey:s}=e,n=t||i,r=!Rr(this.gos)?n:!1,a=s&&Ky(this.cellRanges);!r&&(!a||q(he(this.cellRanges).type))&&this.removeAllCellRanges(!0);const d=this.dragService.getStartTarget();if(d&&this.updateValuesOnMove(d),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=r&&this.getCellRangeCount(this.lastCellHovered)>1,a||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=he(this.cellRanges);else{const h={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:h,endRow:h,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging||Rr(this.gos)||this.isEmpty())return;const t=this.rowPositionUtils,i=he(this.cellRanges),s=this.getRangeStartRow(i),n=this.getRangeEndRow(i),o=[];this.cellRanges.slice(0,-1).forEach(r=>{const a=this.getRangeStartRow(r),d=this.getRangeEndRow(r),h=r.columns,p=h.filter(m=>i.columns.indexOf(m)===-1);if(p.length===h.length){o.push(r);return}if(t.before(n,a)||t.before(d,s)){o.push(r);return}const f=o.length;if(t.before(a,s)){const m={columns:[...h],startColumn:i.startColumn,startRow:{...a},endRow:this.cellNavigationService.getRowAbove(s)};o.push(m)}if(p.length>0){const m={columns:p,startColumn:Ps(p,i.startColumn)?i.startColumn:p[0],startRow:this.rowMax([{...s},{...a}]),endRow:this.rowMin([{...n},{...d}])};o.push(m)}t.before(n,d)&&o.push({columns:[...h],startColumn:i.startColumn,startRow:this.cellNavigationService.getRowBelow(n),endRow:{...d}}),o.length-f===1&&(o[o.length-1].id=r.id)}),this.cellRanges=o,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(i=>{(t===void 0||this.rowPositionUtils.before(t,i))&&(t=i)}),t}rowMin(e){let t;return e.forEach(i=>{(t===void 0||this.rowPositionUtils.before(i,t))&&(t=i)}),t}updateValuesOnMove(e){const t=ca(this.gos,e,sn.DOM_DATA_KEY_CELL_CTRL),i=t==null?void 0:t.getCellPosition();if(this.cellHasChanged=!1,!(!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered))){if(t!=null&&t.isEditing()){this.dragService.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i}}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,i=o=>t&&t.rowPinned===o&&this.newestRangeStartCell.rowPinned===o,s=i("top")||i("bottom");if(this.autoScrollService.check(e,s),!this.cellHasChanged)return;const n=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);n&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=n,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,i){this.eventService.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:i}),this.eventService.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:i})}calculateColumnsBetween(e,t){const i=this.visibleColsService.getAllCols(),s=e===t,n=i.indexOf(e),o=p=>z(`column ${p.getId()} is not visible`);if(n<0){o(e);return}const r=s?n:i.indexOf(t);if(r<0){o(t);return}if(s)return[e];const a=Math.min(n,r),d=a===n?r:n,h=[];for(let p=a;p<=d;p++)h.push(i[p]);return h}},yv=class extends ke{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService,this.mouseEventService=e.mouseEventService,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService}postConstruct(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties(),this.shouldDestroyOnEndDragging&&this.destroy()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.ctrlsService.get("gridCtrl").getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===Or.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass())}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),i=this.getGui(),s=he(this.rangeService.getCellRanges()),n=s.startRow,o=s.endRow;if(n&&o&&(this.rowPositionUtils.before(o,n)?(this.setRangeStartRow(o),this.setRangeEndRow(n)):(this.setRangeStartRow(n),this.setRangeEndRow(o))),t!==e||!di(i)){this.setCellCtrl(e);const r=e.getComp().getParentOfValue();r&&r.appendChild(i)}this.setCellRange(s)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging()){et(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function RW(e){const t=e.length;let i=0;if(t<=1)return e;for(let f=0;f<e.length;f++){const m=e[f],v=m.toString().split("e-");if(v.length>1){i=Math.max(i,parseInt(v[1],10));continue}Math.floor(m)!==m&&(i=Math.max(i,m.toString().split(".")[1].length))}let s=0,n=0,o=0,r=0,a=0;for(let f=0;f<t;f++)a=e[f],s+=f,n+=a,r+=f*f,o+=f*a;const d=(t*o-s*n)/(t*r-s*s),h=n/t-d*s/t,p=[];for(let f=0;f<=t;f++)p.push(parseFloat((f*d+h).toFixed(i)));return p}var FW=class extends yv{constructor(){super('<div class="ag-fill-handle"></div>'),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=Or.FILL}wireBeans(e){super.wireBeans(e),this.valueService=e.valueService,this.navigationService=e.navigationService,this.cellNavigationService=e.cellNavigationService,this.visibleColsService=e.visibleColsService}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:i}=this.initialXY,{x:s,y:n}=this.mouseEventService.getNormalisedPosition(e),o=Math.abs(t-s),r=Math.abs(i-n),a=this.getFillHandleDirection();let d;a==="xy"?d=o>r?"x":"y":d=a,d!==this.dragAxis&&(this.dragAxis=d,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const i=this.getCellCtrl();if(!i)return;this.initialPosition=i.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",i=this.getCellRange(),s=i.columns.length,n=this.getRangeStartRow(),o=this.getRangeEndRow();let r;if(!this.isUp&&!this.isLeft)r=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,columnStart:i.columns[0],rowEndIndex:t?o.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?o.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:i.columns[s-1]});else{const a=t?n:this.lastCellMarked;r=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:a.rowIndex,rowStartPinned:a.rowPinned,columnStart:t?this.lastCellMarked.column:i.columns[0],rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnEnd:i.columns[s-1]})}r&&(this.eventService.dispatchEvent({type:"fillStart"}),this.handleValueChanged(i,r,e),this.rangeService.setCellRanges([r]),this.eventService.dispatchEvent({type:"fillEnd",initialRange:i,finalRange:r}))}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}getFillHandleDirection(){var t;const e=(t=Dd(this.gos))==null?void 0:t.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?(z("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}handleValueChanged(e,t,i){var R;const s=this.rangeService.getRangeEndRow(e),n=this.rangeService.getRangeStartRow(e),o=this.rangeService.getRangeEndRow(t),r=this.rangeService.getRangeStartRow(t),a=this.dragAxis==="y";if(this.isReduce&&!((R=Dd(this.gos))!=null&&R.suppressClearOnFillReduction)){const x=a?e.columns:e.columns.filter(I=>t.columns.indexOf(I)<0),T=a?this.cellNavigationService.getRowBelow(o):r;T&&this.clearCellsInRange(T,s,x);return}const d=[],h=[],p=[],f=[];let m=!0,v=0;const w=()=>{d.length=0,h.length=0,p.length=0,f.length=0,v=0},S=(x,T)=>{let I=this.isUp?s:n,V=!1;for(a&&(m=!0,w());!V&&I;){const L=this.rowPositionUtils.getRowNode(I);if(!L)break;a&&x?b(d,x,L,()=>!this.rowPositionUtils.sameRow(I,this.isUp?n:s)):T&&(m=!0,w(),T.forEach(A=>b(d,A,L,()=>A!==(this.isLeft?e.columns[0]:he(e.columns))))),V=this.rowPositionUtils.sameRow(I,this.isUp?r:o),I=this.isUp?this.cellNavigationService.getRowAbove(I):this.cellNavigationService.getRowBelow(I)}},b=(x,T,I,V)=>{var k;let L,A=!1;if(m)L=this.valueService.getValue(T,I),h.push(L),p.push(this.valueService.getValue(T,I,void 0,!0)),f.push(this.valueService.formatValue(T,I,L)),m=V();else{const{value:N,fromUserFunction:$,sourceCol:U,sourceRowNode:Q}=this.processValues({event:i,values:x,initialValues:h,initialNonAggregatedValues:p,initialFormattedValues:f,col:T,rowNode:I,idx:v++});if(L=N,T.isCellEditable(I)){const ce=this.valueService.getValue(T,I);$||(U&&((k=U.getColDef())==null?void 0:k.useValueFormatterForExport)!==!1&&(L=this.valueService.formatValue(U,Q,L)??L),T.getColDef().useValueParserForImport!==!1&&(L=this.valueService.parseValue(T,I,U?L:ea(L),ce))),!$||ce!==L?I.setDataValue(T,L,"rangeService"):A=!0}}A||x.push({value:L,column:T,rowNode:I})};if(a)e.columns.forEach(x=>{S(x)});else{const x=this.isLeft?[...t.columns].reverse():t.columns;S(void 0,x)}}clearCellsInRange(e,t,i){const s={startRow:e,endRow:t,columns:i,startColumn:i[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[s]})}processValues(e){var v;const{event:t,values:i,initialValues:s,initialNonAggregatedValues:n,initialFormattedValues:o,col:r,rowNode:a,idx:d}=e,h=(v=Dd(this.gos))==null?void 0:v.setFillValue,p=this.dragAxis==="y";let f;if(p?f=this.isUp?"up":"down":f=this.isLeft?"left":"right",h){const w=this.gos.addGridCommonParams({event:t,values:i.map(({value:b})=>b),initialValues:s,initialNonAggregatedValues:n,initialFormattedValues:o,currentIndex:d,currentCellValue:this.valueService.getValue(r,a),direction:f,column:r,rowNode:a}),S=h(w);if(S!==!1)return{value:S,fromUserFunction:!0}}const m=!i.some(({value:w})=>{const S=parseFloat(w);return isNaN(S)||S.toString()!==w.toString()});if(t.altKey||!m){if(m&&s.length===1){const R=this.isUp||this.isLeft?-1:1;return{value:parseFloat(he(i).value)+1*R,fromUserFunction:!1}}const{value:w,column:S,rowNode:b}=i[d%i.length];return{value:w,fromUserFunction:!1,sourceCol:S,sourceRowNode:b}}return{value:he(RW(i.map(({value:w})=>Number(w)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(this.rowPositionUtils.sameRow(t,e))return;const i=this.rowPositionUtils.before(t,e),s=this.getRangeStartRow(),n=this.getRangeEndRow();i&&(t.rowPinned==s.rowPinned&&t.rowIndex>=s.rowIndex||s.rowPinned!=n.rowPinned&&t.rowPinned==n.rowPinned&&t.rowIndex<=n.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,i),this.isReduce=!1)}else{const i=e.column,s=t.column;if(i===s)return;const n=this.visibleColsService.getAllCols(),o=n.indexOf(i),r=n.indexOf(s);r<=o&&r>=n.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,r<o),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,i){const{navigationService:s,rangeService:n}=this;let o=e;do{const r=this.getCellRange(),a=r.columns.length;for(let d=0;d<a;d++){const h=r.columns[d],f={...{rowIndex:o.rowIndex,rowPinned:o.rowPinned},column:h},m=n.isCellInSpecificRange(f,r),v=this.rowPositionUtils.sameRow(o,e);if(i&&(this.isUp=!0),!v){const w=s.getCellByPosition(f);if(w){this.markedCells.push(w);const S=w.getComp();m||(S.addOrRemoveCssClass("ag-selection-fill-left",d===0),S.addOrRemoveCssClass("ag-selection-fill-right",d===a-1)),S.addOrRemoveCssClass(i?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(o,t))}}}if(this.rowPositionUtils.sameRow(o,t))break}while(o=i?this.cellNavigationService.getRowAbove(o):this.cellNavigationService.getRowBelow(o))}reduceVertical(e,t){let i=e;do{const s=this.getCellRange(),n=s.columns.length,o=this.rowPositionUtils.sameRow(i,t);for(let r=0;r<n;r++){const d={...{rowIndex:i.rowIndex,rowPinned:i.rowPinned},column:s.columns[r]},h=this.navigationService.getCellByPosition(d);h&&(this.markedCells.push(h),h.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(i,t)))}if(o)break}while(i=this.cellNavigationService.getRowAbove(i))}extendHorizontal(e,t,i){const s=this.visibleColsService.getAllCols(),n=s.indexOf(i?t.column:e.column),o=s.indexOf(i?this.getCellRange().columns[0]:t.column),r=i?0:1,a=s.slice(n+r,o+r),d=this.getRangeStartRow(),h=this.getRangeEndRow();a.forEach(p=>{let f=d,m=!1;do{m=this.rowPositionUtils.sameRow(f,h);const v=this.navigationService.getCellByPosition({rowIndex:f.rowIndex,rowPinned:f.rowPinned,column:p});if(v){this.markedCells.push(v);const w=v.getComp();w.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(f,d)),w.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(f,h)),i?(this.isLeft=!0,w.addOrRemoveCssClass("ag-selection-fill-left",p===a[0])):w.addOrRemoveCssClass("ag-selection-fill-right",p===he(a))}f=this.cellNavigationService.getRowBelow(f)}while(!m)})}reduceHorizontal(e,t){const i=this.visibleColsService.getAllCols(),s=i.indexOf(t.column),n=i.indexOf(e.column),o=i.slice(s,n),r=this.getRangeStartRow(),a=this.getRangeEndRow();o.forEach(d=>{let h=r,p=!1;do{p=this.rowPositionUtils.sameRow(h,a);const f=this.navigationService.getCellByPosition({rowIndex:h.rowIndex,rowPinned:h.rowPinned,column:d});f&&(this.markedCells.push(f),f.getComp().addOrRemoveCssClass("ag-selection-fill-right",d===o[0])),h=this.cellNavigationService.getRowBelow(h)}while(!p)})}refresh(e){const t=this.rangeService.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}},EW=class extends yv{constructor(){super('<div class="ag-range-handle"></div>'),this.type=Or.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const i=this.rangeService.getCellRanges(),s=he(i);this.rangeFixed||(this.fixRangeStartEnd(s),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},i.length===2&&i[0].type===Mu.DIMENSION&&s.type===Mu.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(s))&&this.rangeService.updateRangeEnd(i[0],{...this.endPosition,column:i[0].columns[0]},!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=he(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),i=this.rangeService.getRangeEndRow(e),s=e.columns[0];e.startRow=t,e.endRow=i,e.startColumn=s}},xW=class extends G{constructor(){super(...arguments),this.beanName="selectionHandleFactory"}createSelectionHandle(e){return this.createBean(e===Or.RANGE?new EW:new FW)}},Vh="32.2.2",bv={version:Vh,moduleName:`${Rt.RangeSelectionModule}-core`,beans:[bW,xW],dependantModules:[Gm]},PW={version:Vh,moduleName:`${Rt.RangeSelectionModule}-api`,apiFunctions:{getCellRanges:SW,addCellRange:yW,clearRangeSelection:Sv,clearCellSelection:Sv},dependantModules:[bv]},DW={version:Vh,moduleName:Rt.RangeSelectionModule,dependantModules:[bv,PW]},uc={exports:{}};/**
21
+ )`}function c(){const u=i.value;if(!u)return;const p=[a(u),s(u)].filter(h=>h!==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 d=Ms(c);n.onMounted(c),Ge(window,"scroll",d,!0),Ge(window,"resize",d,!0)}function fu(i,e){Fd(()=>{at(n.unref(i),t=>{$d(t,()=>e(t))})}),n.onUnmounted(()=>{at(n.unref(i),t=>{zd(t)})})}const nr={item:"sortable__item",animate:"sortable__animate"},co=i=>i.getBoundingClientRect().y,pu=i=>{const{y:e,height:t}=i.getBoundingClientRect();return e+Math.ceil(t/2)},Gk=i=>{const{y:e,height:t}=i.getBoundingClientRect();return e+t};function Kk(i,e){const t={item:void 0,options(){var T;return[...((T=i.value)==null?void 0:T.children)??[]]}},a=n.computed(()=>t.options()),s=e.shakeBuffer??10,c=e.reorderDelay??100;function d(T){const C=e.handle?this.querySelector(e.handle):null;C&&!C.contains(T.target)||(this.classList.remove(nr.animate),this.classList.add(nr.item),t.item={el:this,y:T.y,dy:0,orderChanged:!1})}function u(T){const C=t.options();return C.slice(0,C.indexOf(T))}function p(T){const C=t.options();return C.slice(C.indexOf(T)+1)}function h(T,C){const k=t.options().filter(v=>v!==C),S=k.indexOf(T);return k.splice(S,0,C),k}function g(T,C){const k=t.options().filter(v=>v!==C),S=k.indexOf(T);return k.splice(S+1,0,C),k}function x(T,C){T.dy=C-T.y,T.el.style.setProperty("transform",`translateY(${T.dy}px)`)}function R(T){var C;if(!t.item)return;const{el:k}=t.item;if(!k.isConnected){t.item=void 0;return}const S=T.map(W=>co(W)),v=co(k);(C=i.value)==null||C.replaceChildren(...T);const I=co(k),K=T.map(W=>co(W)),j=[];for(let W=0;W<K.length;W++){const O=T[W];if(O===t.item.el)continue;const B=K[W],P=S[W]-B;O.style.transform=`translateY(${P}px)`,j.push(O)}const z=I-v;t.item.y=t.item.y+z,t.item.dy=t.item.dy-z,t.item.orderChanged=!0,t.item.el.style.setProperty("transform",`translateY(${t.item.dy}px)`),j.forEach(W=>W.classList.remove(nr.animate)),requestAnimationFrame(function(){j.forEach(W=>{W.classList.add(nr.animate),W.style.transform="",W.addEventListener("transitionend",()=>{W.classList.remove(nr.animate)})})})}Ge(window,"mousemove",T=>{if(!t.item)return;const{el:C}=t.item;x(t.item,T.y);const k=co(t.item.el),S=Gk(t.item.el),v=u(C),I=p(C);v.forEach(K=>{const j=pu(K);k+s<j&&R(h(K,C))}),I.forEach(K=>{const j=pu(K);S-s>j&&R(g(K,C))})}),Ge(window,"mouseup",()=>{if(!t.item)return;const{el:T,orderChanged:C}=t.item;T.classList.add(nr.animate),T.style.removeProperty("transform"),T.addEventListener("transitionend",()=>{T.classList.remove(nr.animate,nr.item)}),setTimeout(()=>{if(!C)return;const k=t.options().map(v=>Number(v.getAttribute("data-index"))),S=i.value;if(S){for(const v of t.options())S.removeChild(v);a.value.forEach(v=>{S.appendChild(v)})}e.onChange(k)},c),t.item=void 0}),n.watchEffect(()=>{a.value.forEach((T,C)=>{T.removeEventListener("mousedown",d),T.addEventListener("mousedown",d),T.setAttribute("data-index",String(C))})})}function Yk(i,e){let t;n.onMounted(()=>{t=setInterval(i,e)}),n.onUnmounted(()=>clearInterval(t))}function Jk(i,e,t){const a=n.reactive({data:Os.deepClone(e(i.value)),changed:!1});return n.watch(()=>a.data,s=>{a.changed?t(Os.deepClone(s)):a.changed=!0},{deep:!0}),n.watch(i,s=>{Object.assign(a,{data:Os.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),a}function Xk(i){const e=n.reactive({isLoading:!1,result:void 0,error:void 0,async run(...t){this.isLoading=!0,this.error=void 0;try{this.result=await i(...t)}catch(a){this.error=a}finally{this.isLoading=!1}},debounce(t,a=1e3){return wd(()=>{const s=t();this.run(...s).catch(console.error)},a)}});return e.run=e.run.bind(e),e}function Qk(i,e){function t(d,u){const p=n.unref(i);if(!p)return;const h=`translate(${u.x-d.x}px, ${u.y-d.y}px)`;p.style.setProperty("transform",h),e(u)}function a(d){const u=p=>t(d,p);document.addEventListener("mousemove",u),document.addEventListener("mouseup",()=>{const p=n.unref(i);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 d;(d=n.unref(i))==null||d.addEventListener("mousedown",a)}function c(){var d;(d=n.unref(i))==null||d.removeEventListener("mousedown",a)}n.onMounted(s),n.onUnmounted(c)}const e1={class:"ui-slider__wrapper"},t1={class:"ui-slider__label-section"},n1={key:0,class:"text-s"},r1={class:"ui-slider__base"},i1={class:"ui-slider__container"},o1={class:"ui-slider__container ui-slider__container-thumb"},a1=["data-percent"],s1=["data-percent"],l1=["data-percent"],c1={key:0,class:"ui-slider__error"},d1=n.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(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),d=n.ref(),u=n.ref(),p=n.ref(),h=n.ref(),g=n.computed(()=>s.max-s.min),x=n.computed(()=>s),R=sl(x),T=n.computed(()=>ht((s.modelValue[0]??0)+c.deltaValue1,s.min,s.max)),C=n.computed(()=>ht((s.modelValue[1]??0)+c.deltaValue2,s.min,s.max)),k=n.computed(()=>ht((s.modelValue[2]??0)+c.deltaValue3,s.min,s.max)),S=n.computed(()=>{const ae=s.modelValue;if(!(Array.isArray(ae)&&ae.length===3&&ae.every(Ce=>Number.isFinite(Ce))))return"Expected model [number, number, number]";const J=[];return[...s.modelValue].forEach(Ce=>{Ce>s.max&&J.push(`Max model value must be lower than max props ${s.max}.`),Ce<s.min&&J.push("Min model value must be greater than max props.")}),J.length>0?J.join(" "):s.error}),v=n.computed(()=>(T.value-s.min)/g.value),I=n.computed(()=>(C.value-s.min)/g.value),K=n.computed(()=>(k.value-s.min)/g.value),j=n.computed(()=>Z()),z=n.computed(()=>({right:j.value[0]+"%",left:100-j.value[2]+"%"})),W=n.computed(()=>({right:Math.ceil((1-v.value)*100)+"%"})),O=n.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"})),B=n.computed(()=>({right:Math.ceil((1-K.value)*100)+"%"}));Kn(u,ae=>{var J;at((J=n.unref(d))==null?void 0:J.getBoundingClientRect(),Ce=>{const{dx:Be}=ae;c.deltaValue1=Be/Ce.width*g.value,u.value&&P(u.value,s.modelValue[0],c.deltaValue1),ae.stop&&(H([L(T.value),L(C.value),L(k.value)]),c.deltaValue1=0)})}),Kn(p,ae=>{var J;at((J=n.unref(d))==null?void 0:J.getBoundingClientRect(),Ce=>{const{dx:Be}=ae;c.deltaValue2=Be/Ce.width*g.value,p.value&&P(p.value,s.modelValue[1],c.deltaValue2),ae.stop&&(H([L(T.value),L(C.value),L(k.value)]),c.deltaValue2=0)})}),Kn(h,ae=>{var J;at((J=n.unref(d))==null?void 0:J.getBoundingClientRect(),Ce=>{const{dx:Be}=ae;c.deltaValue3=Be/Ce.width*g.value,h.value&&P(h.value,s.modelValue[2],c.deltaValue3),ae.stop&&(H([L(T.value),L(C.value),L(k.value)]),c.deltaValue3=0)})});function P(ae,J,Ce){const Be=L(ht((J??0)+Ce,s.min,s.max));ae.dataset.percent=`${Be}${s.measure}`,oe()}function Z(){const ae=Math.ceil((1-v.value)*100),J=Math.ceil((1-I.value)*100),Ce=Math.ceil((1-K.value)*100);return[ae,J,Ce].sort((Be,Ar)=>Be-Ar)}function L(ae){const J=ht(ae,s.min,s.max);return Math.round((J+Number.EPSILON)*(1/s.step))/(1/s.step)}function H(ae){a("update:modelValue",ae)}function oe(){const ae=Number(W.value.right.substring(0,W.value.right.length-1)),J=Number(O.value.right.substring(0,O.value.right.length-1)),Ce=Number(B.value.right.substring(0,B.value.right.length-1)),Be=[{r:ae,th:u},{r:J,th:p},{r:Ce,th:h}].sort((Ar,or)=>Ar.r-or.r);Be[0].th.value&&(Be[0].th.value.dataset.hint="high"),Be[1].th.value&&(Be[1].th.value.dataset.hint="mid"),Be[2].th.value&&(Be[2].th.value.dataset.hint="low")}function de(ae,J){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ae.code)&&ae.preventDefault();const Ce=ae.code==="ArrowUp"||ae.code==="ArrowRight"?s.step*1:ae.code==="ArrowDown"||ae.code==="ArrowLeft"?s.step*-1:0,Be=[...s.modelValue];Be[J]=ht(Be[J]+Ce,s.min,s.max),H(Be),oe()}return n.onMounted(()=>{oe()}),(ae,J)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[n.createElementVNode("div",{class:n.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[n.createElementVNode("div",e1,[n.createElementVNode("div",t1,[ae.label?(n.openBlock(),n.createElementBlock("label",n1,[n.createElementVNode("span",null,n.toDisplayString(ae.label),1),J[3]||(J[3]=n.createTextVNode()),n.unref(t).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(ae.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),J[11]||(J[11]=n.createTextVNode()),n.createElementVNode("div",r1,[n.createElementVNode("div",i1,[n.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[n.createElementVNode("div",{class:"ui-slider__progress",style:n.normalizeStyle(z.value)},null,4)],512)]),J[10]||(J[10]=n.createTextVNode()),n.createElementVNode("div",o1,[s.breakpoints?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(R),(Ce,Be)=>(n.openBlock(),n.createElementBlock("div",{key:Be,style:n.normalizeStyle({right:`${Ce}%`}),class:"ui-slider__thumb-step"},null,4))),128)):n.createCommentVNode("",!0),J[7]||(J[7]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:n.normalizeStyle(W.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:J[0]||(J[0]=Ce=>de(Ce,0))},J[4]||(J[4]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,a1),J[8]||(J[8]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:n.normalizeStyle(O.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:J[1]||(J[1]=Ce=>de(Ce,1))},J[5]||(J[5]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,s1),J[9]||(J[9]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:n.normalizeStyle(B.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:J[2]||(J[2]=Ce=>de(Ce,2))},J[6]||(J[6]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,l1)])])]),J[12]||(J[12]=n.createTextVNode()),J[13]||(J[13]=n.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),J[14]||(J[14]=n.createTextVNode()),S.value?(n.openBlock(),n.createElementBlock("div",c1,n.toDisplayString(S.value),1)):n.createCommentVNode("",!0)],2))}}),u1={class:"ui-input-range__separator"},f1=n.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(i,{emit:e}){const t=i,a=e,s=n.reactive({left:t.modelValue[0],right:t.modelValue[1]}),c=n.ref(!1),d=n.computed(()=>(c.value,"ui-input-range-focused")),u=n.computed({get(){return{left:Math.min(...t.modelValue),right:Math.max(...t.modelValue)}},set(){}});n.watch(()=>u.value,g=>(s.left=g.left)&&(s.right=g.right));function p(){a("update:modelValue",[+s.left,+s.right]),a("change",[+s.left,+s.right])}function h(g,x){const R=x.target.value;/^[0-9]{0,2}$/.test(R)?g?s.left=+R:s.right=+R:g?s.left=+R.slice(0,R.length-1):s.right=+R.slice(0,R.length-1)}return(g,x)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:[d.value,"ui-input-range"]},g.$attrs),[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":x[0]||(x[0]=R=>u.value.left=R),class:"text-s",type:"text",onChange:p,onFocus:x[1]||(x[1]=R=>c.value=!0),onFocusout:x[2]||(x[2]=R=>c.value=!1),onInput:x[3]||(x[3]=R=>h(!0,R))},null,544),[[n.vModelText,u.value.left]]),x[8]||(x[8]=n.createTextVNode()),n.createElementVNode("div",u1,n.toDisplayString(t.separator),1),x[9]||(x[9]=n.createTextVNode()),n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":x[4]||(x[4]=R=>u.value.right=R),class:"text-s",type:"text",onChange:p,onFocus:x[5]||(x[5]=R=>c.value=!0),onFocusout:x[6]||(x[6]=R=>c.value=!1),onInput:x[7]||(x[7]=R=>h(!1,R))},null,544),[[n.vModelText,u.value.right]])],16))}}),p1={class:"ui-slider__wrapper"},h1={class:"ui-slider__label-section"},m1={key:0,class:"text-s"},g1={key:1,class:"ui-slider__value-static text-s"},y1={class:"ui-slider__base"},_1={class:"ui-slider__container"},w1={class:"ui-slider__container ui-slider__container-thumb"},b1={class:"ui-slider__input-wrapper d-flex"},k1={key:0,class:"ui-slider__error"},x1=n.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(i,{emit:e}){const t=n.useSlots(),a=e,s=i,c=n.reactive({deltaValue1:0,deltaValue2:0}),d=n.ref(),u=n.ref(),p=n.ref(),h=n.ref(s.modelValue),g=n.ref(s.modelValue[0]),x=n.ref(s.modelValue[1]),R=n.computed(()=>s),T=sl(R),C=n.computed(()=>[g.value,x.value].sort((oe,de)=>oe-de).join("-")),k=n.computed(()=>s.max-s.min),S=n.computed(()=>ht((s.modelValue[0]??0)+c.deltaValue1,s.min,s.max)),v=n.computed(()=>ht((s.modelValue[1]??0)+c.deltaValue2,s.min,s.max)),I=n.computed(()=>{const oe=s.modelValue;return Array.isArray(oe)&&oe.length===2&&oe.every(de=>Number.isFinite(de))?s.error:"Expected model [number, number]"}),K=n.computed(()=>(S.value-s.min)/k.value),j=n.computed(()=>(v.value-s.min)/k.value),z=n.computed(()=>P()),W=n.computed(()=>({right:z.value[0]+"%",left:100-z.value[1]+"%"})),O=n.computed(()=>({right:Math.ceil((1-K.value)*100)+"%"})),B=n.computed(()=>({right:Math.ceil((1-j.value)*100)+"%"}));n.watch(()=>s.modelValue,oe=>{h.value=oe,g.value=+oe[0],x.value=+oe[1]},{immediate:!0}),Kn(u,oe=>{var de;at((de=n.unref(d))==null?void 0:de.getBoundingClientRect(),ae=>{const{dx:J}=oe;c.deltaValue1=J/ae.width*k.value,g.value=Z(ht((s.modelValue[0]??0)+c.deltaValue1,s.min,s.max)),h.value=[g.value,x.value].sort((Ce,Be)=>Ce-Be),oe.stop&&(L([Z(S.value),Z(v.value)]),c.deltaValue1=0)})}),Kn(p,oe=>{var de;at((de=n.unref(d))==null?void 0:de.getBoundingClientRect(),ae=>{const{dx:J}=oe;c.deltaValue2=J/ae.width*k.value,x.value=Z(ht((s.modelValue[1]??0)+c.deltaValue2,s.min,s.max)),h.value=[g.value,x.value].sort((Ce,Be)=>Ce-Be),oe.stop&&(L([Z(S.value),Z(v.value)]),c.deltaValue2=0)})});function P(){const oe=Math.ceil((1-K.value)*100),de=Math.ceil((1-j.value)*100);return[oe,de].sort((ae,J)=>ae-J)}function Z(oe){const de=ht(oe,s.min,s.max);return Math.round((de+Number.EPSILON)*(1/s.step))/(1/s.step)}function L(oe){a("update:modelValue",oe)}function H(oe,de){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(oe.code)&&oe.preventDefault();const ae=oe.code==="ArrowUp"||oe.code==="ArrowRight"?s.step*1:oe.code==="ArrowDown"||oe.code==="ArrowLeft"?s.step*-1:0,J=[...s.modelValue];J[de]=ht(J[de]+ae,s.min,s.max),L(J)}return(oe,de)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[n.createElementVNode("div",{class:n.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[n.createElementVNode("div",p1,[n.createElementVNode("div",h1,[oe.label?(n.openBlock(),n.createElementBlock("label",m1,[n.createElementVNode("span",null,n.toDisplayString(oe.label),1),de[3]||(de[3]=n.createTextVNode()),n.unref(t).tooltip?(n.openBlock(),n.createBlock(n.unref(Zt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(oe.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),de[4]||(de[4]=n.createTextVNode()),s.mode==="text"?(n.openBlock(),n.createElementBlock("div",g1,n.toDisplayString(C.value),1)):n.createCommentVNode("",!0)]),de[10]||(de[10]=n.createTextVNode()),n.createElementVNode("div",y1,[n.createElementVNode("div",_1,[n.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[n.createElementVNode("div",{class:"ui-slider__progress",style:n.normalizeStyle(W.value)},null,4)],512)]),de[9]||(de[9]=n.createTextVNode()),n.createElementVNode("div",w1,[s.breakpoints?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(T),(ae,J)=>(n.openBlock(),n.createElementBlock("div",{key:J,style:n.normalizeStyle({right:`${ae}%`}),class:"ui-slider__thumb-step"},null,4))),128)):n.createCommentVNode("",!0),de[7]||(de[7]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:n.normalizeStyle(O.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:de[0]||(de[0]=ae=>H(ae,0))},de[5]||(de[5]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),de[8]||(de[8]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:n.normalizeStyle(B.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:de[1]||(de[1]=ae=>H(ae,1))},de[6]||(de[6]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),de[11]||(de[11]=n.createTextVNode()),n.createElementVNode("div",b1,[s.mode==="input"?(n.openBlock(),n.createBlock(f1,{key:0,modelValue:h.value,"onUpdate:modelValue":de[2]||(de[2]=ae=>h.value=ae),class:"ui-focused-border",onChange:L},null,8,["modelValue"])):n.createCommentVNode("",!0)])],2),de[12]||(de[12]=n.createTextVNode()),I.value?(n.openBlock(),n.createElementBlock("div",k1,n.toDisplayString(I.value),1)):n.createCommentVNode("",!0)],2))}}),v1=n.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(i,{emit:e}){const t=e,a=i,s=n.ref(),c=n.computed(()=>a.clientHeight/(a.scrollHeight||1)),d=n.computed(()=>c.value<1),u=n.computed(()=>{const p=n.unref(c);return{top:a.scrollTop*p+"px",height:Math.floor(a.clientHeight*p)+"px"}});return Ge(s,"pointerdown",p=>{const h={clientY:p.clientY},g=Ys(document,"mousemove",x=>{const R=(x.clientY-h.clientY)/c.value;t("update:scrollTop",a.scrollTop+R),h.clientY=x.clientY});["mouseup","pointercancel"].forEach(x=>{document.addEventListener(x,g,{once:!0})})}),(p,h)=>d.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"v-scroll"},[n.createElementVNode("div",{class:"v-scroll__scrollbar",style:n.normalizeStyle(u.value)},null,4)],512)):n.createCommentVNode("",!0)}}),C1=n.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(i,{emit:e}){const t=e,a=i,s=n.ref(),c=n.computed(()=>a.clientWidth/(a.scrollWidth||1)),d=n.computed(()=>c.value<1),u=n.computed(()=>{const p=n.unref(c);return{left:a.scrollLeft*p+"px",width:Math.floor(a.clientWidth*p)+"px"}});return Ge(s,"pointerdown",p=>{const h={clientX:p.clientX},g=Ys(document,"mousemove",x=>{const R=(x.clientX-h.clientX)/c.value;t("update:scrollLeft",a.scrollLeft+R),h.clientX=x.clientX});["mouseup","pointercancel"].forEach(x=>{document.addEventListener(x,g,{once:!0})})}),(p,h)=>d.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"h-scroll"},[n.createElementVNode("div",{class:"h-scroll__scrollbar",style:n.normalizeStyle(u.value)},null,4)],512)):n.createCommentVNode("",!0)}}),E1={class:"ui-scrollable"},S1=n.defineComponent({__name:"Scrollable",setup(i){const e=n.ref(),t=n.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function a(u){G_(t,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,a(p)};function c(u){at(n.unref(e),p=>{p.scrollTop=u,a(p)})}function d(u){at(n.unref(e),p=>{p.scrollLeft=u,a(p)})}return fu(e,u=>{at(u,p=>a(p))}),n.onMounted(()=>{at(n.unref(e),u=>{a(u),u.addEventListener("wheel",s)})}),n.onUnmounted(()=>{at(n.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(n.openBlock(),n.createElementBlock("div",E1,[n.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:s},[n.renderSlot(u.$slots,"default")],544),p[2]||(p[2]=n.createTextVNode()),n.createVNode(v1,{"scroll-top":t.scrollTop,"client-height":t.clientHeight,"scroll-height":t.scrollHeight,onWheel:p[0]||(p[0]=n.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":c},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=n.createTextVNode()),n.createVNode(C1,{"scroll-left":t.scrollLeft,"client-width":t.clientWidth,"scroll-width":t.scrollWidth,onWheel:p[1]||(p[1]=n.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":d},null,8,["scroll-left","client-width","scroll-width"])]))}}),T1="add.svg",V1="checkmark.svg",N1="clear.svg",B1="clipboard.svg",O1="close.svg",A1="comp.svg",R1="compare.svg",D1="copy.svg",I1="edit.svg",M1="error.svg",P1="filter.svg",L1="help.svg",F1="info.svg",$1="link.svg",z1="loading.svg",Z1="lock.svg",U1="maximize.svg",j1="minimize.svg",W1="minus.svg",H1="open.svg",q1="pause.svg",G1="play.svg",K1="required.svg",Y1="restart.svg",J1="sort.svg",X1="sorter.svg",Q1="stop.svg",ex="success.svg",tx="warning.svg",nx="zip.svg",rx={add:T1,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:V1,"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",clear:N1,"clipboard-copied":"clipboard-copied.svg",clipboard:B1,close:O1,comp:A1,compare:R1,copy:D1,"data-dimentions":"data-dimentions.svg",delete:"delete.svg","drag-dots":"drag-dots.svg",edit:I1,error:M1,export:"export.svg","filter-2":"filter-2.svg",filter:P1,help:L1,import:"import.svg",info:F1,"link-arrow":"link-arrow.svg",link:$1,loading:z1,lock:Z1,maximize:U1,minimize:j1,minus:W1,"more-horizontal":"more-horizontal.svg",open:H1,pause:q1,play:G1,required:K1,restart:Y1,"settings-2":"settings-2.svg",sort:J1,sorter:X1,stop:Q1,success:ex,warning:tx,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:nx},ix="add.svg",ox="annotate.svg",ax="annotation.svg",sx="area.svg",lx="axes.svg",cx="bar.svg",dx="bindot.svg",ux="boxplot.svg",fx="bubble.svg",px="canvas.svg",hx="checkbox.svg",mx="checkmark.svg",gx="clipboard.svg",yx="close.svg",_x="code.svg",wx="color.svg",bx="columns.svg",kx="copy.svg",xx="cpu.svg",vx="dna.svg",Cx="duplicate.svg",Ex="edit.svg",Sx="error.svg",Tx="filter.svg",Vx="generate.svg",Nx="graph.svg",Bx="heatmap.svg",Ox="help.svg",Ax="hide.svg",Rx="jitter.svg",Dx="layers.svg",Ix="learn.svg",Mx="legend.svg",Px="line.svg",Lx="linetype.svg",Fx="link.svg",$x="loading.svg",zx="local.svg",Zx="logout.svg",Ux="menu.svg",jx="minus.svg",Wx="pin.svg",Hx="position.svg",qx="progress.svg",Gx="publications.svg",Kx="restart.svg",Yx="reverse.svg",Jx="rotation.svg",Xx="save.svg",Qx="search.svg",ev="show.svg",tv="sina.svg",nv="skatterplot.svg",rv="sort.svg",iv="statistics.svg",ov="stroke.svg",av="success.svg",sv="table.svg",lv="template.svg",cv="venn.svg",dv="violin.svg",uv="warning.svg",fv="wetlab.svg",pv={"add-layer":"add-layer.svg",add:ix,annotate:ox,annotation:ax,area:sx,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:lx,"bar-error":"bar-error.svg","bar-trend":"bar-trend.svg",bar:cx,bindot:dx,"box-dot":"box-dot.svg","boxplot-1":"boxplot-1.svg","boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:ux,bubble:fx,canvas:px,checkbox:hx,checkmark:mx,"chevron-down":"chevron-down.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:gx,close:yx,"cloud-down":"cloud-down.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-up":"cloud-up.svg","code-2":"code-2.svg",code:_x,color:wx,columns:bx,"connected-points":"connected-points.svg",copy:kx,cpu:xx,"cross-bars":"cross-bars.svg","dark-mode":"dark-mode.svg",delete:"delete.svg","dendrogram-X-1":"dendrogram-X-1.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-1":"dendrogram-Y-1.svg","dendrogram-Y":"dendrogram-Y.svg",dna:vx,"download-files":"download-files.svg",duplicate:Cx,edit:Ex,"error-bar":"error-bar.svg",error:Sx,"expand-left":"expand-left.svg","expand-right":"expand-right.svg","export-2":"export-2.svg",export:"export.svg","external-link":"external-link.svg","fill-color":"fill-color.svg","filter-on":"filter-on.svg",filter:Tx,"filters-gate":"filters-gate.svg","fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type":"frame-type.svg",generate:Vx,graph:Nx,heatmap:Bx,help:Ox,hide:Ax,"import-2":"import-2.svg","import-download":"import-download.svg","info-circle-outline":"info-circle-outline.svg",jitter:Rx,layers:Dx,learn:Ix,legend:Mx,"light-mode":"light-mode.svg","line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:Px,linetype:Lx,"link-disabled":"link-disabled.svg",link:Fx,loading:$x,local:zx,logout:Zx,menu:Ux,minus:jx,"more-horizontal":"more-horizontal.svg","outlier-shape":"outlier-shape.svg","paper-clip":"paper-clip.svg",pin:Wx,position:Hx,"progress-2":"progress-2.svg",progress:qx,publications:Gx,"radio-btn":"radio-btn.svg",restart:Kx,reverse:Yx,rotation:Jx,save:Xx,search:Qx,"server-2":"server-2.svg","settings-2":"settings-2.svg",show:ev,sina:tv,skatterplot:nv,"social-media":"social-media.svg",sort:rv,"stacked-bar":"stacked-bar.svg",statistics:iv,"strip-plot":"strip-plot.svg","stroke-non":"stroke-non.svg",stroke:ov,success:av,"table-upload":"table-upload.svg",table:sv,template:lv,"title-position":"title-position.svg","upload-files":"upload-files.svg",venn:cv,"violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:dv,warning:uv,wetlab:fv,"zoom-in":"zoom-in.svg"};function hv(){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 mv=["checkmark","import","clear","chevron-right","add","play","loading","arrow-right","clipboard","link","comp","close","restart","stop","settings-2"],gv=["paper-clip","cloud-up","success","restart","close","clipboard"],yv={allCssVariables:hv(),icons16:rx,icons24:pv},_v={class:"block__not-found"},wv=n.defineComponent({__name:"NotFound",setup(i){const t=Es().useApp(),a=()=>{t.updateNavigationState(s=>{s.href="/"})};return(s,c)=>(n.openBlock(),n.createElementBlock("div",_v,[n.createElementVNode("h1",null,"Not found route: "+n.toDisplayString(n.unref(t).navigationState.href),1),n.createVNode(n.unref(Hs),{onClick:n.withModifiers(a,["stop"])},{default:n.withCtx(()=>c[0]||(c[0]=[n.createTextVNode("Return to main page")])),_:1})]))}}),ll=(i,e)=>{const t=i.__vccOpts||i;for(const[a,s]of e)t[a]=s;return t},bv={},kv={class:"block__loader-page"};function xv(i,e){return n.openBlock(),n.createElementBlock("div",kv,e[0]||(e[0]=[n.createElementVNode("div",{class:"loader-container"},[n.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const vv=ll(bv,[["render",xv]]),Cv={class:"block block__layout"},Ev={key:0},Sv=n.defineComponent({__name:"BlockLayout",setup(i){const e=Es(),t=c=>{try{return new URL(c,"http://dummy").pathname}catch{console.error("Invalid href",c);return}},a=n.computed(()=>e.loaded?e.useApp().href:void 0),s=n.computed(()=>{if(e.loaded){const c=e.useApp(),d=t(c.navigationState.href);return d?c.routes[d]:void 0}});return(c,d)=>(n.openBlock(),n.createElementBlock("div",Cv,[n.unref(e).error?(n.openBlock(),n.createElementBlock("div",Ev,n.toDisplayString(n.unref(e).error),1)):n.unref(e).loaded?s.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(s.value),{key:a.value})):(n.openBlock(),n.createBlock(wv,{key:3})):(n.openBlock(),n.createBlock(vv,{key:1},{default:n.withCtx(()=>d[0]||(d[0]=[n.createTextVNode("Loading...")])),_:1}))]))}});var da={exports:{}};/**
224
22
  * @license
225
23
  * Lodash <https://lodash.com/>
226
24
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
227
25
  * Released under MIT license <https://lodash.com/license>
228
26
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
229
27
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
230
- */uc.exports,function(e,t){(function(){var i,s="4.17.21",n=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",r="Expected a function",a="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",f=1,m=2,v=4,w=1,S=2,b=1,R=2,x=4,T=8,I=16,V=32,L=64,A=128,k=256,N=512,$=30,U="...",Q=800,ce=16,me=1,ue=2,ie=3,Me=1/0,Ge=9007199254740991,ro=17976931348623157e292,yn=NaN,ni=4294967295,oz=ni-1,rz=ni>>>1,lz=[["ary",A],["bind",b],["bindKey",R],["curry",T],["curryRight",I],["flip",N],["partial",V],["partialRight",L],["rearg",k]],ir="[object Arguments]",fc="[object Array]",az="[object AsyncFunction]",Al="[object Boolean]",Ml="[object Date]",cz="[object DOMException]",mc="[object Error]",Cc="[object Function]",Vv="[object GeneratorFunction]",os="[object Map]",kl="[object Number]",dz="[object Null]",Bs="[object Object]",Nv="[object Promise]",uz="[object Proxy]",Il="[object RegExp]",rs="[object Set]",Ll="[object String]",vc="[object Symbol]",hz="[object Undefined]",_l="[object WeakMap]",pz="[object WeakSet]",Ol="[object ArrayBuffer]",sr="[object DataView]",zh="[object Float32Array]",Uh="[object Float64Array]",$h="[object Int8Array]",Kh="[object Int16Array]",jh="[object Int32Array]",Zh="[object Uint8Array]",qh="[object Uint8ClampedArray]",Yh="[object Uint16Array]",Qh="[object Uint32Array]",gz=/\b__p \+= '';/g,fz=/\b(__p \+=) '' \+/g,mz=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bv=/&(?:amp|lt|gt|quot|#39);/g,Gv=/[&<>"']/g,Cz=RegExp(Bv.source),vz=RegExp(Gv.source),wz=/<%-([\s\S]+?)%>/g,Sz=/<%([\s\S]+?)%>/g,Hv=/<%=([\s\S]+?)%>/g,yz=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bz=/^\w*$/,Rz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xh=/[\\^$.*+?()[\]{}|]/g,Fz=RegExp(Xh.source),Jh=/^\s+/,Ez=/\s/,xz=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pz=/\{\n\/\* \[wrapped with (.+)\] \*/,Dz=/,? & /,Tz=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Az=/[()=,{}\[\]\/\s]/,Mz=/\\(\\)?/g,kz=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Wv=/\w*$/,Iz=/^[-+]0x[0-9a-f]+$/i,Lz=/^0b[01]+$/i,_z=/^\[object .+?Constructor\]$/,Oz=/^0o[0-7]+$/i,Vz=/^(?:0|[1-9]\d*)$/,Nz=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wc=/($^)/,Bz=/['\n\r\u2028\u2029\\]/g,Sc="\\ud800-\\udfff",Gz="\\u0300-\\u036f",Hz="\\ufe20-\\ufe2f",Wz="\\u20d0-\\u20ff",zv=Gz+Hz+Wz,Uv="\\u2700-\\u27bf",$v="a-z\\xdf-\\xf6\\xf8-\\xff",zz="\\xac\\xb1\\xd7\\xf7",Uz="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$z="\\u2000-\\u206f",Kz=" \\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",Kv="A-Z\\xc0-\\xd6\\xd8-\\xde",jv="\\ufe0e\\ufe0f",Zv=zz+Uz+$z+Kz,ep="['’]",jz="["+Sc+"]",qv="["+Zv+"]",yc="["+zv+"]",Yv="\\d+",Zz="["+Uv+"]",Qv="["+$v+"]",Xv="[^"+Sc+Zv+Yv+Uv+$v+Kv+"]",tp="\\ud83c[\\udffb-\\udfff]",qz="(?:"+yc+"|"+tp+")",Jv="[^"+Sc+"]",ip="(?:\\ud83c[\\udde6-\\uddff]){2}",sp="[\\ud800-\\udbff][\\udc00-\\udfff]",nr="["+Kv+"]",ew="\\u200d",tw="(?:"+Qv+"|"+Xv+")",Yz="(?:"+nr+"|"+Xv+")",iw="(?:"+ep+"(?:d|ll|m|re|s|t|ve))?",sw="(?:"+ep+"(?:D|LL|M|RE|S|T|VE))?",nw=qz+"?",ow="["+jv+"]?",Qz="(?:"+ew+"(?:"+[Jv,ip,sp].join("|")+")"+ow+nw+")*",Xz="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jz="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rw=ow+nw+Qz,eU="(?:"+[Zz,ip,sp].join("|")+")"+rw,tU="(?:"+[Jv+yc+"?",yc,ip,sp,jz].join("|")+")",iU=RegExp(ep,"g"),sU=RegExp(yc,"g"),np=RegExp(tp+"(?="+tp+")|"+tU+rw,"g"),nU=RegExp([nr+"?"+Qv+"+"+iw+"(?="+[qv,nr,"$"].join("|")+")",Yz+"+"+sw+"(?="+[qv,nr+tw,"$"].join("|")+")",nr+"?"+tw+"+"+iw,nr+"+"+sw,Jz,Xz,Yv,eU].join("|"),"g"),oU=RegExp("["+ew+Sc+zv+jv+"]"),rU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,lU=["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"],aU=-1,ot={};ot[zh]=ot[Uh]=ot[$h]=ot[Kh]=ot[jh]=ot[Zh]=ot[qh]=ot[Yh]=ot[Qh]=!0,ot[ir]=ot[fc]=ot[Ol]=ot[Al]=ot[sr]=ot[Ml]=ot[mc]=ot[Cc]=ot[os]=ot[kl]=ot[Bs]=ot[Il]=ot[rs]=ot[Ll]=ot[_l]=!1;var it={};it[ir]=it[fc]=it[Ol]=it[sr]=it[Al]=it[Ml]=it[zh]=it[Uh]=it[$h]=it[Kh]=it[jh]=it[os]=it[kl]=it[Bs]=it[Il]=it[rs]=it[Ll]=it[vc]=it[Zh]=it[qh]=it[Yh]=it[Qh]=!0,it[mc]=it[Cc]=it[_l]=!1;var cU={À:"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"},dU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uU={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},hU={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pU=parseFloat,gU=parseInt,lw=typeof vr=="object"&&vr&&vr.Object===Object&&vr,fU=typeof self=="object"&&self&&self.Object===Object&&self,At=lw||fU||Function("return this")(),op=t&&!t.nodeType&&t,lo=op&&!0&&e&&!e.nodeType&&e,aw=lo&&lo.exports===op,rp=aw&&lw.process,Ai=function(){try{var _=lo&&lo.require&&lo.require("util").types;return _||rp&&rp.binding&&rp.binding("util")}catch{}}(),cw=Ai&&Ai.isArrayBuffer,dw=Ai&&Ai.isDate,uw=Ai&&Ai.isMap,hw=Ai&&Ai.isRegExp,pw=Ai&&Ai.isSet,gw=Ai&&Ai.isTypedArray;function vi(_,K,H){switch(H.length){case 0:return _.call(K);case 1:return _.call(K,H[0]);case 2:return _.call(K,H[0],H[1]);case 3:return _.call(K,H[0],H[1],H[2])}return _.apply(K,H)}function mU(_,K,H,ae){for(var Pe=-1,qe=_==null?0:_.length;++Pe<qe;){var yt=_[Pe];K(ae,yt,H(yt),_)}return ae}function Mi(_,K){for(var H=-1,ae=_==null?0:_.length;++H<ae&&K(_[H],H,_)!==!1;);return _}function CU(_,K){for(var H=_==null?0:_.length;H--&&K(_[H],H,_)!==!1;);return _}function fw(_,K){for(var H=-1,ae=_==null?0:_.length;++H<ae;)if(!K(_[H],H,_))return!1;return!0}function bn(_,K){for(var H=-1,ae=_==null?0:_.length,Pe=0,qe=[];++H<ae;){var yt=_[H];K(yt,H,_)&&(qe[Pe++]=yt)}return qe}function bc(_,K){var H=_==null?0:_.length;return!!H&&or(_,K,0)>-1}function lp(_,K,H){for(var ae=-1,Pe=_==null?0:_.length;++ae<Pe;)if(H(K,_[ae]))return!0;return!1}function at(_,K){for(var H=-1,ae=_==null?0:_.length,Pe=Array(ae);++H<ae;)Pe[H]=K(_[H],H,_);return Pe}function Rn(_,K){for(var H=-1,ae=K.length,Pe=_.length;++H<ae;)_[Pe+H]=K[H];return _}function ap(_,K,H,ae){var Pe=-1,qe=_==null?0:_.length;for(ae&&qe&&(H=_[++Pe]);++Pe<qe;)H=K(H,_[Pe],Pe,_);return H}function vU(_,K,H,ae){var Pe=_==null?0:_.length;for(ae&&Pe&&(H=_[--Pe]);Pe--;)H=K(H,_[Pe],Pe,_);return H}function cp(_,K){for(var H=-1,ae=_==null?0:_.length;++H<ae;)if(K(_[H],H,_))return!0;return!1}var wU=dp("length");function SU(_){return _.split("")}function yU(_){return _.match(Tz)||[]}function mw(_,K,H){var ae;return H(_,function(Pe,qe,yt){if(K(Pe,qe,yt))return ae=qe,!1}),ae}function Rc(_,K,H,ae){for(var Pe=_.length,qe=H+(ae?1:-1);ae?qe--:++qe<Pe;)if(K(_[qe],qe,_))return qe;return-1}function or(_,K,H){return K===K?IU(_,K,H):Rc(_,Cw,H)}function bU(_,K,H,ae){for(var Pe=H-1,qe=_.length;++Pe<qe;)if(ae(_[Pe],K))return Pe;return-1}function Cw(_){return _!==_}function vw(_,K){var H=_==null?0:_.length;return H?hp(_,K)/H:yn}function dp(_){return function(K){return K==null?i:K[_]}}function up(_){return function(K){return _==null?i:_[K]}}function ww(_,K,H,ae,Pe){return Pe(_,function(qe,yt,tt){H=ae?(ae=!1,qe):K(H,qe,yt,tt)}),H}function RU(_,K){var H=_.length;for(_.sort(K);H--;)_[H]=_[H].value;return _}function hp(_,K){for(var H,ae=-1,Pe=_.length;++ae<Pe;){var qe=K(_[ae]);qe!==i&&(H=H===i?qe:H+qe)}return H}function pp(_,K){for(var H=-1,ae=Array(_);++H<_;)ae[H]=K(H);return ae}function FU(_,K){return at(K,function(H){return[H,_[H]]})}function Sw(_){return _&&_.slice(0,Fw(_)+1).replace(Jh,"")}function wi(_){return function(K){return _(K)}}function gp(_,K){return at(K,function(H){return _[H]})}function Vl(_,K){return _.has(K)}function yw(_,K){for(var H=-1,ae=_.length;++H<ae&&or(K,_[H],0)>-1;);return H}function bw(_,K){for(var H=_.length;H--&&or(K,_[H],0)>-1;);return H}function EU(_,K){for(var H=_.length,ae=0;H--;)_[H]===K&&++ae;return ae}var xU=up(cU),PU=up(dU);function DU(_){return"\\"+hU[_]}function TU(_,K){return _==null?i:_[K]}function rr(_){return oU.test(_)}function AU(_){return rU.test(_)}function MU(_){for(var K,H=[];!(K=_.next()).done;)H.push(K.value);return H}function fp(_){var K=-1,H=Array(_.size);return _.forEach(function(ae,Pe){H[++K]=[Pe,ae]}),H}function Rw(_,K){return function(H){return _(K(H))}}function Fn(_,K){for(var H=-1,ae=_.length,Pe=0,qe=[];++H<ae;){var yt=_[H];(yt===K||yt===p)&&(_[H]=p,qe[Pe++]=H)}return qe}function Fc(_){var K=-1,H=Array(_.size);return _.forEach(function(ae){H[++K]=ae}),H}function kU(_){var K=-1,H=Array(_.size);return _.forEach(function(ae){H[++K]=[ae,ae]}),H}function IU(_,K,H){for(var ae=H-1,Pe=_.length;++ae<Pe;)if(_[ae]===K)return ae;return-1}function LU(_,K,H){for(var ae=H+1;ae--;)if(_[ae]===K)return ae;return ae}function lr(_){return rr(_)?OU(_):wU(_)}function ls(_){return rr(_)?VU(_):SU(_)}function Fw(_){for(var K=_.length;K--&&Ez.test(_.charAt(K)););return K}var _U=up(uU);function OU(_){for(var K=np.lastIndex=0;np.test(_);)++K;return K}function VU(_){return _.match(np)||[]}function NU(_){return _.match(nU)||[]}var BU=function _(K){K=K==null?At:ar.defaults(At.Object(),K,ar.pick(At,lU));var H=K.Array,ae=K.Date,Pe=K.Error,qe=K.Function,yt=K.Math,tt=K.Object,mp=K.RegExp,GU=K.String,ki=K.TypeError,Ec=H.prototype,HU=qe.prototype,cr=tt.prototype,xc=K["__core-js_shared__"],Pc=HU.toString,Xe=cr.hasOwnProperty,WU=0,Ew=function(){var c=/[^.]+$/.exec(xc&&xc.keys&&xc.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),Dc=cr.toString,zU=Pc.call(tt),UU=At._,$U=mp("^"+Pc.call(Xe).replace(Xh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tc=aw?K.Buffer:i,En=K.Symbol,Ac=K.Uint8Array,xw=Tc?Tc.allocUnsafe:i,Mc=Rw(tt.getPrototypeOf,tt),Pw=tt.create,Dw=cr.propertyIsEnumerable,kc=Ec.splice,Tw=En?En.isConcatSpreadable:i,Nl=En?En.iterator:i,ao=En?En.toStringTag:i,Ic=function(){try{var c=go(tt,"defineProperty");return c({},"",{}),c}catch{}}(),KU=K.clearTimeout!==At.clearTimeout&&K.clearTimeout,jU=ae&&ae.now!==At.Date.now&&ae.now,ZU=K.setTimeout!==At.setTimeout&&K.setTimeout,Lc=yt.ceil,_c=yt.floor,Cp=tt.getOwnPropertySymbols,qU=Tc?Tc.isBuffer:i,Aw=K.isFinite,YU=Ec.join,QU=Rw(tt.keys,tt),bt=yt.max,Gt=yt.min,XU=ae.now,JU=K.parseInt,Mw=yt.random,e2=Ec.reverse,vp=go(K,"DataView"),Bl=go(K,"Map"),wp=go(K,"Promise"),dr=go(K,"Set"),Gl=go(K,"WeakMap"),Hl=go(tt,"create"),Oc=Gl&&new Gl,ur={},t2=fo(vp),i2=fo(Bl),s2=fo(wp),n2=fo(dr),o2=fo(Gl),Vc=En?En.prototype:i,Wl=Vc?Vc.valueOf:i,kw=Vc?Vc.toString:i;function F(c){if(gt(c)&&!De(c)&&!(c instanceof ze)){if(c instanceof Ii)return c;if(Xe.call(c,"__wrapped__"))return IS(c)}return new Ii(c)}var hr=function(){function c(){}return function(u){if(!pt(u))return{};if(Pw)return Pw(u);c.prototype=u;var g=new c;return c.prototype=i,g}}();function Nc(){}function Ii(c,u){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=i}F.templateSettings={escape:wz,evaluate:Sz,interpolate:Hv,variable:"",imports:{_:F}},F.prototype=Nc.prototype,F.prototype.constructor=F,Ii.prototype=hr(Nc.prototype),Ii.prototype.constructor=Ii;function ze(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ni,this.__views__=[]}function r2(){var c=new ze(this.__wrapped__);return c.__actions__=oi(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=oi(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=oi(this.__views__),c}function l2(){if(this.__filtered__){var c=new ze(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function a2(){var c=this.__wrapped__.value(),u=this.__dir__,g=De(c),C=u<0,y=g?c.length:0,E=S$(0,y,this.__views__),D=E.start,M=E.end,O=M-D,j=C?M:D-1,Z=this.__iteratees__,Y=Z.length,se=0,pe=Gt(O,this.__takeCount__);if(!g||!C&&y==O&&pe==O)return iS(c,this.__actions__);var Se=[];e:for(;O--&&se<pe;){j+=u;for(var Oe=-1,ye=c[j];++Oe<Y;){var He=Z[Oe],Ue=He.iteratee,bi=He.type,Jt=Ue(ye);if(bi==ue)ye=Jt;else if(!Jt){if(bi==me)continue e;break e}}Se[se++]=ye}return Se}ze.prototype=hr(Nc.prototype),ze.prototype.constructor=ze;function co(c){var u=-1,g=c==null?0:c.length;for(this.clear();++u<g;){var C=c[u];this.set(C[0],C[1])}}function c2(){this.__data__=Hl?Hl(null):{},this.size=0}function d2(c){var u=this.has(c)&&delete this.__data__[c];return this.size-=u?1:0,u}function u2(c){var u=this.__data__;if(Hl){var g=u[c];return g===d?i:g}return Xe.call(u,c)?u[c]:i}function h2(c){var u=this.__data__;return Hl?u[c]!==i:Xe.call(u,c)}function p2(c,u){var g=this.__data__;return this.size+=this.has(c)?0:1,g[c]=Hl&&u===i?d:u,this}co.prototype.clear=c2,co.prototype.delete=d2,co.prototype.get=u2,co.prototype.has=h2,co.prototype.set=p2;function Gs(c){var u=-1,g=c==null?0:c.length;for(this.clear();++u<g;){var C=c[u];this.set(C[0],C[1])}}function g2(){this.__data__=[],this.size=0}function f2(c){var u=this.__data__,g=Bc(u,c);if(g<0)return!1;var C=u.length-1;return g==C?u.pop():kc.call(u,g,1),--this.size,!0}function m2(c){var u=this.__data__,g=Bc(u,c);return g<0?i:u[g][1]}function C2(c){return Bc(this.__data__,c)>-1}function v2(c,u){var g=this.__data__,C=Bc(g,c);return C<0?(++this.size,g.push([c,u])):g[C][1]=u,this}Gs.prototype.clear=g2,Gs.prototype.delete=f2,Gs.prototype.get=m2,Gs.prototype.has=C2,Gs.prototype.set=v2;function Hs(c){var u=-1,g=c==null?0:c.length;for(this.clear();++u<g;){var C=c[u];this.set(C[0],C[1])}}function w2(){this.size=0,this.__data__={hash:new co,map:new(Bl||Gs),string:new co}}function S2(c){var u=Qc(this,c).delete(c);return this.size-=u?1:0,u}function y2(c){return Qc(this,c).get(c)}function b2(c){return Qc(this,c).has(c)}function R2(c,u){var g=Qc(this,c),C=g.size;return g.set(c,u),this.size+=g.size==C?0:1,this}Hs.prototype.clear=w2,Hs.prototype.delete=S2,Hs.prototype.get=y2,Hs.prototype.has=b2,Hs.prototype.set=R2;function uo(c){var u=-1,g=c==null?0:c.length;for(this.__data__=new Hs;++u<g;)this.add(c[u])}function F2(c){return this.__data__.set(c,d),this}function E2(c){return this.__data__.has(c)}uo.prototype.add=uo.prototype.push=F2,uo.prototype.has=E2;function as(c){var u=this.__data__=new Gs(c);this.size=u.size}function x2(){this.__data__=new Gs,this.size=0}function P2(c){var u=this.__data__,g=u.delete(c);return this.size=u.size,g}function D2(c){return this.__data__.get(c)}function T2(c){return this.__data__.has(c)}function A2(c,u){var g=this.__data__;if(g instanceof Gs){var C=g.__data__;if(!Bl||C.length<n-1)return C.push([c,u]),this.size=++g.size,this;g=this.__data__=new Hs(C)}return g.set(c,u),this.size=g.size,this}as.prototype.clear=x2,as.prototype.delete=P2,as.prototype.get=D2,as.prototype.has=T2,as.prototype.set=A2;function Iw(c,u){var g=De(c),C=!g&&mo(c),y=!g&&!C&&An(c),E=!g&&!C&&!y&&mr(c),D=g||C||y||E,M=D?pp(c.length,GU):[],O=M.length;for(var j in c)(u||Xe.call(c,j))&&!(D&&(j=="length"||y&&(j=="offset"||j=="parent")||E&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||$s(j,O)))&&M.push(j);return M}function Lw(c){var u=c.length;return u?c[Ap(0,u-1)]:i}function M2(c,u){return Xc(oi(c),ho(u,0,c.length))}function k2(c){return Xc(oi(c))}function Sp(c,u,g){(g!==i&&!cs(c[u],g)||g===i&&!(u in c))&&Ws(c,u,g)}function zl(c,u,g){var C=c[u];(!(Xe.call(c,u)&&cs(C,g))||g===i&&!(u in c))&&Ws(c,u,g)}function Bc(c,u){for(var g=c.length;g--;)if(cs(c[g][0],u))return g;return-1}function I2(c,u,g,C){return xn(c,function(y,E,D){u(C,y,g(y),D)}),C}function _w(c,u){return c&&Fs(u,Dt(u),c)}function L2(c,u){return c&&Fs(u,li(u),c)}function Ws(c,u,g){u=="__proto__"&&Ic?Ic(c,u,{configurable:!0,enumerable:!0,value:g,writable:!0}):c[u]=g}function yp(c,u){for(var g=-1,C=u.length,y=H(C),E=c==null;++g<C;)y[g]=E?i:tg(c,u[g]);return y}function ho(c,u,g){return c===c&&(g!==i&&(c=c<=g?c:g),u!==i&&(c=c>=u?c:u)),c}function Li(c,u,g,C,y,E){var D,M=u&f,O=u&m,j=u&v;if(g&&(D=y?g(c,C,y,E):g(c)),D!==i)return D;if(!pt(c))return c;var Z=De(c);if(Z){if(D=b$(c),!M)return oi(c,D)}else{var Y=Ht(c),se=Y==Cc||Y==Vv;if(An(c))return oS(c,M);if(Y==Bs||Y==ir||se&&!y){if(D=O||se?{}:FS(c),!M)return O?u$(c,L2(D,c)):d$(c,_w(D,c))}else{if(!it[Y])return y?c:{};D=R$(c,Y,M)}}E||(E=new as);var pe=E.get(c);if(pe)return pe;E.set(c,D),JS(c)?c.forEach(function(ye){D.add(Li(ye,u,g,ye,c,E))}):QS(c)&&c.forEach(function(ye,He){D.set(He,Li(ye,u,g,He,c,E))});var Se=j?O?Hp:Gp:O?li:Dt,Oe=Z?i:Se(c);return Mi(Oe||c,function(ye,He){Oe&&(He=ye,ye=c[He]),zl(D,He,Li(ye,u,g,He,c,E))}),D}function _2(c){var u=Dt(c);return function(g){return Ow(g,c,u)}}function Ow(c,u,g){var C=g.length;if(c==null)return!C;for(c=tt(c);C--;){var y=g[C],E=u[y],D=c[y];if(D===i&&!(y in c)||!E(D))return!1}return!0}function Vw(c,u,g){if(typeof c!="function")throw new ki(r);return Yl(function(){c.apply(i,g)},u)}function Ul(c,u,g,C){var y=-1,E=bc,D=!0,M=c.length,O=[],j=u.length;if(!M)return O;g&&(u=at(u,wi(g))),C?(E=lp,D=!1):u.length>=n&&(E=Vl,D=!1,u=new uo(u));e:for(;++y<M;){var Z=c[y],Y=g==null?Z:g(Z);if(Z=C||Z!==0?Z:0,D&&Y===Y){for(var se=j;se--;)if(u[se]===Y)continue e;O.push(Z)}else E(u,Y,C)||O.push(Z)}return O}var xn=dS(Rs),Nw=dS(Rp,!0);function O2(c,u){var g=!0;return xn(c,function(C,y,E){return g=!!u(C,y,E),g}),g}function Gc(c,u,g){for(var C=-1,y=c.length;++C<y;){var E=c[C],D=u(E);if(D!=null&&(M===i?D===D&&!yi(D):g(D,M)))var M=D,O=E}return O}function V2(c,u,g,C){var y=c.length;for(g=Ie(g),g<0&&(g=-g>y?0:y+g),C=C===i||C>y?y:Ie(C),C<0&&(C+=y),C=g>C?0:ty(C);g<C;)c[g++]=u;return c}function Bw(c,u){var g=[];return xn(c,function(C,y,E){u(C,y,E)&&g.push(C)}),g}function Mt(c,u,g,C,y){var E=-1,D=c.length;for(g||(g=E$),y||(y=[]);++E<D;){var M=c[E];u>0&&g(M)?u>1?Mt(M,u-1,g,C,y):Rn(y,M):C||(y[y.length]=M)}return y}var bp=uS(),Gw=uS(!0);function Rs(c,u){return c&&bp(c,u,Dt)}function Rp(c,u){return c&&Gw(c,u,Dt)}function Hc(c,u){return bn(u,function(g){return Ks(c[g])})}function po(c,u){u=Dn(u,c);for(var g=0,C=u.length;c!=null&&g<C;)c=c[Es(u[g++])];return g&&g==C?c:i}function Hw(c,u,g){var C=u(c);return De(c)?C:Rn(C,g(c))}function Qt(c){return c==null?c===i?hz:dz:ao&&ao in tt(c)?w$(c):k$(c)}function Fp(c,u){return c>u}function N2(c,u){return c!=null&&Xe.call(c,u)}function B2(c,u){return c!=null&&u in tt(c)}function G2(c,u,g){return c>=Gt(u,g)&&c<bt(u,g)}function Ep(c,u,g){for(var C=g?lp:bc,y=c[0].length,E=c.length,D=E,M=H(E),O=1/0,j=[];D--;){var Z=c[D];D&&u&&(Z=at(Z,wi(u))),O=Gt(Z.length,O),M[D]=!g&&(u||y>=120&&Z.length>=120)?new uo(D&&Z):i}Z=c[0];var Y=-1,se=M[0];e:for(;++Y<y&&j.length<O;){var pe=Z[Y],Se=u?u(pe):pe;if(pe=g||pe!==0?pe:0,!(se?Vl(se,Se):C(j,Se,g))){for(D=E;--D;){var Oe=M[D];if(!(Oe?Vl(Oe,Se):C(c[D],Se,g)))continue e}se&&se.push(Se),j.push(pe)}}return j}function H2(c,u,g,C){return Rs(c,function(y,E,D){u(C,g(y),E,D)}),C}function $l(c,u,g){u=Dn(u,c),c=DS(c,u);var C=c==null?c:c[Es(Oi(u))];return C==null?i:vi(C,c,g)}function Ww(c){return gt(c)&&Qt(c)==ir}function W2(c){return gt(c)&&Qt(c)==Ol}function z2(c){return gt(c)&&Qt(c)==Ml}function Kl(c,u,g,C,y){return c===u?!0:c==null||u==null||!gt(c)&&!gt(u)?c!==c&&u!==u:U2(c,u,g,C,Kl,y)}function U2(c,u,g,C,y,E){var D=De(c),M=De(u),O=D?fc:Ht(c),j=M?fc:Ht(u);O=O==ir?Bs:O,j=j==ir?Bs:j;var Z=O==Bs,Y=j==Bs,se=O==j;if(se&&An(c)){if(!An(u))return!1;D=!0,Z=!1}if(se&&!Z)return E||(E=new as),D||mr(c)?yS(c,u,g,C,y,E):C$(c,u,O,g,C,y,E);if(!(g&w)){var pe=Z&&Xe.call(c,"__wrapped__"),Se=Y&&Xe.call(u,"__wrapped__");if(pe||Se){var Oe=pe?c.value():c,ye=Se?u.value():u;return E||(E=new as),y(Oe,ye,g,C,E)}}return se?(E||(E=new as),v$(c,u,g,C,y,E)):!1}function $2(c){return gt(c)&&Ht(c)==os}function xp(c,u,g,C){var y=g.length,E=y,D=!C;if(c==null)return!E;for(c=tt(c);y--;){var M=g[y];if(D&&M[2]?M[1]!==c[M[0]]:!(M[0]in c))return!1}for(;++y<E;){M=g[y];var O=M[0],j=c[O],Z=M[1];if(D&&M[2]){if(j===i&&!(O in c))return!1}else{var Y=new as;if(C)var se=C(j,Z,O,c,u,Y);if(!(se===i?Kl(Z,j,w|S,C,Y):se))return!1}}return!0}function zw(c){if(!pt(c)||P$(c))return!1;var u=Ks(c)?$U:_z;return u.test(fo(c))}function K2(c){return gt(c)&&Qt(c)==Il}function j2(c){return gt(c)&&Ht(c)==rs}function Z2(c){return gt(c)&&nd(c.length)&&!!ot[Qt(c)]}function Uw(c){return typeof c=="function"?c:c==null?ai:typeof c=="object"?De(c)?jw(c[0],c[1]):Kw(c):hy(c)}function Pp(c){if(!ql(c))return QU(c);var u=[];for(var g in tt(c))Xe.call(c,g)&&g!="constructor"&&u.push(g);return u}function q2(c){if(!pt(c))return M$(c);var u=ql(c),g=[];for(var C in c)C=="constructor"&&(u||!Xe.call(c,C))||g.push(C);return g}function Dp(c,u){return c<u}function $w(c,u){var g=-1,C=ri(c)?H(c.length):[];return xn(c,function(y,E,D){C[++g]=u(y,E,D)}),C}function Kw(c){var u=zp(c);return u.length==1&&u[0][2]?xS(u[0][0],u[0][1]):function(g){return g===c||xp(g,c,u)}}function jw(c,u){return $p(c)&&ES(u)?xS(Es(c),u):function(g){var C=tg(g,c);return C===i&&C===u?ig(g,c):Kl(u,C,w|S)}}function Wc(c,u,g,C,y){c!==u&&bp(u,function(E,D){if(y||(y=new as),pt(E))Y2(c,u,D,g,Wc,C,y);else{var M=C?C(jp(c,D),E,D+"",c,u,y):i;M===i&&(M=E),Sp(c,D,M)}},li)}function Y2(c,u,g,C,y,E,D){var M=jp(c,g),O=jp(u,g),j=D.get(O);if(j){Sp(c,g,j);return}var Z=E?E(M,O,g+"",c,u,D):i,Y=Z===i;if(Y){var se=De(O),pe=!se&&An(O),Se=!se&&!pe&&mr(O);Z=O,se||pe||Se?De(M)?Z=M:Ct(M)?Z=oi(M):pe?(Y=!1,Z=oS(O,!0)):Se?(Y=!1,Z=rS(O,!0)):Z=[]:Ql(O)||mo(O)?(Z=M,mo(M)?Z=iy(M):(!pt(M)||Ks(M))&&(Z=FS(O))):Y=!1}Y&&(D.set(O,Z),y(Z,O,C,E,D),D.delete(O)),Sp(c,g,Z)}function Zw(c,u){var g=c.length;if(g)return u+=u<0?g:0,$s(u,g)?c[u]:i}function qw(c,u,g){u.length?u=at(u,function(E){return De(E)?function(D){return po(D,E.length===1?E[0]:E)}:E}):u=[ai];var C=-1;u=at(u,wi(ve()));var y=$w(c,function(E,D,M){var O=at(u,function(j){return j(E)});return{criteria:O,index:++C,value:E}});return RU(y,function(E,D){return c$(E,D,g)})}function Q2(c,u){return Yw(c,u,function(g,C){return ig(c,C)})}function Yw(c,u,g){for(var C=-1,y=u.length,E={};++C<y;){var D=u[C],M=po(c,D);g(M,D)&&jl(E,Dn(D,c),M)}return E}function X2(c){return function(u){return po(u,c)}}function Tp(c,u,g,C){var y=C?bU:or,E=-1,D=u.length,M=c;for(c===u&&(u=oi(u)),g&&(M=at(c,wi(g)));++E<D;)for(var O=0,j=u[E],Z=g?g(j):j;(O=y(M,Z,O,C))>-1;)M!==c&&kc.call(M,O,1),kc.call(c,O,1);return c}function Qw(c,u){for(var g=c?u.length:0,C=g-1;g--;){var y=u[g];if(g==C||y!==E){var E=y;$s(y)?kc.call(c,y,1):Ip(c,y)}}return c}function Ap(c,u){return c+_c(Mw()*(u-c+1))}function J2(c,u,g,C){for(var y=-1,E=bt(Lc((u-c)/(g||1)),0),D=H(E);E--;)D[C?E:++y]=c,c+=g;return D}function Mp(c,u){var g="";if(!c||u<1||u>Ge)return g;do u%2&&(g+=c),u=_c(u/2),u&&(c+=c);while(u);return g}function Ne(c,u){return Zp(PS(c,u,ai),c+"")}function e$(c){return Lw(Cr(c))}function t$(c,u){var g=Cr(c);return Xc(g,ho(u,0,g.length))}function jl(c,u,g,C){if(!pt(c))return c;u=Dn(u,c);for(var y=-1,E=u.length,D=E-1,M=c;M!=null&&++y<E;){var O=Es(u[y]),j=g;if(O==="__proto__"||O==="constructor"||O==="prototype")return c;if(y!=D){var Z=M[O];j=C?C(Z,O,M):i,j===i&&(j=pt(Z)?Z:$s(u[y+1])?[]:{})}zl(M,O,j),M=M[O]}return c}var Xw=Oc?function(c,u){return Oc.set(c,u),c}:ai,i$=Ic?function(c,u){return Ic(c,"toString",{configurable:!0,enumerable:!1,value:ng(u),writable:!0})}:ai;function s$(c){return Xc(Cr(c))}function _i(c,u,g){var C=-1,y=c.length;u<0&&(u=-u>y?0:y+u),g=g>y?y:g,g<0&&(g+=y),y=u>g?0:g-u>>>0,u>>>=0;for(var E=H(y);++C<y;)E[C]=c[C+u];return E}function n$(c,u){var g;return xn(c,function(C,y,E){return g=u(C,y,E),!g}),!!g}function zc(c,u,g){var C=0,y=c==null?C:c.length;if(typeof u=="number"&&u===u&&y<=rz){for(;C<y;){var E=C+y>>>1,D=c[E];D!==null&&!yi(D)&&(g?D<=u:D<u)?C=E+1:y=E}return y}return kp(c,u,ai,g)}function kp(c,u,g,C){var y=0,E=c==null?0:c.length;if(E===0)return 0;u=g(u);for(var D=u!==u,M=u===null,O=yi(u),j=u===i;y<E;){var Z=_c((y+E)/2),Y=g(c[Z]),se=Y!==i,pe=Y===null,Se=Y===Y,Oe=yi(Y);if(D)var ye=C||Se;else j?ye=Se&&(C||se):M?ye=Se&&se&&(C||!pe):O?ye=Se&&se&&!pe&&(C||!Oe):pe||Oe?ye=!1:ye=C?Y<=u:Y<u;ye?y=Z+1:E=Z}return Gt(E,oz)}function Jw(c,u){for(var g=-1,C=c.length,y=0,E=[];++g<C;){var D=c[g],M=u?u(D):D;if(!g||!cs(M,O)){var O=M;E[y++]=D===0?0:D}}return E}function eS(c){return typeof c=="number"?c:yi(c)?yn:+c}function Si(c){if(typeof c=="string")return c;if(De(c))return at(c,Si)+"";if(yi(c))return kw?kw.call(c):"";var u=c+"";return u=="0"&&1/c==-Me?"-0":u}function Pn(c,u,g){var C=-1,y=bc,E=c.length,D=!0,M=[],O=M;if(g)D=!1,y=lp;else if(E>=n){var j=u?null:f$(c);if(j)return Fc(j);D=!1,y=Vl,O=new uo}else O=u?[]:M;e:for(;++C<E;){var Z=c[C],Y=u?u(Z):Z;if(Z=g||Z!==0?Z:0,D&&Y===Y){for(var se=O.length;se--;)if(O[se]===Y)continue e;u&&O.push(Y),M.push(Z)}else y(O,Y,g)||(O!==M&&O.push(Y),M.push(Z))}return M}function Ip(c,u){return u=Dn(u,c),c=DS(c,u),c==null||delete c[Es(Oi(u))]}function tS(c,u,g,C){return jl(c,u,g(po(c,u)),C)}function Uc(c,u,g,C){for(var y=c.length,E=C?y:-1;(C?E--:++E<y)&&u(c[E],E,c););return g?_i(c,C?0:E,C?E+1:y):_i(c,C?E+1:0,C?y:E)}function iS(c,u){var g=c;return g instanceof ze&&(g=g.value()),ap(u,function(C,y){return y.func.apply(y.thisArg,Rn([C],y.args))},g)}function Lp(c,u,g){var C=c.length;if(C<2)return C?Pn(c[0]):[];for(var y=-1,E=H(C);++y<C;)for(var D=c[y],M=-1;++M<C;)M!=y&&(E[y]=Ul(E[y]||D,c[M],u,g));return Pn(Mt(E,1),u,g)}function sS(c,u,g){for(var C=-1,y=c.length,E=u.length,D={};++C<y;){var M=C<E?u[C]:i;g(D,c[C],M)}return D}function _p(c){return Ct(c)?c:[]}function Op(c){return typeof c=="function"?c:ai}function Dn(c,u){return De(c)?c:$p(c,u)?[c]:kS(Qe(c))}var o$=Ne;function Tn(c,u,g){var C=c.length;return g=g===i?C:g,!u&&g>=C?c:_i(c,u,g)}var nS=KU||function(c){return At.clearTimeout(c)};function oS(c,u){if(u)return c.slice();var g=c.length,C=xw?xw(g):new c.constructor(g);return c.copy(C),C}function Vp(c){var u=new c.constructor(c.byteLength);return new Ac(u).set(new Ac(c)),u}function r$(c,u){var g=u?Vp(c.buffer):c.buffer;return new c.constructor(g,c.byteOffset,c.byteLength)}function l$(c){var u=new c.constructor(c.source,Wv.exec(c));return u.lastIndex=c.lastIndex,u}function a$(c){return Wl?tt(Wl.call(c)):{}}function rS(c,u){var g=u?Vp(c.buffer):c.buffer;return new c.constructor(g,c.byteOffset,c.length)}function lS(c,u){if(c!==u){var g=c!==i,C=c===null,y=c===c,E=yi(c),D=u!==i,M=u===null,O=u===u,j=yi(u);if(!M&&!j&&!E&&c>u||E&&D&&O&&!M&&!j||C&&D&&O||!g&&O||!y)return 1;if(!C&&!E&&!j&&c<u||j&&g&&y&&!C&&!E||M&&g&&y||!D&&y||!O)return-1}return 0}function c$(c,u,g){for(var C=-1,y=c.criteria,E=u.criteria,D=y.length,M=g.length;++C<D;){var O=lS(y[C],E[C]);if(O){if(C>=M)return O;var j=g[C];return O*(j=="desc"?-1:1)}}return c.index-u.index}function aS(c,u,g,C){for(var y=-1,E=c.length,D=g.length,M=-1,O=u.length,j=bt(E-D,0),Z=H(O+j),Y=!C;++M<O;)Z[M]=u[M];for(;++y<D;)(Y||y<E)&&(Z[g[y]]=c[y]);for(;j--;)Z[M++]=c[y++];return Z}function cS(c,u,g,C){for(var y=-1,E=c.length,D=-1,M=g.length,O=-1,j=u.length,Z=bt(E-M,0),Y=H(Z+j),se=!C;++y<Z;)Y[y]=c[y];for(var pe=y;++O<j;)Y[pe+O]=u[O];for(;++D<M;)(se||y<E)&&(Y[pe+g[D]]=c[y++]);return Y}function oi(c,u){var g=-1,C=c.length;for(u||(u=H(C));++g<C;)u[g]=c[g];return u}function Fs(c,u,g,C){var y=!g;g||(g={});for(var E=-1,D=u.length;++E<D;){var M=u[E],O=C?C(g[M],c[M],M,g,c):i;O===i&&(O=c[M]),y?Ws(g,M,O):zl(g,M,O)}return g}function d$(c,u){return Fs(c,Up(c),u)}function u$(c,u){return Fs(c,bS(c),u)}function $c(c,u){return function(g,C){var y=De(g)?mU:I2,E=u?u():{};return y(g,c,ve(C,2),E)}}function pr(c){return Ne(function(u,g){var C=-1,y=g.length,E=y>1?g[y-1]:i,D=y>2?g[2]:i;for(E=c.length>3&&typeof E=="function"?(y--,E):i,D&&Xt(g[0],g[1],D)&&(E=y<3?i:E,y=1),u=tt(u);++C<y;){var M=g[C];M&&c(u,M,C,E)}return u})}function dS(c,u){return function(g,C){if(g==null)return g;if(!ri(g))return c(g,C);for(var y=g.length,E=u?y:-1,D=tt(g);(u?E--:++E<y)&&C(D[E],E,D)!==!1;);return g}}function uS(c){return function(u,g,C){for(var y=-1,E=tt(u),D=C(u),M=D.length;M--;){var O=D[c?M:++y];if(g(E[O],O,E)===!1)break}return u}}function h$(c,u,g){var C=u&b,y=Zl(c);function E(){var D=this&&this!==At&&this instanceof E?y:c;return D.apply(C?g:this,arguments)}return E}function hS(c){return function(u){u=Qe(u);var g=rr(u)?ls(u):i,C=g?g[0]:u.charAt(0),y=g?Tn(g,1).join(""):u.slice(1);return C[c]()+y}}function gr(c){return function(u){return ap(dy(cy(u).replace(iU,"")),c,"")}}function Zl(c){return function(){var u=arguments;switch(u.length){case 0:return new c;case 1:return new c(u[0]);case 2:return new c(u[0],u[1]);case 3:return new c(u[0],u[1],u[2]);case 4:return new c(u[0],u[1],u[2],u[3]);case 5:return new c(u[0],u[1],u[2],u[3],u[4]);case 6:return new c(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new c(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var g=hr(c.prototype),C=c.apply(g,u);return pt(C)?C:g}}function p$(c,u,g){var C=Zl(c);function y(){for(var E=arguments.length,D=H(E),M=E,O=fr(y);M--;)D[M]=arguments[M];var j=E<3&&D[0]!==O&&D[E-1]!==O?[]:Fn(D,O);if(E-=j.length,E<g)return CS(c,u,Kc,y.placeholder,i,D,j,i,i,g-E);var Z=this&&this!==At&&this instanceof y?C:c;return vi(Z,this,D)}return y}function pS(c){return function(u,g,C){var y=tt(u);if(!ri(u)){var E=ve(g,3);u=Dt(u),g=function(M){return E(y[M],M,y)}}var D=c(u,g,C);return D>-1?y[E?u[D]:D]:i}}function gS(c){return Us(function(u){var g=u.length,C=g,y=Ii.prototype.thru;for(c&&u.reverse();C--;){var E=u[C];if(typeof E!="function")throw new ki(r);if(y&&!D&&Yc(E)=="wrapper")var D=new Ii([],!0)}for(C=D?C:g;++C<g;){E=u[C];var M=Yc(E),O=M=="wrapper"?Wp(E):i;O&&Kp(O[0])&&O[1]==(A|T|V|k)&&!O[4].length&&O[9]==1?D=D[Yc(O[0])].apply(D,O[3]):D=E.length==1&&Kp(E)?D[M]():D.thru(E)}return function(){var j=arguments,Z=j[0];if(D&&j.length==1&&De(Z))return D.plant(Z).value();for(var Y=0,se=g?u[Y].apply(this,j):Z;++Y<g;)se=u[Y].call(this,se);return se}})}function Kc(c,u,g,C,y,E,D,M,O,j){var Z=u&A,Y=u&b,se=u&R,pe=u&(T|I),Se=u&N,Oe=se?i:Zl(c);function ye(){for(var He=arguments.length,Ue=H(He),bi=He;bi--;)Ue[bi]=arguments[bi];if(pe)var Jt=fr(ye),Ri=EU(Ue,Jt);if(C&&(Ue=aS(Ue,C,y,pe)),E&&(Ue=cS(Ue,E,D,pe)),He-=Ri,pe&&He<j){var vt=Fn(Ue,Jt);return CS(c,u,Kc,ye.placeholder,g,Ue,vt,M,O,j-He)}var ds=Y?g:this,Zs=se?ds[c]:c;return He=Ue.length,M?Ue=I$(Ue,M):Se&&He>1&&Ue.reverse(),Z&&O<He&&(Ue.length=O),this&&this!==At&&this instanceof ye&&(Zs=Oe||Zl(Zs)),Zs.apply(ds,Ue)}return ye}function fS(c,u){return function(g,C){return H2(g,c,u(C),{})}}function jc(c,u){return function(g,C){var y;if(g===i&&C===i)return u;if(g!==i&&(y=g),C!==i){if(y===i)return C;typeof g=="string"||typeof C=="string"?(g=Si(g),C=Si(C)):(g=eS(g),C=eS(C)),y=c(g,C)}return y}}function Np(c){return Us(function(u){return u=at(u,wi(ve())),Ne(function(g){var C=this;return c(u,function(y){return vi(y,C,g)})})})}function Zc(c,u){u=u===i?" ":Si(u);var g=u.length;if(g<2)return g?Mp(u,c):u;var C=Mp(u,Lc(c/lr(u)));return rr(u)?Tn(ls(C),0,c).join(""):C.slice(0,c)}function g$(c,u,g,C){var y=u&b,E=Zl(c);function D(){for(var M=-1,O=arguments.length,j=-1,Z=C.length,Y=H(Z+O),se=this&&this!==At&&this instanceof D?E:c;++j<Z;)Y[j]=C[j];for(;O--;)Y[j++]=arguments[++M];return vi(se,y?g:this,Y)}return D}function mS(c){return function(u,g,C){return C&&typeof C!="number"&&Xt(u,g,C)&&(g=C=i),u=js(u),g===i?(g=u,u=0):g=js(g),C=C===i?u<g?1:-1:js(C),J2(u,g,C,c)}}function qc(c){return function(u,g){return typeof u=="string"&&typeof g=="string"||(u=Vi(u),g=Vi(g)),c(u,g)}}function CS(c,u,g,C,y,E,D,M,O,j){var Z=u&T,Y=Z?D:i,se=Z?i:D,pe=Z?E:i,Se=Z?i:E;u|=Z?V:L,u&=~(Z?L:V),u&x||(u&=~(b|R));var Oe=[c,u,y,pe,Y,Se,se,M,O,j],ye=g.apply(i,Oe);return Kp(c)&&TS(ye,Oe),ye.placeholder=C,AS(ye,c,u)}function Bp(c){var u=yt[c];return function(g,C){if(g=Vi(g),C=C==null?0:Gt(Ie(C),292),C&&Aw(g)){var y=(Qe(g)+"e").split("e"),E=u(y[0]+"e"+(+y[1]+C));return y=(Qe(E)+"e").split("e"),+(y[0]+"e"+(+y[1]-C))}return u(g)}}var f$=dr&&1/Fc(new dr([,-0]))[1]==Me?function(c){return new dr(c)}:lg;function vS(c){return function(u){var g=Ht(u);return g==os?fp(u):g==rs?kU(u):FU(u,c(u))}}function zs(c,u,g,C,y,E,D,M){var O=u&R;if(!O&&typeof c!="function")throw new ki(r);var j=C?C.length:0;if(j||(u&=~(V|L),C=y=i),D=D===i?D:bt(Ie(D),0),M=M===i?M:Ie(M),j-=y?y.length:0,u&L){var Z=C,Y=y;C=y=i}var se=O?i:Wp(c),pe=[c,u,g,C,y,Z,Y,E,D,M];if(se&&A$(pe,se),c=pe[0],u=pe[1],g=pe[2],C=pe[3],y=pe[4],M=pe[9]=pe[9]===i?O?0:c.length:bt(pe[9]-j,0),!M&&u&(T|I)&&(u&=~(T|I)),!u||u==b)var Se=h$(c,u,g);else u==T||u==I?Se=p$(c,u,M):(u==V||u==(b|V))&&!y.length?Se=g$(c,u,g,C):Se=Kc.apply(i,pe);var Oe=se?Xw:TS;return AS(Oe(Se,pe),c,u)}function wS(c,u,g,C){return c===i||cs(c,cr[g])&&!Xe.call(C,g)?u:c}function SS(c,u,g,C,y,E){return pt(c)&&pt(u)&&(E.set(u,c),Wc(c,u,i,SS,E),E.delete(u)),c}function m$(c){return Ql(c)?i:c}function yS(c,u,g,C,y,E){var D=g&w,M=c.length,O=u.length;if(M!=O&&!(D&&O>M))return!1;var j=E.get(c),Z=E.get(u);if(j&&Z)return j==u&&Z==c;var Y=-1,se=!0,pe=g&S?new uo:i;for(E.set(c,u),E.set(u,c);++Y<M;){var Se=c[Y],Oe=u[Y];if(C)var ye=D?C(Oe,Se,Y,u,c,E):C(Se,Oe,Y,c,u,E);if(ye!==i){if(ye)continue;se=!1;break}if(pe){if(!cp(u,function(He,Ue){if(!Vl(pe,Ue)&&(Se===He||y(Se,He,g,C,E)))return pe.push(Ue)})){se=!1;break}}else if(!(Se===Oe||y(Se,Oe,g,C,E))){se=!1;break}}return E.delete(c),E.delete(u),se}function C$(c,u,g,C,y,E,D){switch(g){case sr:if(c.byteLength!=u.byteLength||c.byteOffset!=u.byteOffset)return!1;c=c.buffer,u=u.buffer;case Ol:return!(c.byteLength!=u.byteLength||!E(new Ac(c),new Ac(u)));case Al:case Ml:case kl:return cs(+c,+u);case mc:return c.name==u.name&&c.message==u.message;case Il:case Ll:return c==u+"";case os:var M=fp;case rs:var O=C&w;if(M||(M=Fc),c.size!=u.size&&!O)return!1;var j=D.get(c);if(j)return j==u;C|=S,D.set(c,u);var Z=yS(M(c),M(u),C,y,E,D);return D.delete(c),Z;case vc:if(Wl)return Wl.call(c)==Wl.call(u)}return!1}function v$(c,u,g,C,y,E){var D=g&w,M=Gp(c),O=M.length,j=Gp(u),Z=j.length;if(O!=Z&&!D)return!1;for(var Y=O;Y--;){var se=M[Y];if(!(D?se in u:Xe.call(u,se)))return!1}var pe=E.get(c),Se=E.get(u);if(pe&&Se)return pe==u&&Se==c;var Oe=!0;E.set(c,u),E.set(u,c);for(var ye=D;++Y<O;){se=M[Y];var He=c[se],Ue=u[se];if(C)var bi=D?C(Ue,He,se,u,c,E):C(He,Ue,se,c,u,E);if(!(bi===i?He===Ue||y(He,Ue,g,C,E):bi)){Oe=!1;break}ye||(ye=se=="constructor")}if(Oe&&!ye){var Jt=c.constructor,Ri=u.constructor;Jt!=Ri&&"constructor"in c&&"constructor"in u&&!(typeof Jt=="function"&&Jt instanceof Jt&&typeof Ri=="function"&&Ri instanceof Ri)&&(Oe=!1)}return E.delete(c),E.delete(u),Oe}function Us(c){return Zp(PS(c,i,OS),c+"")}function Gp(c){return Hw(c,Dt,Up)}function Hp(c){return Hw(c,li,bS)}var Wp=Oc?function(c){return Oc.get(c)}:lg;function Yc(c){for(var u=c.name+"",g=ur[u],C=Xe.call(ur,u)?g.length:0;C--;){var y=g[C],E=y.func;if(E==null||E==c)return y.name}return u}function fr(c){var u=Xe.call(F,"placeholder")?F:c;return u.placeholder}function ve(){var c=F.iteratee||og;return c=c===og?Uw:c,arguments.length?c(arguments[0],arguments[1]):c}function Qc(c,u){var g=c.__data__;return x$(u)?g[typeof u=="string"?"string":"hash"]:g.map}function zp(c){for(var u=Dt(c),g=u.length;g--;){var C=u[g],y=c[C];u[g]=[C,y,ES(y)]}return u}function go(c,u){var g=TU(c,u);return zw(g)?g:i}function w$(c){var u=Xe.call(c,ao),g=c[ao];try{c[ao]=i;var C=!0}catch{}var y=Dc.call(c);return C&&(u?c[ao]=g:delete c[ao]),y}var Up=Cp?function(c){return c==null?[]:(c=tt(c),bn(Cp(c),function(u){return Dw.call(c,u)}))}:ag,bS=Cp?function(c){for(var u=[];c;)Rn(u,Up(c)),c=Mc(c);return u}:ag,Ht=Qt;(vp&&Ht(new vp(new ArrayBuffer(1)))!=sr||Bl&&Ht(new Bl)!=os||wp&&Ht(wp.resolve())!=Nv||dr&&Ht(new dr)!=rs||Gl&&Ht(new Gl)!=_l)&&(Ht=function(c){var u=Qt(c),g=u==Bs?c.constructor:i,C=g?fo(g):"";if(C)switch(C){case t2:return sr;case i2:return os;case s2:return Nv;case n2:return rs;case o2:return _l}return u});function S$(c,u,g){for(var C=-1,y=g.length;++C<y;){var E=g[C],D=E.size;switch(E.type){case"drop":c+=D;break;case"dropRight":u-=D;break;case"take":u=Gt(u,c+D);break;case"takeRight":c=bt(c,u-D);break}}return{start:c,end:u}}function y$(c){var u=c.match(Pz);return u?u[1].split(Dz):[]}function RS(c,u,g){u=Dn(u,c);for(var C=-1,y=u.length,E=!1;++C<y;){var D=Es(u[C]);if(!(E=c!=null&&g(c,D)))break;c=c[D]}return E||++C!=y?E:(y=c==null?0:c.length,!!y&&nd(y)&&$s(D,y)&&(De(c)||mo(c)))}function b$(c){var u=c.length,g=new c.constructor(u);return u&&typeof c[0]=="string"&&Xe.call(c,"index")&&(g.index=c.index,g.input=c.input),g}function FS(c){return typeof c.constructor=="function"&&!ql(c)?hr(Mc(c)):{}}function R$(c,u,g){var C=c.constructor;switch(u){case Ol:return Vp(c);case Al:case Ml:return new C(+c);case sr:return r$(c,g);case zh:case Uh:case $h:case Kh:case jh:case Zh:case qh:case Yh:case Qh:return rS(c,g);case os:return new C;case kl:case Ll:return new C(c);case Il:return l$(c);case rs:return new C;case vc:return a$(c)}}function F$(c,u){var g=u.length;if(!g)return c;var C=g-1;return u[C]=(g>1?"& ":"")+u[C],u=u.join(g>2?", ":" "),c.replace(xz,`{
231
- /* [wrapped with `+u+`] */
232
- `)}function E$(c){return De(c)||mo(c)||!!(Tw&&c&&c[Tw])}function $s(c,u){var g=typeof c;return u=u??Ge,!!u&&(g=="number"||g!="symbol"&&Vz.test(c))&&c>-1&&c%1==0&&c<u}function Xt(c,u,g){if(!pt(g))return!1;var C=typeof u;return(C=="number"?ri(g)&&$s(u,g.length):C=="string"&&u in g)?cs(g[u],c):!1}function $p(c,u){if(De(c))return!1;var g=typeof c;return g=="number"||g=="symbol"||g=="boolean"||c==null||yi(c)?!0:bz.test(c)||!yz.test(c)||u!=null&&c in tt(u)}function x$(c){var u=typeof c;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?c!=="__proto__":c===null}function Kp(c){var u=Yc(c),g=F[u];if(typeof g!="function"||!(u in ze.prototype))return!1;if(c===g)return!0;var C=Wp(g);return!!C&&c===C[0]}function P$(c){return!!Ew&&Ew in c}var D$=xc?Ks:cg;function ql(c){var u=c&&c.constructor,g=typeof u=="function"&&u.prototype||cr;return c===g}function ES(c){return c===c&&!pt(c)}function xS(c,u){return function(g){return g==null?!1:g[c]===u&&(u!==i||c in tt(g))}}function T$(c){var u=id(c,function(C){return g.size===h&&g.clear(),C}),g=u.cache;return u}function A$(c,u){var g=c[1],C=u[1],y=g|C,E=y<(b|R|A),D=C==A&&g==T||C==A&&g==k&&c[7].length<=u[8]||C==(A|k)&&u[7].length<=u[8]&&g==T;if(!(E||D))return c;C&b&&(c[2]=u[2],y|=g&b?0:x);var M=u[3];if(M){var O=c[3];c[3]=O?aS(O,M,u[4]):M,c[4]=O?Fn(c[3],p):u[4]}return M=u[5],M&&(O=c[5],c[5]=O?cS(O,M,u[6]):M,c[6]=O?Fn(c[5],p):u[6]),M=u[7],M&&(c[7]=M),C&A&&(c[8]=c[8]==null?u[8]:Gt(c[8],u[8])),c[9]==null&&(c[9]=u[9]),c[0]=u[0],c[1]=y,c}function M$(c){var u=[];if(c!=null)for(var g in tt(c))u.push(g);return u}function k$(c){return Dc.call(c)}function PS(c,u,g){return u=bt(u===i?c.length-1:u,0),function(){for(var C=arguments,y=-1,E=bt(C.length-u,0),D=H(E);++y<E;)D[y]=C[u+y];y=-1;for(var M=H(u+1);++y<u;)M[y]=C[y];return M[u]=g(D),vi(c,this,M)}}function DS(c,u){return u.length<2?c:po(c,_i(u,0,-1))}function I$(c,u){for(var g=c.length,C=Gt(u.length,g),y=oi(c);C--;){var E=u[C];c[C]=$s(E,g)?y[E]:i}return c}function jp(c,u){if(!(u==="constructor"&&typeof c[u]=="function")&&u!="__proto__")return c[u]}var TS=MS(Xw),Yl=ZU||function(c,u){return At.setTimeout(c,u)},Zp=MS(i$);function AS(c,u,g){var C=u+"";return Zp(c,F$(C,L$(y$(C),g)))}function MS(c){var u=0,g=0;return function(){var C=XU(),y=ce-(C-g);if(g=C,y>0){if(++u>=Q)return arguments[0]}else u=0;return c.apply(i,arguments)}}function Xc(c,u){var g=-1,C=c.length,y=C-1;for(u=u===i?C:u;++g<u;){var E=Ap(g,y),D=c[E];c[E]=c[g],c[g]=D}return c.length=u,c}var kS=T$(function(c){var u=[];return c.charCodeAt(0)===46&&u.push(""),c.replace(Rz,function(g,C,y,E){u.push(y?E.replace(Mz,"$1"):C||g)}),u});function Es(c){if(typeof c=="string"||yi(c))return c;var u=c+"";return u=="0"&&1/c==-Me?"-0":u}function fo(c){if(c!=null){try{return Pc.call(c)}catch{}try{return c+""}catch{}}return""}function L$(c,u){return Mi(lz,function(g){var C="_."+g[0];u&g[1]&&!bc(c,C)&&c.push(C)}),c.sort()}function IS(c){if(c instanceof ze)return c.clone();var u=new Ii(c.__wrapped__,c.__chain__);return u.__actions__=oi(c.__actions__),u.__index__=c.__index__,u.__values__=c.__values__,u}function _$(c,u,g){(g?Xt(c,u,g):u===i)?u=1:u=bt(Ie(u),0);var C=c==null?0:c.length;if(!C||u<1)return[];for(var y=0,E=0,D=H(Lc(C/u));y<C;)D[E++]=_i(c,y,y+=u);return D}function O$(c){for(var u=-1,g=c==null?0:c.length,C=0,y=[];++u<g;){var E=c[u];E&&(y[C++]=E)}return y}function V$(){var c=arguments.length;if(!c)return[];for(var u=H(c-1),g=arguments[0],C=c;C--;)u[C-1]=arguments[C];return Rn(De(g)?oi(g):[g],Mt(u,1))}var N$=Ne(function(c,u){return Ct(c)?Ul(c,Mt(u,1,Ct,!0)):[]}),B$=Ne(function(c,u){var g=Oi(u);return Ct(g)&&(g=i),Ct(c)?Ul(c,Mt(u,1,Ct,!0),ve(g,2)):[]}),G$=Ne(function(c,u){var g=Oi(u);return Ct(g)&&(g=i),Ct(c)?Ul(c,Mt(u,1,Ct,!0),i,g):[]});function H$(c,u,g){var C=c==null?0:c.length;return C?(u=g||u===i?1:Ie(u),_i(c,u<0?0:u,C)):[]}function W$(c,u,g){var C=c==null?0:c.length;return C?(u=g||u===i?1:Ie(u),u=C-u,_i(c,0,u<0?0:u)):[]}function z$(c,u){return c&&c.length?Uc(c,ve(u,3),!0,!0):[]}function U$(c,u){return c&&c.length?Uc(c,ve(u,3),!0):[]}function $$(c,u,g,C){var y=c==null?0:c.length;return y?(g&&typeof g!="number"&&Xt(c,u,g)&&(g=0,C=y),V2(c,u,g,C)):[]}function LS(c,u,g){var C=c==null?0:c.length;if(!C)return-1;var y=g==null?0:Ie(g);return y<0&&(y=bt(C+y,0)),Rc(c,ve(u,3),y)}function _S(c,u,g){var C=c==null?0:c.length;if(!C)return-1;var y=C-1;return g!==i&&(y=Ie(g),y=g<0?bt(C+y,0):Gt(y,C-1)),Rc(c,ve(u,3),y,!0)}function OS(c){var u=c==null?0:c.length;return u?Mt(c,1):[]}function K$(c){var u=c==null?0:c.length;return u?Mt(c,Me):[]}function j$(c,u){var g=c==null?0:c.length;return g?(u=u===i?1:Ie(u),Mt(c,u)):[]}function Z$(c){for(var u=-1,g=c==null?0:c.length,C={};++u<g;){var y=c[u];C[y[0]]=y[1]}return C}function VS(c){return c&&c.length?c[0]:i}function q$(c,u,g){var C=c==null?0:c.length;if(!C)return-1;var y=g==null?0:Ie(g);return y<0&&(y=bt(C+y,0)),or(c,u,y)}function Y$(c){var u=c==null?0:c.length;return u?_i(c,0,-1):[]}var Q$=Ne(function(c){var u=at(c,_p);return u.length&&u[0]===c[0]?Ep(u):[]}),X$=Ne(function(c){var u=Oi(c),g=at(c,_p);return u===Oi(g)?u=i:g.pop(),g.length&&g[0]===c[0]?Ep(g,ve(u,2)):[]}),J$=Ne(function(c){var u=Oi(c),g=at(c,_p);return u=typeof u=="function"?u:i,u&&g.pop(),g.length&&g[0]===c[0]?Ep(g,i,u):[]});function e3(c,u){return c==null?"":YU.call(c,u)}function Oi(c){var u=c==null?0:c.length;return u?c[u-1]:i}function t3(c,u,g){var C=c==null?0:c.length;if(!C)return-1;var y=C;return g!==i&&(y=Ie(g),y=y<0?bt(C+y,0):Gt(y,C-1)),u===u?LU(c,u,y):Rc(c,Cw,y,!0)}function i3(c,u){return c&&c.length?Zw(c,Ie(u)):i}var s3=Ne(NS);function NS(c,u){return c&&c.length&&u&&u.length?Tp(c,u):c}function n3(c,u,g){return c&&c.length&&u&&u.length?Tp(c,u,ve(g,2)):c}function o3(c,u,g){return c&&c.length&&u&&u.length?Tp(c,u,i,g):c}var r3=Us(function(c,u){var g=c==null?0:c.length,C=yp(c,u);return Qw(c,at(u,function(y){return $s(y,g)?+y:y}).sort(lS)),C});function l3(c,u){var g=[];if(!(c&&c.length))return g;var C=-1,y=[],E=c.length;for(u=ve(u,3);++C<E;){var D=c[C];u(D,C,c)&&(g.push(D),y.push(C))}return Qw(c,y),g}function qp(c){return c==null?c:e2.call(c)}function a3(c,u,g){var C=c==null?0:c.length;return C?(g&&typeof g!="number"&&Xt(c,u,g)?(u=0,g=C):(u=u==null?0:Ie(u),g=g===i?C:Ie(g)),_i(c,u,g)):[]}function c3(c,u){return zc(c,u)}function d3(c,u,g){return kp(c,u,ve(g,2))}function u3(c,u){var g=c==null?0:c.length;if(g){var C=zc(c,u);if(C<g&&cs(c[C],u))return C}return-1}function h3(c,u){return zc(c,u,!0)}function p3(c,u,g){return kp(c,u,ve(g,2),!0)}function g3(c,u){var g=c==null?0:c.length;if(g){var C=zc(c,u,!0)-1;if(cs(c[C],u))return C}return-1}function f3(c){return c&&c.length?Jw(c):[]}function m3(c,u){return c&&c.length?Jw(c,ve(u,2)):[]}function C3(c){var u=c==null?0:c.length;return u?_i(c,1,u):[]}function v3(c,u,g){return c&&c.length?(u=g||u===i?1:Ie(u),_i(c,0,u<0?0:u)):[]}function w3(c,u,g){var C=c==null?0:c.length;return C?(u=g||u===i?1:Ie(u),u=C-u,_i(c,u<0?0:u,C)):[]}function S3(c,u){return c&&c.length?Uc(c,ve(u,3),!1,!0):[]}function y3(c,u){return c&&c.length?Uc(c,ve(u,3)):[]}var b3=Ne(function(c){return Pn(Mt(c,1,Ct,!0))}),R3=Ne(function(c){var u=Oi(c);return Ct(u)&&(u=i),Pn(Mt(c,1,Ct,!0),ve(u,2))}),F3=Ne(function(c){var u=Oi(c);return u=typeof u=="function"?u:i,Pn(Mt(c,1,Ct,!0),i,u)});function E3(c){return c&&c.length?Pn(c):[]}function x3(c,u){return c&&c.length?Pn(c,ve(u,2)):[]}function P3(c,u){return u=typeof u=="function"?u:i,c&&c.length?Pn(c,i,u):[]}function Yp(c){if(!(c&&c.length))return[];var u=0;return c=bn(c,function(g){if(Ct(g))return u=bt(g.length,u),!0}),pp(u,function(g){return at(c,dp(g))})}function BS(c,u){if(!(c&&c.length))return[];var g=Yp(c);return u==null?g:at(g,function(C){return vi(u,i,C)})}var D3=Ne(function(c,u){return Ct(c)?Ul(c,u):[]}),T3=Ne(function(c){return Lp(bn(c,Ct))}),A3=Ne(function(c){var u=Oi(c);return Ct(u)&&(u=i),Lp(bn(c,Ct),ve(u,2))}),M3=Ne(function(c){var u=Oi(c);return u=typeof u=="function"?u:i,Lp(bn(c,Ct),i,u)}),k3=Ne(Yp);function I3(c,u){return sS(c||[],u||[],zl)}function L3(c,u){return sS(c||[],u||[],jl)}var _3=Ne(function(c){var u=c.length,g=u>1?c[u-1]:i;return g=typeof g=="function"?(c.pop(),g):i,BS(c,g)});function GS(c){var u=F(c);return u.__chain__=!0,u}function O3(c,u){return u(c),c}function Jc(c,u){return u(c)}var V3=Us(function(c){var u=c.length,g=u?c[0]:0,C=this.__wrapped__,y=function(E){return yp(E,c)};return u>1||this.__actions__.length||!(C instanceof ze)||!$s(g)?this.thru(y):(C=C.slice(g,+g+(u?1:0)),C.__actions__.push({func:Jc,args:[y],thisArg:i}),new Ii(C,this.__chain__).thru(function(E){return u&&!E.length&&E.push(i),E}))});function N3(){return GS(this)}function B3(){return new Ii(this.value(),this.__chain__)}function G3(){this.__values__===i&&(this.__values__=ey(this.value()));var c=this.__index__>=this.__values__.length,u=c?i:this.__values__[this.__index__++];return{done:c,value:u}}function H3(){return this}function W3(c){for(var u,g=this;g instanceof Nc;){var C=IS(g);C.__index__=0,C.__values__=i,u?y.__wrapped__=C:u=C;var y=C;g=g.__wrapped__}return y.__wrapped__=c,u}function z3(){var c=this.__wrapped__;if(c instanceof ze){var u=c;return this.__actions__.length&&(u=new ze(this)),u=u.reverse(),u.__actions__.push({func:Jc,args:[qp],thisArg:i}),new Ii(u,this.__chain__)}return this.thru(qp)}function U3(){return iS(this.__wrapped__,this.__actions__)}var $3=$c(function(c,u,g){Xe.call(c,g)?++c[g]:Ws(c,g,1)});function K3(c,u,g){var C=De(c)?fw:O2;return g&&Xt(c,u,g)&&(u=i),C(c,ve(u,3))}function j3(c,u){var g=De(c)?bn:Bw;return g(c,ve(u,3))}var Z3=pS(LS),q3=pS(_S);function Y3(c,u){return Mt(ed(c,u),1)}function Q3(c,u){return Mt(ed(c,u),Me)}function X3(c,u,g){return g=g===i?1:Ie(g),Mt(ed(c,u),g)}function HS(c,u){var g=De(c)?Mi:xn;return g(c,ve(u,3))}function WS(c,u){var g=De(c)?CU:Nw;return g(c,ve(u,3))}var J3=$c(function(c,u,g){Xe.call(c,g)?c[g].push(u):Ws(c,g,[u])});function eK(c,u,g,C){c=ri(c)?c:Cr(c),g=g&&!C?Ie(g):0;var y=c.length;return g<0&&(g=bt(y+g,0)),od(c)?g<=y&&c.indexOf(u,g)>-1:!!y&&or(c,u,g)>-1}var tK=Ne(function(c,u,g){var C=-1,y=typeof u=="function",E=ri(c)?H(c.length):[];return xn(c,function(D){E[++C]=y?vi(u,D,g):$l(D,u,g)}),E}),iK=$c(function(c,u,g){Ws(c,g,u)});function ed(c,u){var g=De(c)?at:$w;return g(c,ve(u,3))}function sK(c,u,g,C){return c==null?[]:(De(u)||(u=u==null?[]:[u]),g=C?i:g,De(g)||(g=g==null?[]:[g]),qw(c,u,g))}var nK=$c(function(c,u,g){c[g?0:1].push(u)},function(){return[[],[]]});function oK(c,u,g){var C=De(c)?ap:ww,y=arguments.length<3;return C(c,ve(u,4),g,y,xn)}function rK(c,u,g){var C=De(c)?vU:ww,y=arguments.length<3;return C(c,ve(u,4),g,y,Nw)}function lK(c,u){var g=De(c)?bn:Bw;return g(c,sd(ve(u,3)))}function aK(c){var u=De(c)?Lw:e$;return u(c)}function cK(c,u,g){(g?Xt(c,u,g):u===i)?u=1:u=Ie(u);var C=De(c)?M2:t$;return C(c,u)}function dK(c){var u=De(c)?k2:s$;return u(c)}function uK(c){if(c==null)return 0;if(ri(c))return od(c)?lr(c):c.length;var u=Ht(c);return u==os||u==rs?c.size:Pp(c).length}function hK(c,u,g){var C=De(c)?cp:n$;return g&&Xt(c,u,g)&&(u=i),C(c,ve(u,3))}var pK=Ne(function(c,u){if(c==null)return[];var g=u.length;return g>1&&Xt(c,u[0],u[1])?u=[]:g>2&&Xt(u[0],u[1],u[2])&&(u=[u[0]]),qw(c,Mt(u,1),[])}),td=jU||function(){return At.Date.now()};function gK(c,u){if(typeof u!="function")throw new ki(r);return c=Ie(c),function(){if(--c<1)return u.apply(this,arguments)}}function zS(c,u,g){return u=g?i:u,u=c&&u==null?c.length:u,zs(c,A,i,i,i,i,u)}function US(c,u){var g;if(typeof u!="function")throw new ki(r);return c=Ie(c),function(){return--c>0&&(g=u.apply(this,arguments)),c<=1&&(u=i),g}}var Qp=Ne(function(c,u,g){var C=b;if(g.length){var y=Fn(g,fr(Qp));C|=V}return zs(c,C,u,g,y)}),$S=Ne(function(c,u,g){var C=b|R;if(g.length){var y=Fn(g,fr($S));C|=V}return zs(u,C,c,g,y)});function KS(c,u,g){u=g?i:u;var C=zs(c,T,i,i,i,i,i,u);return C.placeholder=KS.placeholder,C}function jS(c,u,g){u=g?i:u;var C=zs(c,I,i,i,i,i,i,u);return C.placeholder=jS.placeholder,C}function ZS(c,u,g){var C,y,E,D,M,O,j=0,Z=!1,Y=!1,se=!0;if(typeof c!="function")throw new ki(r);u=Vi(u)||0,pt(g)&&(Z=!!g.leading,Y="maxWait"in g,E=Y?bt(Vi(g.maxWait)||0,u):E,se="trailing"in g?!!g.trailing:se);function pe(vt){var ds=C,Zs=y;return C=y=i,j=vt,D=c.apply(Zs,ds),D}function Se(vt){return j=vt,M=Yl(He,u),Z?pe(vt):D}function Oe(vt){var ds=vt-O,Zs=vt-j,py=u-ds;return Y?Gt(py,E-Zs):py}function ye(vt){var ds=vt-O,Zs=vt-j;return O===i||ds>=u||ds<0||Y&&Zs>=E}function He(){var vt=td();if(ye(vt))return Ue(vt);M=Yl(He,Oe(vt))}function Ue(vt){return M=i,se&&C?pe(vt):(C=y=i,D)}function bi(){M!==i&&nS(M),j=0,C=O=y=M=i}function Jt(){return M===i?D:Ue(td())}function Ri(){var vt=td(),ds=ye(vt);if(C=arguments,y=this,O=vt,ds){if(M===i)return Se(O);if(Y)return nS(M),M=Yl(He,u),pe(O)}return M===i&&(M=Yl(He,u)),D}return Ri.cancel=bi,Ri.flush=Jt,Ri}var fK=Ne(function(c,u){return Vw(c,1,u)}),mK=Ne(function(c,u,g){return Vw(c,Vi(u)||0,g)});function CK(c){return zs(c,N)}function id(c,u){if(typeof c!="function"||u!=null&&typeof u!="function")throw new ki(r);var g=function(){var C=arguments,y=u?u.apply(this,C):C[0],E=g.cache;if(E.has(y))return E.get(y);var D=c.apply(this,C);return g.cache=E.set(y,D)||E,D};return g.cache=new(id.Cache||Hs),g}id.Cache=Hs;function sd(c){if(typeof c!="function")throw new ki(r);return function(){var u=arguments;switch(u.length){case 0:return!c.call(this);case 1:return!c.call(this,u[0]);case 2:return!c.call(this,u[0],u[1]);case 3:return!c.call(this,u[0],u[1],u[2])}return!c.apply(this,u)}}function vK(c){return US(2,c)}var wK=o$(function(c,u){u=u.length==1&&De(u[0])?at(u[0],wi(ve())):at(Mt(u,1),wi(ve()));var g=u.length;return Ne(function(C){for(var y=-1,E=Gt(C.length,g);++y<E;)C[y]=u[y].call(this,C[y]);return vi(c,this,C)})}),Xp=Ne(function(c,u){var g=Fn(u,fr(Xp));return zs(c,V,i,u,g)}),qS=Ne(function(c,u){var g=Fn(u,fr(qS));return zs(c,L,i,u,g)}),SK=Us(function(c,u){return zs(c,k,i,i,i,u)});function yK(c,u){if(typeof c!="function")throw new ki(r);return u=u===i?u:Ie(u),Ne(c,u)}function bK(c,u){if(typeof c!="function")throw new ki(r);return u=u==null?0:bt(Ie(u),0),Ne(function(g){var C=g[u],y=Tn(g,0,u);return C&&Rn(y,C),vi(c,this,y)})}function RK(c,u,g){var C=!0,y=!0;if(typeof c!="function")throw new ki(r);return pt(g)&&(C="leading"in g?!!g.leading:C,y="trailing"in g?!!g.trailing:y),ZS(c,u,{leading:C,maxWait:u,trailing:y})}function FK(c){return zS(c,1)}function EK(c,u){return Xp(Op(u),c)}function xK(){if(!arguments.length)return[];var c=arguments[0];return De(c)?c:[c]}function PK(c){return Li(c,v)}function DK(c,u){return u=typeof u=="function"?u:i,Li(c,v,u)}function TK(c){return Li(c,f|v)}function AK(c,u){return u=typeof u=="function"?u:i,Li(c,f|v,u)}function MK(c,u){return u==null||Ow(c,u,Dt(u))}function cs(c,u){return c===u||c!==c&&u!==u}var kK=qc(Fp),IK=qc(function(c,u){return c>=u}),mo=Ww(function(){return arguments}())?Ww:function(c){return gt(c)&&Xe.call(c,"callee")&&!Dw.call(c,"callee")},De=H.isArray,LK=cw?wi(cw):W2;function ri(c){return c!=null&&nd(c.length)&&!Ks(c)}function Ct(c){return gt(c)&&ri(c)}function _K(c){return c===!0||c===!1||gt(c)&&Qt(c)==Al}var An=qU||cg,OK=dw?wi(dw):z2;function VK(c){return gt(c)&&c.nodeType===1&&!Ql(c)}function NK(c){if(c==null)return!0;if(ri(c)&&(De(c)||typeof c=="string"||typeof c.splice=="function"||An(c)||mr(c)||mo(c)))return!c.length;var u=Ht(c);if(u==os||u==rs)return!c.size;if(ql(c))return!Pp(c).length;for(var g in c)if(Xe.call(c,g))return!1;return!0}function BK(c,u){return Kl(c,u)}function GK(c,u,g){g=typeof g=="function"?g:i;var C=g?g(c,u):i;return C===i?Kl(c,u,i,g):!!C}function Jp(c){if(!gt(c))return!1;var u=Qt(c);return u==mc||u==cz||typeof c.message=="string"&&typeof c.name=="string"&&!Ql(c)}function HK(c){return typeof c=="number"&&Aw(c)}function Ks(c){if(!pt(c))return!1;var u=Qt(c);return u==Cc||u==Vv||u==az||u==uz}function YS(c){return typeof c=="number"&&c==Ie(c)}function nd(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Ge}function pt(c){var u=typeof c;return c!=null&&(u=="object"||u=="function")}function gt(c){return c!=null&&typeof c=="object"}var QS=uw?wi(uw):$2;function WK(c,u){return c===u||xp(c,u,zp(u))}function zK(c,u,g){return g=typeof g=="function"?g:i,xp(c,u,zp(u),g)}function UK(c){return XS(c)&&c!=+c}function $K(c){if(D$(c))throw new Pe(o);return zw(c)}function KK(c){return c===null}function jK(c){return c==null}function XS(c){return typeof c=="number"||gt(c)&&Qt(c)==kl}function Ql(c){if(!gt(c)||Qt(c)!=Bs)return!1;var u=Mc(c);if(u===null)return!0;var g=Xe.call(u,"constructor")&&u.constructor;return typeof g=="function"&&g instanceof g&&Pc.call(g)==zU}var eg=hw?wi(hw):K2;function ZK(c){return YS(c)&&c>=-Ge&&c<=Ge}var JS=pw?wi(pw):j2;function od(c){return typeof c=="string"||!De(c)&&gt(c)&&Qt(c)==Ll}function yi(c){return typeof c=="symbol"||gt(c)&&Qt(c)==vc}var mr=gw?wi(gw):Z2;function qK(c){return c===i}function YK(c){return gt(c)&&Ht(c)==_l}function QK(c){return gt(c)&&Qt(c)==pz}var XK=qc(Dp),JK=qc(function(c,u){return c<=u});function ey(c){if(!c)return[];if(ri(c))return od(c)?ls(c):oi(c);if(Nl&&c[Nl])return MU(c[Nl]());var u=Ht(c),g=u==os?fp:u==rs?Fc:Cr;return g(c)}function js(c){if(!c)return c===0?c:0;if(c=Vi(c),c===Me||c===-Me){var u=c<0?-1:1;return u*ro}return c===c?c:0}function Ie(c){var u=js(c),g=u%1;return u===u?g?u-g:u:0}function ty(c){return c?ho(Ie(c),0,ni):0}function Vi(c){if(typeof c=="number")return c;if(yi(c))return yn;if(pt(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=pt(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=Sw(c);var g=Lz.test(c);return g||Oz.test(c)?gU(c.slice(2),g?2:8):Iz.test(c)?yn:+c}function iy(c){return Fs(c,li(c))}function e4(c){return c?ho(Ie(c),-Ge,Ge):c===0?c:0}function Qe(c){return c==null?"":Si(c)}var t4=pr(function(c,u){if(ql(u)||ri(u)){Fs(u,Dt(u),c);return}for(var g in u)Xe.call(u,g)&&zl(c,g,u[g])}),sy=pr(function(c,u){Fs(u,li(u),c)}),rd=pr(function(c,u,g,C){Fs(u,li(u),c,C)}),i4=pr(function(c,u,g,C){Fs(u,Dt(u),c,C)}),s4=Us(yp);function n4(c,u){var g=hr(c);return u==null?g:_w(g,u)}var o4=Ne(function(c,u){c=tt(c);var g=-1,C=u.length,y=C>2?u[2]:i;for(y&&Xt(u[0],u[1],y)&&(C=1);++g<C;)for(var E=u[g],D=li(E),M=-1,O=D.length;++M<O;){var j=D[M],Z=c[j];(Z===i||cs(Z,cr[j])&&!Xe.call(c,j))&&(c[j]=E[j])}return c}),r4=Ne(function(c){return c.push(i,SS),vi(ny,i,c)});function l4(c,u){return mw(c,ve(u,3),Rs)}function a4(c,u){return mw(c,ve(u,3),Rp)}function c4(c,u){return c==null?c:bp(c,ve(u,3),li)}function d4(c,u){return c==null?c:Gw(c,ve(u,3),li)}function u4(c,u){return c&&Rs(c,ve(u,3))}function h4(c,u){return c&&Rp(c,ve(u,3))}function p4(c){return c==null?[]:Hc(c,Dt(c))}function g4(c){return c==null?[]:Hc(c,li(c))}function tg(c,u,g){var C=c==null?i:po(c,u);return C===i?g:C}function f4(c,u){return c!=null&&RS(c,u,N2)}function ig(c,u){return c!=null&&RS(c,u,B2)}var m4=fS(function(c,u,g){u!=null&&typeof u.toString!="function"&&(u=Dc.call(u)),c[u]=g},ng(ai)),C4=fS(function(c,u,g){u!=null&&typeof u.toString!="function"&&(u=Dc.call(u)),Xe.call(c,u)?c[u].push(g):c[u]=[g]},ve),v4=Ne($l);function Dt(c){return ri(c)?Iw(c):Pp(c)}function li(c){return ri(c)?Iw(c,!0):q2(c)}function w4(c,u){var g={};return u=ve(u,3),Rs(c,function(C,y,E){Ws(g,u(C,y,E),C)}),g}function S4(c,u){var g={};return u=ve(u,3),Rs(c,function(C,y,E){Ws(g,y,u(C,y,E))}),g}var y4=pr(function(c,u,g){Wc(c,u,g)}),ny=pr(function(c,u,g,C){Wc(c,u,g,C)}),b4=Us(function(c,u){var g={};if(c==null)return g;var C=!1;u=at(u,function(E){return E=Dn(E,c),C||(C=E.length>1),E}),Fs(c,Hp(c),g),C&&(g=Li(g,f|m|v,m$));for(var y=u.length;y--;)Ip(g,u[y]);return g});function R4(c,u){return oy(c,sd(ve(u)))}var F4=Us(function(c,u){return c==null?{}:Q2(c,u)});function oy(c,u){if(c==null)return{};var g=at(Hp(c),function(C){return[C]});return u=ve(u),Yw(c,g,function(C,y){return u(C,y[0])})}function E4(c,u,g){u=Dn(u,c);var C=-1,y=u.length;for(y||(y=1,c=i);++C<y;){var E=c==null?i:c[Es(u[C])];E===i&&(C=y,E=g),c=Ks(E)?E.call(c):E}return c}function x4(c,u,g){return c==null?c:jl(c,u,g)}function P4(c,u,g,C){return C=typeof C=="function"?C:i,c==null?c:jl(c,u,g,C)}var ry=vS(Dt),ly=vS(li);function D4(c,u,g){var C=De(c),y=C||An(c)||mr(c);if(u=ve(u,4),g==null){var E=c&&c.constructor;y?g=C?new E:[]:pt(c)?g=Ks(E)?hr(Mc(c)):{}:g={}}return(y?Mi:Rs)(c,function(D,M,O){return u(g,D,M,O)}),g}function T4(c,u){return c==null?!0:Ip(c,u)}function A4(c,u,g){return c==null?c:tS(c,u,Op(g))}function M4(c,u,g,C){return C=typeof C=="function"?C:i,c==null?c:tS(c,u,Op(g),C)}function Cr(c){return c==null?[]:gp(c,Dt(c))}function k4(c){return c==null?[]:gp(c,li(c))}function I4(c,u,g){return g===i&&(g=u,u=i),g!==i&&(g=Vi(g),g=g===g?g:0),u!==i&&(u=Vi(u),u=u===u?u:0),ho(Vi(c),u,g)}function L4(c,u,g){return u=js(u),g===i?(g=u,u=0):g=js(g),c=Vi(c),G2(c,u,g)}function _4(c,u,g){if(g&&typeof g!="boolean"&&Xt(c,u,g)&&(u=g=i),g===i&&(typeof u=="boolean"?(g=u,u=i):typeof c=="boolean"&&(g=c,c=i)),c===i&&u===i?(c=0,u=1):(c=js(c),u===i?(u=c,c=0):u=js(u)),c>u){var C=c;c=u,u=C}if(g||c%1||u%1){var y=Mw();return Gt(c+y*(u-c+pU("1e-"+((y+"").length-1))),u)}return Ap(c,u)}var O4=gr(function(c,u,g){return u=u.toLowerCase(),c+(g?ay(u):u)});function ay(c){return sg(Qe(c).toLowerCase())}function cy(c){return c=Qe(c),c&&c.replace(Nz,xU).replace(sU,"")}function V4(c,u,g){c=Qe(c),u=Si(u);var C=c.length;g=g===i?C:ho(Ie(g),0,C);var y=g;return g-=u.length,g>=0&&c.slice(g,y)==u}function N4(c){return c=Qe(c),c&&vz.test(c)?c.replace(Gv,PU):c}function B4(c){return c=Qe(c),c&&Fz.test(c)?c.replace(Xh,"\\$&"):c}var G4=gr(function(c,u,g){return c+(g?"-":"")+u.toLowerCase()}),H4=gr(function(c,u,g){return c+(g?" ":"")+u.toLowerCase()}),W4=hS("toLowerCase");function z4(c,u,g){c=Qe(c),u=Ie(u);var C=u?lr(c):0;if(!u||C>=u)return c;var y=(u-C)/2;return Zc(_c(y),g)+c+Zc(Lc(y),g)}function U4(c,u,g){c=Qe(c),u=Ie(u);var C=u?lr(c):0;return u&&C<u?c+Zc(u-C,g):c}function $4(c,u,g){c=Qe(c),u=Ie(u);var C=u?lr(c):0;return u&&C<u?Zc(u-C,g)+c:c}function K4(c,u,g){return g||u==null?u=0:u&&(u=+u),JU(Qe(c).replace(Jh,""),u||0)}function j4(c,u,g){return(g?Xt(c,u,g):u===i)?u=1:u=Ie(u),Mp(Qe(c),u)}function Z4(){var c=arguments,u=Qe(c[0]);return c.length<3?u:u.replace(c[1],c[2])}var q4=gr(function(c,u,g){return c+(g?"_":"")+u.toLowerCase()});function Y4(c,u,g){return g&&typeof g!="number"&&Xt(c,u,g)&&(u=g=i),g=g===i?ni:g>>>0,g?(c=Qe(c),c&&(typeof u=="string"||u!=null&&!eg(u))&&(u=Si(u),!u&&rr(c))?Tn(ls(c),0,g):c.split(u,g)):[]}var Q4=gr(function(c,u,g){return c+(g?" ":"")+sg(u)});function X4(c,u,g){return c=Qe(c),g=g==null?0:ho(Ie(g),0,c.length),u=Si(u),c.slice(g,g+u.length)==u}function J4(c,u,g){var C=F.templateSettings;g&&Xt(c,u,g)&&(u=i),c=Qe(c),u=rd({},u,C,wS);var y=rd({},u.imports,C.imports,wS),E=Dt(y),D=gp(y,E),M,O,j=0,Z=u.interpolate||wc,Y="__p += '",se=mp((u.escape||wc).source+"|"+Z.source+"|"+(Z===Hv?kz:wc).source+"|"+(u.evaluate||wc).source+"|$","g"),pe="//# sourceURL="+(Xe.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++aU+"]")+`
233
- `;c.replace(se,function(ye,He,Ue,bi,Jt,Ri){return Ue||(Ue=bi),Y+=c.slice(j,Ri).replace(Bz,DU),He&&(M=!0,Y+=`' +
234
- __e(`+He+`) +
235
- '`),Jt&&(O=!0,Y+=`';
236
- `+Jt+`;
237
- __p += '`),Ue&&(Y+=`' +
238
- ((__t = (`+Ue+`)) == null ? '' : __t) +
239
- '`),j=Ri+ye.length,ye}),Y+=`';
240
- `;var Se=Xe.call(u,"variable")&&u.variable;if(!Se)Y=`with (obj) {
241
- `+Y+`
28
+ */da.exports,function(i,e){(function(){var t,a="4.17.21",s=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",x=1,R=2,T=4,C=1,k=2,S=1,v=2,I=4,K=8,j=16,z=32,W=64,O=128,B=256,P=512,Z=30,L="...",H=800,oe=16,de=1,ae=2,J=3,Ce=1/0,Be=9007199254740991,Ar=17976931348623157e292,or=NaN,Et=4294967295,rC=Et-1,iC=Et>>>1,oC=[["ary",O],["bind",S],["bindKey",v],["curry",K],["curryRight",j],["flip",P],["partial",z],["partialRight",W],["rearg",B]],si="[object Arguments]",ha="[object Array]",aC="[object AsyncFunction]",po="[object Boolean]",ho="[object Date]",sC="[object DOMException]",ma="[object Error]",ga="[object Function]",Vu="[object GeneratorFunction]",pn="[object Map]",mo="[object Number]",lC="[object Null]",Rn="[object Object]",Nu="[object Promise]",cC="[object Proxy]",go="[object RegExp]",hn="[object Set]",yo="[object String]",ya="[object Symbol]",dC="[object Undefined]",_o="[object WeakMap]",uC="[object WeakSet]",wo="[object ArrayBuffer]",li="[object DataView]",hl="[object Float32Array]",ml="[object Float64Array]",gl="[object Int8Array]",yl="[object Int16Array]",_l="[object Int32Array]",wl="[object Uint8Array]",bl="[object Uint8ClampedArray]",kl="[object Uint16Array]",xl="[object Uint32Array]",fC=/\b__p \+= '';/g,pC=/\b(__p \+=) '' \+/g,hC=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bu=/&(?:amp|lt|gt|quot|#39);/g,Ou=/[&<>"']/g,mC=RegExp(Bu.source),gC=RegExp(Ou.source),yC=/<%-([\s\S]+?)%>/g,_C=/<%([\s\S]+?)%>/g,Au=/<%=([\s\S]+?)%>/g,wC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bC=/^\w*$/,kC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vl=/[\\^$.*+?()[\]{}|]/g,xC=RegExp(vl.source),Cl=/^\s+/,vC=/\s/,CC=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,EC=/\{\n\/\* \[wrapped with (.+)\] \*/,SC=/,? & /,TC=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,VC=/[()=,{}\[\]\/\s]/,NC=/\\(\\)?/g,BC=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ru=/\w*$/,OC=/^[-+]0x[0-9a-f]+$/i,AC=/^0b[01]+$/i,RC=/^\[object .+?Constructor\]$/,DC=/^0o[0-7]+$/i,IC=/^(?:0|[1-9]\d*)$/,MC=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_a=/($^)/,PC=/['\n\r\u2028\u2029\\]/g,wa="\\ud800-\\udfff",LC="\\u0300-\\u036f",FC="\\ufe20-\\ufe2f",$C="\\u20d0-\\u20ff",Du=LC+FC+$C,Iu="\\u2700-\\u27bf",Mu="a-z\\xdf-\\xf6\\xf8-\\xff",zC="\\xac\\xb1\\xd7\\xf7",ZC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",UC="\\u2000-\\u206f",jC=" \\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",Pu="A-Z\\xc0-\\xd6\\xd8-\\xde",Lu="\\ufe0e\\ufe0f",Fu=zC+ZC+UC+jC,El="['’]",WC="["+wa+"]",$u="["+Fu+"]",ba="["+Du+"]",zu="\\d+",HC="["+Iu+"]",Zu="["+Mu+"]",Uu="[^"+wa+Fu+zu+Iu+Mu+Pu+"]",Sl="\\ud83c[\\udffb-\\udfff]",qC="(?:"+ba+"|"+Sl+")",ju="[^"+wa+"]",Tl="(?:\\ud83c[\\udde6-\\uddff]){2}",Vl="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+Pu+"]",Wu="\\u200d",Hu="(?:"+Zu+"|"+Uu+")",GC="(?:"+ci+"|"+Uu+")",qu="(?:"+El+"(?:d|ll|m|re|s|t|ve))?",Gu="(?:"+El+"(?:D|LL|M|RE|S|T|VE))?",Ku=qC+"?",Yu="["+Lu+"]?",KC="(?:"+Wu+"(?:"+[ju,Tl,Vl].join("|")+")"+Yu+Ku+")*",YC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",JC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ju=Yu+Ku+KC,XC="(?:"+[HC,Tl,Vl].join("|")+")"+Ju,QC="(?:"+[ju+ba+"?",ba,Tl,Vl,WC].join("|")+")",eE=RegExp(El,"g"),tE=RegExp(ba,"g"),Nl=RegExp(Sl+"(?="+Sl+")|"+QC+Ju,"g"),nE=RegExp([ci+"?"+Zu+"+"+qu+"(?="+[$u,ci,"$"].join("|")+")",GC+"+"+Gu+"(?="+[$u,ci+Hu,"$"].join("|")+")",ci+"?"+Hu+"+"+qu,ci+"+"+Gu,JC,YC,zu,XC].join("|"),"g"),rE=RegExp("["+Wu+wa+Du+Lu+"]"),iE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oE=["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"],aE=-1,je={};je[hl]=je[ml]=je[gl]=je[yl]=je[_l]=je[wl]=je[bl]=je[kl]=je[xl]=!0,je[si]=je[ha]=je[wo]=je[po]=je[li]=je[ho]=je[ma]=je[ga]=je[pn]=je[mo]=je[Rn]=je[go]=je[hn]=je[yo]=je[_o]=!1;var Ze={};Ze[si]=Ze[ha]=Ze[wo]=Ze[li]=Ze[po]=Ze[ho]=Ze[hl]=Ze[ml]=Ze[gl]=Ze[yl]=Ze[_l]=Ze[pn]=Ze[mo]=Ze[Rn]=Ze[go]=Ze[hn]=Ze[yo]=Ze[ya]=Ze[wl]=Ze[bl]=Ze[kl]=Ze[xl]=!0,Ze[ma]=Ze[ga]=Ze[_o]=!1;var sE={À:"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"},lE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cE={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},dE={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},uE=parseFloat,fE=parseInt,Xu=typeof vi=="object"&&vi&&vi.Object===Object&&vi,pE=typeof self=="object"&&self&&self.Object===Object&&self,dt=Xu||pE||Function("return this")(),Bl=e&&!e.nodeType&&e,Rr=Bl&&!0&&i&&!i.nodeType&&i,Qu=Rr&&Rr.exports===Bl,Ol=Qu&&Xu.process,Ut=function(){try{var V=Rr&&Rr.require&&Rr.require("util").types;return V||Ol&&Ol.binding&&Ol.binding("util")}catch{}}(),ef=Ut&&Ut.isArrayBuffer,tf=Ut&&Ut.isDate,nf=Ut&&Ut.isMap,rf=Ut&&Ut.isRegExp,of=Ut&&Ut.isSet,af=Ut&&Ut.isTypedArray;function Mt(V,M,D){switch(D.length){case 0:return V.call(M);case 1:return V.call(M,D[0]);case 2:return V.call(M,D[0],D[1]);case 3:return V.call(M,D[0],D[1],D[2])}return V.apply(M,D)}function hE(V,M,D,re){for(var be=-1,Pe=V==null?0:V.length;++be<Pe;){var it=V[be];M(re,it,D(it),V)}return re}function jt(V,M){for(var D=-1,re=V==null?0:V.length;++D<re&&M(V[D],D,V)!==!1;);return V}function mE(V,M){for(var D=V==null?0:V.length;D--&&M(V[D],D,V)!==!1;);return V}function sf(V,M){for(var D=-1,re=V==null?0:V.length;++D<re;)if(!M(V[D],D,V))return!1;return!0}function ar(V,M){for(var D=-1,re=V==null?0:V.length,be=0,Pe=[];++D<re;){var it=V[D];M(it,D,V)&&(Pe[be++]=it)}return Pe}function ka(V,M){var D=V==null?0:V.length;return!!D&&di(V,M,0)>-1}function Al(V,M,D){for(var re=-1,be=V==null?0:V.length;++re<be;)if(D(M,V[re]))return!0;return!1}function He(V,M){for(var D=-1,re=V==null?0:V.length,be=Array(re);++D<re;)be[D]=M(V[D],D,V);return be}function sr(V,M){for(var D=-1,re=M.length,be=V.length;++D<re;)V[be+D]=M[D];return V}function Rl(V,M,D,re){var be=-1,Pe=V==null?0:V.length;for(re&&Pe&&(D=V[++be]);++be<Pe;)D=M(D,V[be],be,V);return D}function gE(V,M,D,re){var be=V==null?0:V.length;for(re&&be&&(D=V[--be]);be--;)D=M(D,V[be],be,V);return D}function Dl(V,M){for(var D=-1,re=V==null?0:V.length;++D<re;)if(M(V[D],D,V))return!0;return!1}var yE=Il("length");function _E(V){return V.split("")}function wE(V){return V.match(TC)||[]}function lf(V,M,D){var re;return D(V,function(be,Pe,it){if(M(be,Pe,it))return re=Pe,!1}),re}function xa(V,M,D,re){for(var be=V.length,Pe=D+(re?1:-1);re?Pe--:++Pe<be;)if(M(V[Pe],Pe,V))return Pe;return-1}function di(V,M,D){return M===M?OE(V,M,D):xa(V,cf,D)}function bE(V,M,D,re){for(var be=D-1,Pe=V.length;++be<Pe;)if(re(V[be],M))return be;return-1}function cf(V){return V!==V}function df(V,M){var D=V==null?0:V.length;return D?Pl(V,M)/D:or}function Il(V){return function(M){return M==null?t:M[V]}}function Ml(V){return function(M){return V==null?t:V[M]}}function uf(V,M,D,re,be){return be(V,function(Pe,it,ze){D=re?(re=!1,Pe):M(D,Pe,it,ze)}),D}function kE(V,M){var D=V.length;for(V.sort(M);D--;)V[D]=V[D].value;return V}function Pl(V,M){for(var D,re=-1,be=V.length;++re<be;){var Pe=M(V[re]);Pe!==t&&(D=D===t?Pe:D+Pe)}return D}function Ll(V,M){for(var D=-1,re=Array(V);++D<V;)re[D]=M(D);return re}function xE(V,M){return He(M,function(D){return[D,V[D]]})}function ff(V){return V&&V.slice(0,gf(V)+1).replace(Cl,"")}function Pt(V){return function(M){return V(M)}}function Fl(V,M){return He(M,function(D){return V[D]})}function bo(V,M){return V.has(M)}function pf(V,M){for(var D=-1,re=V.length;++D<re&&di(M,V[D],0)>-1;);return D}function hf(V,M){for(var D=V.length;D--&&di(M,V[D],0)>-1;);return D}function vE(V,M){for(var D=V.length,re=0;D--;)V[D]===M&&++re;return re}var CE=Ml(sE),EE=Ml(lE);function SE(V){return"\\"+dE[V]}function TE(V,M){return V==null?t:V[M]}function ui(V){return rE.test(V)}function VE(V){return iE.test(V)}function NE(V){for(var M,D=[];!(M=V.next()).done;)D.push(M.value);return D}function $l(V){var M=-1,D=Array(V.size);return V.forEach(function(re,be){D[++M]=[be,re]}),D}function mf(V,M){return function(D){return V(M(D))}}function lr(V,M){for(var D=-1,re=V.length,be=0,Pe=[];++D<re;){var it=V[D];(it===M||it===g)&&(V[D]=g,Pe[be++]=D)}return Pe}function va(V){var M=-1,D=Array(V.size);return V.forEach(function(re){D[++M]=re}),D}function BE(V){var M=-1,D=Array(V.size);return V.forEach(function(re){D[++M]=[re,re]}),D}function OE(V,M,D){for(var re=D-1,be=V.length;++re<be;)if(V[re]===M)return re;return-1}function AE(V,M,D){for(var re=D+1;re--;)if(V[re]===M)return re;return re}function fi(V){return ui(V)?DE(V):yE(V)}function mn(V){return ui(V)?IE(V):_E(V)}function gf(V){for(var M=V.length;M--&&vC.test(V.charAt(M)););return M}var RE=Ml(cE);function DE(V){for(var M=Nl.lastIndex=0;Nl.test(V);)++M;return M}function IE(V){return V.match(Nl)||[]}function ME(V){return V.match(nE)||[]}var PE=function V(M){M=M==null?dt:pi.defaults(dt.Object(),M,pi.pick(dt,oE));var D=M.Array,re=M.Date,be=M.Error,Pe=M.Function,it=M.Math,ze=M.Object,zl=M.RegExp,LE=M.String,Wt=M.TypeError,Ca=D.prototype,FE=Pe.prototype,hi=ze.prototype,Ea=M["__core-js_shared__"],Sa=FE.toString,$e=hi.hasOwnProperty,$E=0,yf=function(){var r=/[^.]+$/.exec(Ea&&Ea.keys&&Ea.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Ta=hi.toString,zE=Sa.call(ze),ZE=dt._,UE=zl("^"+Sa.call($e).replace(vl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Va=Qu?M.Buffer:t,cr=M.Symbol,Na=M.Uint8Array,_f=Va?Va.allocUnsafe:t,Ba=mf(ze.getPrototypeOf,ze),wf=ze.create,bf=hi.propertyIsEnumerable,Oa=Ca.splice,kf=cr?cr.isConcatSpreadable:t,ko=cr?cr.iterator:t,Dr=cr?cr.toStringTag:t,Aa=function(){try{var r=Fr(ze,"defineProperty");return r({},"",{}),r}catch{}}(),jE=M.clearTimeout!==dt.clearTimeout&&M.clearTimeout,WE=re&&re.now!==dt.Date.now&&re.now,HE=M.setTimeout!==dt.setTimeout&&M.setTimeout,Ra=it.ceil,Da=it.floor,Zl=ze.getOwnPropertySymbols,qE=Va?Va.isBuffer:t,xf=M.isFinite,GE=Ca.join,KE=mf(ze.keys,ze),ot=it.max,gt=it.min,YE=re.now,JE=M.parseInt,vf=it.random,XE=Ca.reverse,Ul=Fr(M,"DataView"),xo=Fr(M,"Map"),jl=Fr(M,"Promise"),mi=Fr(M,"Set"),vo=Fr(M,"WeakMap"),Co=Fr(ze,"create"),Ia=vo&&new vo,gi={},QE=$r(Ul),eS=$r(xo),tS=$r(jl),nS=$r(mi),rS=$r(vo),Ma=cr?cr.prototype:t,Eo=Ma?Ma.valueOf:t,Cf=Ma?Ma.toString:t;function y(r){if(Xe(r)&&!ke(r)&&!(r instanceof Ae)){if(r instanceof Ht)return r;if($e.call(r,"__wrapped__"))return Ep(r)}return new Ht(r)}var yi=function(){function r(){}return function(o){if(!Je(o))return{};if(wf)return wf(o);r.prototype=o;var l=new r;return r.prototype=t,l}}();function Pa(){}function Ht(r,o){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}y.templateSettings={escape:yC,evaluate:_C,interpolate:Au,variable:"",imports:{_:y}},y.prototype=Pa.prototype,y.prototype.constructor=y,Ht.prototype=yi(Pa.prototype),Ht.prototype.constructor=Ht;function Ae(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Et,this.__views__=[]}function iS(){var r=new Ae(this.__wrapped__);return r.__actions__=St(this.__actions__),r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=St(this.__iteratees__),r.__takeCount__=this.__takeCount__,r.__views__=St(this.__views__),r}function oS(){if(this.__filtered__){var r=new Ae(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function aS(){var r=this.__wrapped__.value(),o=this.__dir__,l=ke(r),f=o<0,m=l?r.length:0,_=_T(0,m,this.__views__),b=_.start,E=_.end,N=E-b,F=f?E:b-1,$=this.__iteratees__,U=$.length,X=0,se=gt(N,this.__takeCount__);if(!l||!f&&m==N&&se==N)return Gf(r,this.__actions__);var pe=[];e:for(;N--&&X<se;){F+=o;for(var Ve=-1,he=r[F];++Ve<U;){var Oe=$[Ve],Re=Oe.iteratee,$t=Oe.type,Ct=Re(he);if($t==ae)he=Ct;else if(!Ct){if($t==de)continue e;break e}}pe[X++]=he}return pe}Ae.prototype=yi(Pa.prototype),Ae.prototype.constructor=Ae;function Ir(r){var o=-1,l=r==null?0:r.length;for(this.clear();++o<l;){var f=r[o];this.set(f[0],f[1])}}function sS(){this.__data__=Co?Co(null):{},this.size=0}function lS(r){var o=this.has(r)&&delete this.__data__[r];return this.size-=o?1:0,o}function cS(r){var o=this.__data__;if(Co){var l=o[r];return l===p?t:l}return $e.call(o,r)?o[r]:t}function dS(r){var o=this.__data__;return Co?o[r]!==t:$e.call(o,r)}function uS(r,o){var l=this.__data__;return this.size+=this.has(r)?0:1,l[r]=Co&&o===t?p:o,this}Ir.prototype.clear=sS,Ir.prototype.delete=lS,Ir.prototype.get=cS,Ir.prototype.has=dS,Ir.prototype.set=uS;function Dn(r){var o=-1,l=r==null?0:r.length;for(this.clear();++o<l;){var f=r[o];this.set(f[0],f[1])}}function fS(){this.__data__=[],this.size=0}function pS(r){var o=this.__data__,l=La(o,r);if(l<0)return!1;var f=o.length-1;return l==f?o.pop():Oa.call(o,l,1),--this.size,!0}function hS(r){var o=this.__data__,l=La(o,r);return l<0?t:o[l][1]}function mS(r){return La(this.__data__,r)>-1}function gS(r,o){var l=this.__data__,f=La(l,r);return f<0?(++this.size,l.push([r,o])):l[f][1]=o,this}Dn.prototype.clear=fS,Dn.prototype.delete=pS,Dn.prototype.get=hS,Dn.prototype.has=mS,Dn.prototype.set=gS;function In(r){var o=-1,l=r==null?0:r.length;for(this.clear();++o<l;){var f=r[o];this.set(f[0],f[1])}}function yS(){this.size=0,this.__data__={hash:new Ir,map:new(xo||Dn),string:new Ir}}function _S(r){var o=Ya(this,r).delete(r);return this.size-=o?1:0,o}function wS(r){return Ya(this,r).get(r)}function bS(r){return Ya(this,r).has(r)}function kS(r,o){var l=Ya(this,r),f=l.size;return l.set(r,o),this.size+=l.size==f?0:1,this}In.prototype.clear=yS,In.prototype.delete=_S,In.prototype.get=wS,In.prototype.has=bS,In.prototype.set=kS;function Mr(r){var o=-1,l=r==null?0:r.length;for(this.__data__=new In;++o<l;)this.add(r[o])}function xS(r){return this.__data__.set(r,p),this}function vS(r){return this.__data__.has(r)}Mr.prototype.add=Mr.prototype.push=xS,Mr.prototype.has=vS;function gn(r){var o=this.__data__=new Dn(r);this.size=o.size}function CS(){this.__data__=new Dn,this.size=0}function ES(r){var o=this.__data__,l=o.delete(r);return this.size=o.size,l}function SS(r){return this.__data__.get(r)}function TS(r){return this.__data__.has(r)}function VS(r,o){var l=this.__data__;if(l instanceof Dn){var f=l.__data__;if(!xo||f.length<s-1)return f.push([r,o]),this.size=++l.size,this;l=this.__data__=new In(f)}return l.set(r,o),this.size=l.size,this}gn.prototype.clear=CS,gn.prototype.delete=ES,gn.prototype.get=SS,gn.prototype.has=TS,gn.prototype.set=VS;function Ef(r,o){var l=ke(r),f=!l&&zr(r),m=!l&&!f&&hr(r),_=!l&&!f&&!m&&ki(r),b=l||f||m||_,E=b?Ll(r.length,LE):[],N=E.length;for(var F in r)(o||$e.call(r,F))&&!(b&&(F=="length"||m&&(F=="offset"||F=="parent")||_&&(F=="buffer"||F=="byteLength"||F=="byteOffset")||Fn(F,N)))&&E.push(F);return E}function Sf(r){var o=r.length;return o?r[tc(0,o-1)]:t}function NS(r,o){return Ja(St(r),Pr(o,0,r.length))}function BS(r){return Ja(St(r))}function Wl(r,o,l){(l!==t&&!yn(r[o],l)||l===t&&!(o in r))&&Mn(r,o,l)}function So(r,o,l){var f=r[o];(!($e.call(r,o)&&yn(f,l))||l===t&&!(o in r))&&Mn(r,o,l)}function La(r,o){for(var l=r.length;l--;)if(yn(r[l][0],o))return l;return-1}function OS(r,o,l,f){return dr(r,function(m,_,b){o(f,m,l(m),b)}),f}function Tf(r,o){return r&&Sn(o,ct(o),r)}function AS(r,o){return r&&Sn(o,Vt(o),r)}function Mn(r,o,l){o=="__proto__"&&Aa?Aa(r,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):r[o]=l}function Hl(r,o){for(var l=-1,f=o.length,m=D(f),_=r==null;++l<f;)m[l]=_?t:Sc(r,o[l]);return m}function Pr(r,o,l){return r===r&&(l!==t&&(r=r<=l?r:l),o!==t&&(r=r>=o?r:o)),r}function qt(r,o,l,f,m,_){var b,E=o&x,N=o&R,F=o&T;if(l&&(b=m?l(r,f,m,_):l(r)),b!==t)return b;if(!Je(r))return r;var $=ke(r);if($){if(b=bT(r),!E)return St(r,b)}else{var U=yt(r),X=U==ga||U==Vu;if(hr(r))return Jf(r,E);if(U==Rn||U==si||X&&!m){if(b=N||X?{}:gp(r),!E)return N?cT(r,AS(b,r)):lT(r,Tf(b,r))}else{if(!Ze[U])return m?r:{};b=kT(r,U,E)}}_||(_=new gn);var se=_.get(r);if(se)return se;_.set(r,b),Wp(r)?r.forEach(function(he){b.add(qt(he,o,l,he,r,_))}):Up(r)&&r.forEach(function(he,Oe){b.set(Oe,qt(he,o,l,Oe,r,_))});var pe=F?N?fc:uc:N?Vt:ct,Ve=$?t:pe(r);return jt(Ve||r,function(he,Oe){Ve&&(Oe=he,he=r[Oe]),So(b,Oe,qt(he,o,l,Oe,r,_))}),b}function RS(r){var o=ct(r);return function(l){return Vf(l,r,o)}}function Vf(r,o,l){var f=l.length;if(r==null)return!f;for(r=ze(r);f--;){var m=l[f],_=o[m],b=r[m];if(b===t&&!(m in r)||!_(b))return!1}return!0}function Nf(r,o,l){if(typeof r!="function")throw new Wt(d);return Ro(function(){r.apply(t,l)},o)}function To(r,o,l,f){var m=-1,_=ka,b=!0,E=r.length,N=[],F=o.length;if(!E)return N;l&&(o=He(o,Pt(l))),f?(_=Al,b=!1):o.length>=s&&(_=bo,b=!1,o=new Mr(o));e:for(;++m<E;){var $=r[m],U=l==null?$:l($);if($=f||$!==0?$:0,b&&U===U){for(var X=F;X--;)if(o[X]===U)continue e;N.push($)}else _(o,U,f)||N.push($)}return N}var dr=np(En),Bf=np(Gl,!0);function DS(r,o){var l=!0;return dr(r,function(f,m,_){return l=!!o(f,m,_),l}),l}function Fa(r,o,l){for(var f=-1,m=r.length;++f<m;){var _=r[f],b=o(_);if(b!=null&&(E===t?b===b&&!Ft(b):l(b,E)))var E=b,N=_}return N}function IS(r,o,l,f){var m=r.length;for(l=Ee(l),l<0&&(l=-l>m?0:m+l),f=f===t||f>m?m:Ee(f),f<0&&(f+=m),f=l>f?0:qp(f);l<f;)r[l++]=o;return r}function Of(r,o){var l=[];return dr(r,function(f,m,_){o(f,m,_)&&l.push(f)}),l}function ut(r,o,l,f,m){var _=-1,b=r.length;for(l||(l=vT),m||(m=[]);++_<b;){var E=r[_];o>0&&l(E)?o>1?ut(E,o-1,l,f,m):sr(m,E):f||(m[m.length]=E)}return m}var ql=rp(),Af=rp(!0);function En(r,o){return r&&ql(r,o,ct)}function Gl(r,o){return r&&Af(r,o,ct)}function $a(r,o){return ar(o,function(l){return $n(r[l])})}function Lr(r,o){o=fr(o,r);for(var l=0,f=o.length;r!=null&&l<f;)r=r[Tn(o[l++])];return l&&l==f?r:t}function Rf(r,o,l){var f=o(r);return ke(r)?f:sr(f,l(r))}function xt(r){return r==null?r===t?dC:lC:Dr&&Dr in ze(r)?yT(r):BT(r)}function Kl(r,o){return r>o}function MS(r,o){return r!=null&&$e.call(r,o)}function PS(r,o){return r!=null&&o in ze(r)}function LS(r,o,l){return r>=gt(o,l)&&r<ot(o,l)}function Yl(r,o,l){for(var f=l?Al:ka,m=r[0].length,_=r.length,b=_,E=D(_),N=1/0,F=[];b--;){var $=r[b];b&&o&&($=He($,Pt(o))),N=gt($.length,N),E[b]=!l&&(o||m>=120&&$.length>=120)?new Mr(b&&$):t}$=r[0];var U=-1,X=E[0];e:for(;++U<m&&F.length<N;){var se=$[U],pe=o?o(se):se;if(se=l||se!==0?se:0,!(X?bo(X,pe):f(F,pe,l))){for(b=_;--b;){var Ve=E[b];if(!(Ve?bo(Ve,pe):f(r[b],pe,l)))continue e}X&&X.push(pe),F.push(se)}}return F}function FS(r,o,l,f){return En(r,function(m,_,b){o(f,l(m),_,b)}),f}function Vo(r,o,l){o=fr(o,r),r=bp(r,o);var f=r==null?r:r[Tn(Kt(o))];return f==null?t:Mt(f,r,l)}function Df(r){return Xe(r)&&xt(r)==si}function $S(r){return Xe(r)&&xt(r)==wo}function zS(r){return Xe(r)&&xt(r)==ho}function No(r,o,l,f,m){return r===o?!0:r==null||o==null||!Xe(r)&&!Xe(o)?r!==r&&o!==o:ZS(r,o,l,f,No,m)}function ZS(r,o,l,f,m,_){var b=ke(r),E=ke(o),N=b?ha:yt(r),F=E?ha:yt(o);N=N==si?Rn:N,F=F==si?Rn:F;var $=N==Rn,U=F==Rn,X=N==F;if(X&&hr(r)){if(!hr(o))return!1;b=!0,$=!1}if(X&&!$)return _||(_=new gn),b||ki(r)?pp(r,o,l,f,m,_):mT(r,o,N,l,f,m,_);if(!(l&C)){var se=$&&$e.call(r,"__wrapped__"),pe=U&&$e.call(o,"__wrapped__");if(se||pe){var Ve=se?r.value():r,he=pe?o.value():o;return _||(_=new gn),m(Ve,he,l,f,_)}}return X?(_||(_=new gn),gT(r,o,l,f,m,_)):!1}function US(r){return Xe(r)&&yt(r)==pn}function Jl(r,o,l,f){var m=l.length,_=m,b=!f;if(r==null)return!_;for(r=ze(r);m--;){var E=l[m];if(b&&E[2]?E[1]!==r[E[0]]:!(E[0]in r))return!1}for(;++m<_;){E=l[m];var N=E[0],F=r[N],$=E[1];if(b&&E[2]){if(F===t&&!(N in r))return!1}else{var U=new gn;if(f)var X=f(F,$,N,r,o,U);if(!(X===t?No($,F,C|k,f,U):X))return!1}}return!0}function If(r){if(!Je(r)||ET(r))return!1;var o=$n(r)?UE:RC;return o.test($r(r))}function jS(r){return Xe(r)&&xt(r)==go}function WS(r){return Xe(r)&&yt(r)==hn}function HS(r){return Xe(r)&&rs(r.length)&&!!je[xt(r)]}function Mf(r){return typeof r=="function"?r:r==null?Nt:typeof r=="object"?ke(r)?Ff(r[0],r[1]):Lf(r):ih(r)}function Xl(r){if(!Ao(r))return KE(r);var o=[];for(var l in ze(r))$e.call(r,l)&&l!="constructor"&&o.push(l);return o}function qS(r){if(!Je(r))return NT(r);var o=Ao(r),l=[];for(var f in r)f=="constructor"&&(o||!$e.call(r,f))||l.push(f);return l}function Ql(r,o){return r<o}function Pf(r,o){var l=-1,f=Tt(r)?D(r.length):[];return dr(r,function(m,_,b){f[++l]=o(m,_,b)}),f}function Lf(r){var o=hc(r);return o.length==1&&o[0][2]?_p(o[0][0],o[0][1]):function(l){return l===r||Jl(l,r,o)}}function Ff(r,o){return gc(r)&&yp(o)?_p(Tn(r),o):function(l){var f=Sc(l,r);return f===t&&f===o?Tc(l,r):No(o,f,C|k)}}function za(r,o,l,f,m){r!==o&&ql(o,function(_,b){if(m||(m=new gn),Je(_))GS(r,o,b,l,za,f,m);else{var E=f?f(_c(r,b),_,b+"",r,o,m):t;E===t&&(E=_),Wl(r,b,E)}},Vt)}function GS(r,o,l,f,m,_,b){var E=_c(r,l),N=_c(o,l),F=b.get(N);if(F){Wl(r,l,F);return}var $=_?_(E,N,l+"",r,o,b):t,U=$===t;if(U){var X=ke(N),se=!X&&hr(N),pe=!X&&!se&&ki(N);$=N,X||se||pe?ke(E)?$=E:et(E)?$=St(E):se?(U=!1,$=Jf(N,!0)):pe?(U=!1,$=Xf(N,!0)):$=[]:Do(N)||zr(N)?($=E,zr(E)?$=Gp(E):(!Je(E)||$n(E))&&($=gp(N))):U=!1}U&&(b.set(N,$),m($,N,f,_,b),b.delete(N)),Wl(r,l,$)}function $f(r,o){var l=r.length;if(l)return o+=o<0?l:0,Fn(o,l)?r[o]:t}function zf(r,o,l){o.length?o=He(o,function(_){return ke(_)?function(b){return Lr(b,_.length===1?_[0]:_)}:_}):o=[Nt];var f=-1;o=He(o,Pt(ue()));var m=Pf(r,function(_,b,E){var N=He(o,function(F){return F(_)});return{criteria:N,index:++f,value:_}});return kE(m,function(_,b){return sT(_,b,l)})}function KS(r,o){return Zf(r,o,function(l,f){return Tc(r,f)})}function Zf(r,o,l){for(var f=-1,m=o.length,_={};++f<m;){var b=o[f],E=Lr(r,b);l(E,b)&&Bo(_,fr(b,r),E)}return _}function YS(r){return function(o){return Lr(o,r)}}function ec(r,o,l,f){var m=f?bE:di,_=-1,b=o.length,E=r;for(r===o&&(o=St(o)),l&&(E=He(r,Pt(l)));++_<b;)for(var N=0,F=o[_],$=l?l(F):F;(N=m(E,$,N,f))>-1;)E!==r&&Oa.call(E,N,1),Oa.call(r,N,1);return r}function Uf(r,o){for(var l=r?o.length:0,f=l-1;l--;){var m=o[l];if(l==f||m!==_){var _=m;Fn(m)?Oa.call(r,m,1):ic(r,m)}}return r}function tc(r,o){return r+Da(vf()*(o-r+1))}function JS(r,o,l,f){for(var m=-1,_=ot(Ra((o-r)/(l||1)),0),b=D(_);_--;)b[f?_:++m]=r,r+=l;return b}function nc(r,o){var l="";if(!r||o<1||o>Be)return l;do o%2&&(l+=r),o=Da(o/2),o&&(r+=r);while(o);return l}function Ne(r,o){return wc(wp(r,o,Nt),r+"")}function XS(r){return Sf(xi(r))}function QS(r,o){var l=xi(r);return Ja(l,Pr(o,0,l.length))}function Bo(r,o,l,f){if(!Je(r))return r;o=fr(o,r);for(var m=-1,_=o.length,b=_-1,E=r;E!=null&&++m<_;){var N=Tn(o[m]),F=l;if(N==="__proto__"||N==="constructor"||N==="prototype")return r;if(m!=b){var $=E[N];F=f?f($,N,E):t,F===t&&(F=Je($)?$:Fn(o[m+1])?[]:{})}So(E,N,F),E=E[N]}return r}var jf=Ia?function(r,o){return Ia.set(r,o),r}:Nt,eT=Aa?function(r,o){return Aa(r,"toString",{configurable:!0,enumerable:!1,value:Nc(o),writable:!0})}:Nt;function tT(r){return Ja(xi(r))}function Gt(r,o,l){var f=-1,m=r.length;o<0&&(o=-o>m?0:m+o),l=l>m?m:l,l<0&&(l+=m),m=o>l?0:l-o>>>0,o>>>=0;for(var _=D(m);++f<m;)_[f]=r[f+o];return _}function nT(r,o){var l;return dr(r,function(f,m,_){return l=o(f,m,_),!l}),!!l}function Za(r,o,l){var f=0,m=r==null?f:r.length;if(typeof o=="number"&&o===o&&m<=iC){for(;f<m;){var _=f+m>>>1,b=r[_];b!==null&&!Ft(b)&&(l?b<=o:b<o)?f=_+1:m=_}return m}return rc(r,o,Nt,l)}function rc(r,o,l,f){var m=0,_=r==null?0:r.length;if(_===0)return 0;o=l(o);for(var b=o!==o,E=o===null,N=Ft(o),F=o===t;m<_;){var $=Da((m+_)/2),U=l(r[$]),X=U!==t,se=U===null,pe=U===U,Ve=Ft(U);if(b)var he=f||pe;else F?he=pe&&(f||X):E?he=pe&&X&&(f||!se):N?he=pe&&X&&!se&&(f||!Ve):se||Ve?he=!1:he=f?U<=o:U<o;he?m=$+1:_=$}return gt(_,rC)}function Wf(r,o){for(var l=-1,f=r.length,m=0,_=[];++l<f;){var b=r[l],E=o?o(b):b;if(!l||!yn(E,N)){var N=E;_[m++]=b===0?0:b}}return _}function Hf(r){return typeof r=="number"?r:Ft(r)?or:+r}function Lt(r){if(typeof r=="string")return r;if(ke(r))return He(r,Lt)+"";if(Ft(r))return Cf?Cf.call(r):"";var o=r+"";return o=="0"&&1/r==-Ce?"-0":o}function ur(r,o,l){var f=-1,m=ka,_=r.length,b=!0,E=[],N=E;if(l)b=!1,m=Al;else if(_>=s){var F=o?null:pT(r);if(F)return va(F);b=!1,m=bo,N=new Mr}else N=o?[]:E;e:for(;++f<_;){var $=r[f],U=o?o($):$;if($=l||$!==0?$:0,b&&U===U){for(var X=N.length;X--;)if(N[X]===U)continue e;o&&N.push(U),E.push($)}else m(N,U,l)||(N!==E&&N.push(U),E.push($))}return E}function ic(r,o){return o=fr(o,r),r=bp(r,o),r==null||delete r[Tn(Kt(o))]}function qf(r,o,l,f){return Bo(r,o,l(Lr(r,o)),f)}function Ua(r,o,l,f){for(var m=r.length,_=f?m:-1;(f?_--:++_<m)&&o(r[_],_,r););return l?Gt(r,f?0:_,f?_+1:m):Gt(r,f?_+1:0,f?m:_)}function Gf(r,o){var l=r;return l instanceof Ae&&(l=l.value()),Rl(o,function(f,m){return m.func.apply(m.thisArg,sr([f],m.args))},l)}function oc(r,o,l){var f=r.length;if(f<2)return f?ur(r[0]):[];for(var m=-1,_=D(f);++m<f;)for(var b=r[m],E=-1;++E<f;)E!=m&&(_[m]=To(_[m]||b,r[E],o,l));return ur(ut(_,1),o,l)}function Kf(r,o,l){for(var f=-1,m=r.length,_=o.length,b={};++f<m;){var E=f<_?o[f]:t;l(b,r[f],E)}return b}function ac(r){return et(r)?r:[]}function sc(r){return typeof r=="function"?r:Nt}function fr(r,o){return ke(r)?r:gc(r,o)?[r]:Cp(Fe(r))}var rT=Ne;function pr(r,o,l){var f=r.length;return l=l===t?f:l,!o&&l>=f?r:Gt(r,o,l)}var Yf=jE||function(r){return dt.clearTimeout(r)};function Jf(r,o){if(o)return r.slice();var l=r.length,f=_f?_f(l):new r.constructor(l);return r.copy(f),f}function lc(r){var o=new r.constructor(r.byteLength);return new Na(o).set(new Na(r)),o}function iT(r,o){var l=o?lc(r.buffer):r.buffer;return new r.constructor(l,r.byteOffset,r.byteLength)}function oT(r){var o=new r.constructor(r.source,Ru.exec(r));return o.lastIndex=r.lastIndex,o}function aT(r){return Eo?ze(Eo.call(r)):{}}function Xf(r,o){var l=o?lc(r.buffer):r.buffer;return new r.constructor(l,r.byteOffset,r.length)}function Qf(r,o){if(r!==o){var l=r!==t,f=r===null,m=r===r,_=Ft(r),b=o!==t,E=o===null,N=o===o,F=Ft(o);if(!E&&!F&&!_&&r>o||_&&b&&N&&!E&&!F||f&&b&&N||!l&&N||!m)return 1;if(!f&&!_&&!F&&r<o||F&&l&&m&&!f&&!_||E&&l&&m||!b&&m||!N)return-1}return 0}function sT(r,o,l){for(var f=-1,m=r.criteria,_=o.criteria,b=m.length,E=l.length;++f<b;){var N=Qf(m[f],_[f]);if(N){if(f>=E)return N;var F=l[f];return N*(F=="desc"?-1:1)}}return r.index-o.index}function ep(r,o,l,f){for(var m=-1,_=r.length,b=l.length,E=-1,N=o.length,F=ot(_-b,0),$=D(N+F),U=!f;++E<N;)$[E]=o[E];for(;++m<b;)(U||m<_)&&($[l[m]]=r[m]);for(;F--;)$[E++]=r[m++];return $}function tp(r,o,l,f){for(var m=-1,_=r.length,b=-1,E=l.length,N=-1,F=o.length,$=ot(_-E,0),U=D($+F),X=!f;++m<$;)U[m]=r[m];for(var se=m;++N<F;)U[se+N]=o[N];for(;++b<E;)(X||m<_)&&(U[se+l[b]]=r[m++]);return U}function St(r,o){var l=-1,f=r.length;for(o||(o=D(f));++l<f;)o[l]=r[l];return o}function Sn(r,o,l,f){var m=!l;l||(l={});for(var _=-1,b=o.length;++_<b;){var E=o[_],N=f?f(l[E],r[E],E,l,r):t;N===t&&(N=r[E]),m?Mn(l,E,N):So(l,E,N)}return l}function lT(r,o){return Sn(r,mc(r),o)}function cT(r,o){return Sn(r,hp(r),o)}function ja(r,o){return function(l,f){var m=ke(l)?hE:OS,_=o?o():{};return m(l,r,ue(f,2),_)}}function _i(r){return Ne(function(o,l){var f=-1,m=l.length,_=m>1?l[m-1]:t,b=m>2?l[2]:t;for(_=r.length>3&&typeof _=="function"?(m--,_):t,b&&vt(l[0],l[1],b)&&(_=m<3?t:_,m=1),o=ze(o);++f<m;){var E=l[f];E&&r(o,E,f,_)}return o})}function np(r,o){return function(l,f){if(l==null)return l;if(!Tt(l))return r(l,f);for(var m=l.length,_=o?m:-1,b=ze(l);(o?_--:++_<m)&&f(b[_],_,b)!==!1;);return l}}function rp(r){return function(o,l,f){for(var m=-1,_=ze(o),b=f(o),E=b.length;E--;){var N=b[r?E:++m];if(l(_[N],N,_)===!1)break}return o}}function dT(r,o,l){var f=o&S,m=Oo(r);function _(){var b=this&&this!==dt&&this instanceof _?m:r;return b.apply(f?l:this,arguments)}return _}function ip(r){return function(o){o=Fe(o);var l=ui(o)?mn(o):t,f=l?l[0]:o.charAt(0),m=l?pr(l,1).join(""):o.slice(1);return f[r]()+m}}function wi(r){return function(o){return Rl(nh(th(o).replace(eE,"")),r,"")}}function Oo(r){return function(){var o=arguments;switch(o.length){case 0:return new r;case 1:return new r(o[0]);case 2:return new r(o[0],o[1]);case 3:return new r(o[0],o[1],o[2]);case 4:return new r(o[0],o[1],o[2],o[3]);case 5:return new r(o[0],o[1],o[2],o[3],o[4]);case 6:return new r(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new r(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=yi(r.prototype),f=r.apply(l,o);return Je(f)?f:l}}function uT(r,o,l){var f=Oo(r);function m(){for(var _=arguments.length,b=D(_),E=_,N=bi(m);E--;)b[E]=arguments[E];var F=_<3&&b[0]!==N&&b[_-1]!==N?[]:lr(b,N);if(_-=F.length,_<l)return cp(r,o,Wa,m.placeholder,t,b,F,t,t,l-_);var $=this&&this!==dt&&this instanceof m?f:r;return Mt($,this,b)}return m}function op(r){return function(o,l,f){var m=ze(o);if(!Tt(o)){var _=ue(l,3);o=ct(o),l=function(E){return _(m[E],E,m)}}var b=r(o,l,f);return b>-1?m[_?o[b]:b]:t}}function ap(r){return Ln(function(o){var l=o.length,f=l,m=Ht.prototype.thru;for(r&&o.reverse();f--;){var _=o[f];if(typeof _!="function")throw new Wt(d);if(m&&!b&&Ka(_)=="wrapper")var b=new Ht([],!0)}for(f=b?f:l;++f<l;){_=o[f];var E=Ka(_),N=E=="wrapper"?pc(_):t;N&&yc(N[0])&&N[1]==(O|K|z|B)&&!N[4].length&&N[9]==1?b=b[Ka(N[0])].apply(b,N[3]):b=_.length==1&&yc(_)?b[E]():b.thru(_)}return function(){var F=arguments,$=F[0];if(b&&F.length==1&&ke($))return b.plant($).value();for(var U=0,X=l?o[U].apply(this,F):$;++U<l;)X=o[U].call(this,X);return X}})}function Wa(r,o,l,f,m,_,b,E,N,F){var $=o&O,U=o&S,X=o&v,se=o&(K|j),pe=o&P,Ve=X?t:Oo(r);function he(){for(var Oe=arguments.length,Re=D(Oe),$t=Oe;$t--;)Re[$t]=arguments[$t];if(se)var Ct=bi(he),zt=vE(Re,Ct);if(f&&(Re=ep(Re,f,m,se)),_&&(Re=tp(Re,_,b,se)),Oe-=zt,se&&Oe<F){var tt=lr(Re,Ct);return cp(r,o,Wa,he.placeholder,l,Re,tt,E,N,F-Oe)}var _n=U?l:this,Zn=X?_n[r]:r;return Oe=Re.length,E?Re=OT(Re,E):pe&&Oe>1&&Re.reverse(),$&&N<Oe&&(Re.length=N),this&&this!==dt&&this instanceof he&&(Zn=Ve||Oo(Zn)),Zn.apply(_n,Re)}return he}function sp(r,o){return function(l,f){return FS(l,r,o(f),{})}}function Ha(r,o){return function(l,f){var m;if(l===t&&f===t)return o;if(l!==t&&(m=l),f!==t){if(m===t)return f;typeof l=="string"||typeof f=="string"?(l=Lt(l),f=Lt(f)):(l=Hf(l),f=Hf(f)),m=r(l,f)}return m}}function cc(r){return Ln(function(o){return o=He(o,Pt(ue())),Ne(function(l){var f=this;return r(o,function(m){return Mt(m,f,l)})})})}function qa(r,o){o=o===t?" ":Lt(o);var l=o.length;if(l<2)return l?nc(o,r):o;var f=nc(o,Ra(r/fi(o)));return ui(o)?pr(mn(f),0,r).join(""):f.slice(0,r)}function fT(r,o,l,f){var m=o&S,_=Oo(r);function b(){for(var E=-1,N=arguments.length,F=-1,$=f.length,U=D($+N),X=this&&this!==dt&&this instanceof b?_:r;++F<$;)U[F]=f[F];for(;N--;)U[F++]=arguments[++E];return Mt(X,m?l:this,U)}return b}function lp(r){return function(o,l,f){return f&&typeof f!="number"&&vt(o,l,f)&&(l=f=t),o=zn(o),l===t?(l=o,o=0):l=zn(l),f=f===t?o<l?1:-1:zn(f),JS(o,l,f,r)}}function Ga(r){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=Yt(o),l=Yt(l)),r(o,l)}}function cp(r,o,l,f,m,_,b,E,N,F){var $=o&K,U=$?b:t,X=$?t:b,se=$?_:t,pe=$?t:_;o|=$?z:W,o&=~($?W:z),o&I||(o&=~(S|v));var Ve=[r,o,m,se,U,pe,X,E,N,F],he=l.apply(t,Ve);return yc(r)&&kp(he,Ve),he.placeholder=f,xp(he,r,o)}function dc(r){var o=it[r];return function(l,f){if(l=Yt(l),f=f==null?0:gt(Ee(f),292),f&&xf(l)){var m=(Fe(l)+"e").split("e"),_=o(m[0]+"e"+(+m[1]+f));return m=(Fe(_)+"e").split("e"),+(m[0]+"e"+(+m[1]-f))}return o(l)}}var pT=mi&&1/va(new mi([,-0]))[1]==Ce?function(r){return new mi(r)}:Ac;function dp(r){return function(o){var l=yt(o);return l==pn?$l(o):l==hn?BE(o):xE(o,r(o))}}function Pn(r,o,l,f,m,_,b,E){var N=o&v;if(!N&&typeof r!="function")throw new Wt(d);var F=f?f.length:0;if(F||(o&=~(z|W),f=m=t),b=b===t?b:ot(Ee(b),0),E=E===t?E:Ee(E),F-=m?m.length:0,o&W){var $=f,U=m;f=m=t}var X=N?t:pc(r),se=[r,o,l,f,m,$,U,_,b,E];if(X&&VT(se,X),r=se[0],o=se[1],l=se[2],f=se[3],m=se[4],E=se[9]=se[9]===t?N?0:r.length:ot(se[9]-F,0),!E&&o&(K|j)&&(o&=~(K|j)),!o||o==S)var pe=dT(r,o,l);else o==K||o==j?pe=uT(r,o,E):(o==z||o==(S|z))&&!m.length?pe=fT(r,o,l,f):pe=Wa.apply(t,se);var Ve=X?jf:kp;return xp(Ve(pe,se),r,o)}function up(r,o,l,f){return r===t||yn(r,hi[l])&&!$e.call(f,l)?o:r}function fp(r,o,l,f,m,_){return Je(r)&&Je(o)&&(_.set(o,r),za(r,o,t,fp,_),_.delete(o)),r}function hT(r){return Do(r)?t:r}function pp(r,o,l,f,m,_){var b=l&C,E=r.length,N=o.length;if(E!=N&&!(b&&N>E))return!1;var F=_.get(r),$=_.get(o);if(F&&$)return F==o&&$==r;var U=-1,X=!0,se=l&k?new Mr:t;for(_.set(r,o),_.set(o,r);++U<E;){var pe=r[U],Ve=o[U];if(f)var he=b?f(Ve,pe,U,o,r,_):f(pe,Ve,U,r,o,_);if(he!==t){if(he)continue;X=!1;break}if(se){if(!Dl(o,function(Oe,Re){if(!bo(se,Re)&&(pe===Oe||m(pe,Oe,l,f,_)))return se.push(Re)})){X=!1;break}}else if(!(pe===Ve||m(pe,Ve,l,f,_))){X=!1;break}}return _.delete(r),_.delete(o),X}function mT(r,o,l,f,m,_,b){switch(l){case li:if(r.byteLength!=o.byteLength||r.byteOffset!=o.byteOffset)return!1;r=r.buffer,o=o.buffer;case wo:return!(r.byteLength!=o.byteLength||!_(new Na(r),new Na(o)));case po:case ho:case mo:return yn(+r,+o);case ma:return r.name==o.name&&r.message==o.message;case go:case yo:return r==o+"";case pn:var E=$l;case hn:var N=f&C;if(E||(E=va),r.size!=o.size&&!N)return!1;var F=b.get(r);if(F)return F==o;f|=k,b.set(r,o);var $=pp(E(r),E(o),f,m,_,b);return b.delete(r),$;case ya:if(Eo)return Eo.call(r)==Eo.call(o)}return!1}function gT(r,o,l,f,m,_){var b=l&C,E=uc(r),N=E.length,F=uc(o),$=F.length;if(N!=$&&!b)return!1;for(var U=N;U--;){var X=E[U];if(!(b?X in o:$e.call(o,X)))return!1}var se=_.get(r),pe=_.get(o);if(se&&pe)return se==o&&pe==r;var Ve=!0;_.set(r,o),_.set(o,r);for(var he=b;++U<N;){X=E[U];var Oe=r[X],Re=o[X];if(f)var $t=b?f(Re,Oe,X,o,r,_):f(Oe,Re,X,r,o,_);if(!($t===t?Oe===Re||m(Oe,Re,l,f,_):$t)){Ve=!1;break}he||(he=X=="constructor")}if(Ve&&!he){var Ct=r.constructor,zt=o.constructor;Ct!=zt&&"constructor"in r&&"constructor"in o&&!(typeof Ct=="function"&&Ct instanceof Ct&&typeof zt=="function"&&zt instanceof zt)&&(Ve=!1)}return _.delete(r),_.delete(o),Ve}function Ln(r){return wc(wp(r,t,Vp),r+"")}function uc(r){return Rf(r,ct,mc)}function fc(r){return Rf(r,Vt,hp)}var pc=Ia?function(r){return Ia.get(r)}:Ac;function Ka(r){for(var o=r.name+"",l=gi[o],f=$e.call(gi,o)?l.length:0;f--;){var m=l[f],_=m.func;if(_==null||_==r)return m.name}return o}function bi(r){var o=$e.call(y,"placeholder")?y:r;return o.placeholder}function ue(){var r=y.iteratee||Bc;return r=r===Bc?Mf:r,arguments.length?r(arguments[0],arguments[1]):r}function Ya(r,o){var l=r.__data__;return CT(o)?l[typeof o=="string"?"string":"hash"]:l.map}function hc(r){for(var o=ct(r),l=o.length;l--;){var f=o[l],m=r[f];o[l]=[f,m,yp(m)]}return o}function Fr(r,o){var l=TE(r,o);return If(l)?l:t}function yT(r){var o=$e.call(r,Dr),l=r[Dr];try{r[Dr]=t;var f=!0}catch{}var m=Ta.call(r);return f&&(o?r[Dr]=l:delete r[Dr]),m}var mc=Zl?function(r){return r==null?[]:(r=ze(r),ar(Zl(r),function(o){return bf.call(r,o)}))}:Rc,hp=Zl?function(r){for(var o=[];r;)sr(o,mc(r)),r=Ba(r);return o}:Rc,yt=xt;(Ul&&yt(new Ul(new ArrayBuffer(1)))!=li||xo&&yt(new xo)!=pn||jl&&yt(jl.resolve())!=Nu||mi&&yt(new mi)!=hn||vo&&yt(new vo)!=_o)&&(yt=function(r){var o=xt(r),l=o==Rn?r.constructor:t,f=l?$r(l):"";if(f)switch(f){case QE:return li;case eS:return pn;case tS:return Nu;case nS:return hn;case rS:return _o}return o});function _T(r,o,l){for(var f=-1,m=l.length;++f<m;){var _=l[f],b=_.size;switch(_.type){case"drop":r+=b;break;case"dropRight":o-=b;break;case"take":o=gt(o,r+b);break;case"takeRight":r=ot(r,o-b);break}}return{start:r,end:o}}function wT(r){var o=r.match(EC);return o?o[1].split(SC):[]}function mp(r,o,l){o=fr(o,r);for(var f=-1,m=o.length,_=!1;++f<m;){var b=Tn(o[f]);if(!(_=r!=null&&l(r,b)))break;r=r[b]}return _||++f!=m?_:(m=r==null?0:r.length,!!m&&rs(m)&&Fn(b,m)&&(ke(r)||zr(r)))}function bT(r){var o=r.length,l=new r.constructor(o);return o&&typeof r[0]=="string"&&$e.call(r,"index")&&(l.index=r.index,l.input=r.input),l}function gp(r){return typeof r.constructor=="function"&&!Ao(r)?yi(Ba(r)):{}}function kT(r,o,l){var f=r.constructor;switch(o){case wo:return lc(r);case po:case ho:return new f(+r);case li:return iT(r,l);case hl:case ml:case gl:case yl:case _l:case wl:case bl:case kl:case xl:return Xf(r,l);case pn:return new f;case mo:case yo:return new f(r);case go:return oT(r);case hn:return new f;case ya:return aT(r)}}function xT(r,o){var l=o.length;if(!l)return r;var f=l-1;return o[f]=(l>1?"& ":"")+o[f],o=o.join(l>2?", ":" "),r.replace(CC,`{
29
+ /* [wrapped with `+o+`] */
30
+ `)}function vT(r){return ke(r)||zr(r)||!!(kf&&r&&r[kf])}function Fn(r,o){var l=typeof r;return o=o??Be,!!o&&(l=="number"||l!="symbol"&&IC.test(r))&&r>-1&&r%1==0&&r<o}function vt(r,o,l){if(!Je(l))return!1;var f=typeof o;return(f=="number"?Tt(l)&&Fn(o,l.length):f=="string"&&o in l)?yn(l[o],r):!1}function gc(r,o){if(ke(r))return!1;var l=typeof r;return l=="number"||l=="symbol"||l=="boolean"||r==null||Ft(r)?!0:bC.test(r)||!wC.test(r)||o!=null&&r in ze(o)}function CT(r){var o=typeof r;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?r!=="__proto__":r===null}function yc(r){var o=Ka(r),l=y[o];if(typeof l!="function"||!(o in Ae.prototype))return!1;if(r===l)return!0;var f=pc(l);return!!f&&r===f[0]}function ET(r){return!!yf&&yf in r}var ST=Ea?$n:Dc;function Ao(r){var o=r&&r.constructor,l=typeof o=="function"&&o.prototype||hi;return r===l}function yp(r){return r===r&&!Je(r)}function _p(r,o){return function(l){return l==null?!1:l[r]===o&&(o!==t||r in ze(l))}}function TT(r){var o=ts(r,function(f){return l.size===h&&l.clear(),f}),l=o.cache;return o}function VT(r,o){var l=r[1],f=o[1],m=l|f,_=m<(S|v|O),b=f==O&&l==K||f==O&&l==B&&r[7].length<=o[8]||f==(O|B)&&o[7].length<=o[8]&&l==K;if(!(_||b))return r;f&S&&(r[2]=o[2],m|=l&S?0:I);var E=o[3];if(E){var N=r[3];r[3]=N?ep(N,E,o[4]):E,r[4]=N?lr(r[3],g):o[4]}return E=o[5],E&&(N=r[5],r[5]=N?tp(N,E,o[6]):E,r[6]=N?lr(r[5],g):o[6]),E=o[7],E&&(r[7]=E),f&O&&(r[8]=r[8]==null?o[8]:gt(r[8],o[8])),r[9]==null&&(r[9]=o[9]),r[0]=o[0],r[1]=m,r}function NT(r){var o=[];if(r!=null)for(var l in ze(r))o.push(l);return o}function BT(r){return Ta.call(r)}function wp(r,o,l){return o=ot(o===t?r.length-1:o,0),function(){for(var f=arguments,m=-1,_=ot(f.length-o,0),b=D(_);++m<_;)b[m]=f[o+m];m=-1;for(var E=D(o+1);++m<o;)E[m]=f[m];return E[o]=l(b),Mt(r,this,E)}}function bp(r,o){return o.length<2?r:Lr(r,Gt(o,0,-1))}function OT(r,o){for(var l=r.length,f=gt(o.length,l),m=St(r);f--;){var _=o[f];r[f]=Fn(_,l)?m[_]:t}return r}function _c(r,o){if(!(o==="constructor"&&typeof r[o]=="function")&&o!="__proto__")return r[o]}var kp=vp(jf),Ro=HE||function(r,o){return dt.setTimeout(r,o)},wc=vp(eT);function xp(r,o,l){var f=o+"";return wc(r,xT(f,AT(wT(f),l)))}function vp(r){var o=0,l=0;return function(){var f=YE(),m=oe-(f-l);if(l=f,m>0){if(++o>=H)return arguments[0]}else o=0;return r.apply(t,arguments)}}function Ja(r,o){var l=-1,f=r.length,m=f-1;for(o=o===t?f:o;++l<o;){var _=tc(l,m),b=r[_];r[_]=r[l],r[l]=b}return r.length=o,r}var Cp=TT(function(r){var o=[];return r.charCodeAt(0)===46&&o.push(""),r.replace(kC,function(l,f,m,_){o.push(m?_.replace(NC,"$1"):f||l)}),o});function Tn(r){if(typeof r=="string"||Ft(r))return r;var o=r+"";return o=="0"&&1/r==-Ce?"-0":o}function $r(r){if(r!=null){try{return Sa.call(r)}catch{}try{return r+""}catch{}}return""}function AT(r,o){return jt(oC,function(l){var f="_."+l[0];o&l[1]&&!ka(r,f)&&r.push(f)}),r.sort()}function Ep(r){if(r instanceof Ae)return r.clone();var o=new Ht(r.__wrapped__,r.__chain__);return o.__actions__=St(r.__actions__),o.__index__=r.__index__,o.__values__=r.__values__,o}function RT(r,o,l){(l?vt(r,o,l):o===t)?o=1:o=ot(Ee(o),0);var f=r==null?0:r.length;if(!f||o<1)return[];for(var m=0,_=0,b=D(Ra(f/o));m<f;)b[_++]=Gt(r,m,m+=o);return b}function DT(r){for(var o=-1,l=r==null?0:r.length,f=0,m=[];++o<l;){var _=r[o];_&&(m[f++]=_)}return m}function IT(){var r=arguments.length;if(!r)return[];for(var o=D(r-1),l=arguments[0],f=r;f--;)o[f-1]=arguments[f];return sr(ke(l)?St(l):[l],ut(o,1))}var MT=Ne(function(r,o){return et(r)?To(r,ut(o,1,et,!0)):[]}),PT=Ne(function(r,o){var l=Kt(o);return et(l)&&(l=t),et(r)?To(r,ut(o,1,et,!0),ue(l,2)):[]}),LT=Ne(function(r,o){var l=Kt(o);return et(l)&&(l=t),et(r)?To(r,ut(o,1,et,!0),t,l):[]});function FT(r,o,l){var f=r==null?0:r.length;return f?(o=l||o===t?1:Ee(o),Gt(r,o<0?0:o,f)):[]}function $T(r,o,l){var f=r==null?0:r.length;return f?(o=l||o===t?1:Ee(o),o=f-o,Gt(r,0,o<0?0:o)):[]}function zT(r,o){return r&&r.length?Ua(r,ue(o,3),!0,!0):[]}function ZT(r,o){return r&&r.length?Ua(r,ue(o,3),!0):[]}function UT(r,o,l,f){var m=r==null?0:r.length;return m?(l&&typeof l!="number"&&vt(r,o,l)&&(l=0,f=m),IS(r,o,l,f)):[]}function Sp(r,o,l){var f=r==null?0:r.length;if(!f)return-1;var m=l==null?0:Ee(l);return m<0&&(m=ot(f+m,0)),xa(r,ue(o,3),m)}function Tp(r,o,l){var f=r==null?0:r.length;if(!f)return-1;var m=f-1;return l!==t&&(m=Ee(l),m=l<0?ot(f+m,0):gt(m,f-1)),xa(r,ue(o,3),m,!0)}function Vp(r){var o=r==null?0:r.length;return o?ut(r,1):[]}function jT(r){var o=r==null?0:r.length;return o?ut(r,Ce):[]}function WT(r,o){var l=r==null?0:r.length;return l?(o=o===t?1:Ee(o),ut(r,o)):[]}function HT(r){for(var o=-1,l=r==null?0:r.length,f={};++o<l;){var m=r[o];f[m[0]]=m[1]}return f}function Np(r){return r&&r.length?r[0]:t}function qT(r,o,l){var f=r==null?0:r.length;if(!f)return-1;var m=l==null?0:Ee(l);return m<0&&(m=ot(f+m,0)),di(r,o,m)}function GT(r){var o=r==null?0:r.length;return o?Gt(r,0,-1):[]}var KT=Ne(function(r){var o=He(r,ac);return o.length&&o[0]===r[0]?Yl(o):[]}),YT=Ne(function(r){var o=Kt(r),l=He(r,ac);return o===Kt(l)?o=t:l.pop(),l.length&&l[0]===r[0]?Yl(l,ue(o,2)):[]}),JT=Ne(function(r){var o=Kt(r),l=He(r,ac);return o=typeof o=="function"?o:t,o&&l.pop(),l.length&&l[0]===r[0]?Yl(l,t,o):[]});function XT(r,o){return r==null?"":GE.call(r,o)}function Kt(r){var o=r==null?0:r.length;return o?r[o-1]:t}function QT(r,o,l){var f=r==null?0:r.length;if(!f)return-1;var m=f;return l!==t&&(m=Ee(l),m=m<0?ot(f+m,0):gt(m,f-1)),o===o?AE(r,o,m):xa(r,cf,m,!0)}function eV(r,o){return r&&r.length?$f(r,Ee(o)):t}var tV=Ne(Bp);function Bp(r,o){return r&&r.length&&o&&o.length?ec(r,o):r}function nV(r,o,l){return r&&r.length&&o&&o.length?ec(r,o,ue(l,2)):r}function rV(r,o,l){return r&&r.length&&o&&o.length?ec(r,o,t,l):r}var iV=Ln(function(r,o){var l=r==null?0:r.length,f=Hl(r,o);return Uf(r,He(o,function(m){return Fn(m,l)?+m:m}).sort(Qf)),f});function oV(r,o){var l=[];if(!(r&&r.length))return l;var f=-1,m=[],_=r.length;for(o=ue(o,3);++f<_;){var b=r[f];o(b,f,r)&&(l.push(b),m.push(f))}return Uf(r,m),l}function bc(r){return r==null?r:XE.call(r)}function aV(r,o,l){var f=r==null?0:r.length;return f?(l&&typeof l!="number"&&vt(r,o,l)?(o=0,l=f):(o=o==null?0:Ee(o),l=l===t?f:Ee(l)),Gt(r,o,l)):[]}function sV(r,o){return Za(r,o)}function lV(r,o,l){return rc(r,o,ue(l,2))}function cV(r,o){var l=r==null?0:r.length;if(l){var f=Za(r,o);if(f<l&&yn(r[f],o))return f}return-1}function dV(r,o){return Za(r,o,!0)}function uV(r,o,l){return rc(r,o,ue(l,2),!0)}function fV(r,o){var l=r==null?0:r.length;if(l){var f=Za(r,o,!0)-1;if(yn(r[f],o))return f}return-1}function pV(r){return r&&r.length?Wf(r):[]}function hV(r,o){return r&&r.length?Wf(r,ue(o,2)):[]}function mV(r){var o=r==null?0:r.length;return o?Gt(r,1,o):[]}function gV(r,o,l){return r&&r.length?(o=l||o===t?1:Ee(o),Gt(r,0,o<0?0:o)):[]}function yV(r,o,l){var f=r==null?0:r.length;return f?(o=l||o===t?1:Ee(o),o=f-o,Gt(r,o<0?0:o,f)):[]}function _V(r,o){return r&&r.length?Ua(r,ue(o,3),!1,!0):[]}function wV(r,o){return r&&r.length?Ua(r,ue(o,3)):[]}var bV=Ne(function(r){return ur(ut(r,1,et,!0))}),kV=Ne(function(r){var o=Kt(r);return et(o)&&(o=t),ur(ut(r,1,et,!0),ue(o,2))}),xV=Ne(function(r){var o=Kt(r);return o=typeof o=="function"?o:t,ur(ut(r,1,et,!0),t,o)});function vV(r){return r&&r.length?ur(r):[]}function CV(r,o){return r&&r.length?ur(r,ue(o,2)):[]}function EV(r,o){return o=typeof o=="function"?o:t,r&&r.length?ur(r,t,o):[]}function kc(r){if(!(r&&r.length))return[];var o=0;return r=ar(r,function(l){if(et(l))return o=ot(l.length,o),!0}),Ll(o,function(l){return He(r,Il(l))})}function Op(r,o){if(!(r&&r.length))return[];var l=kc(r);return o==null?l:He(l,function(f){return Mt(o,t,f)})}var SV=Ne(function(r,o){return et(r)?To(r,o):[]}),TV=Ne(function(r){return oc(ar(r,et))}),VV=Ne(function(r){var o=Kt(r);return et(o)&&(o=t),oc(ar(r,et),ue(o,2))}),NV=Ne(function(r){var o=Kt(r);return o=typeof o=="function"?o:t,oc(ar(r,et),t,o)}),BV=Ne(kc);function OV(r,o){return Kf(r||[],o||[],So)}function AV(r,o){return Kf(r||[],o||[],Bo)}var RV=Ne(function(r){var o=r.length,l=o>1?r[o-1]:t;return l=typeof l=="function"?(r.pop(),l):t,Op(r,l)});function Ap(r){var o=y(r);return o.__chain__=!0,o}function DV(r,o){return o(r),r}function Xa(r,o){return o(r)}var IV=Ln(function(r){var o=r.length,l=o?r[0]:0,f=this.__wrapped__,m=function(_){return Hl(_,r)};return o>1||this.__actions__.length||!(f instanceof Ae)||!Fn(l)?this.thru(m):(f=f.slice(l,+l+(o?1:0)),f.__actions__.push({func:Xa,args:[m],thisArg:t}),new Ht(f,this.__chain__).thru(function(_){return o&&!_.length&&_.push(t),_}))});function MV(){return Ap(this)}function PV(){return new Ht(this.value(),this.__chain__)}function LV(){this.__values__===t&&(this.__values__=Hp(this.value()));var r=this.__index__>=this.__values__.length,o=r?t:this.__values__[this.__index__++];return{done:r,value:o}}function FV(){return this}function $V(r){for(var o,l=this;l instanceof Pa;){var f=Ep(l);f.__index__=0,f.__values__=t,o?m.__wrapped__=f:o=f;var m=f;l=l.__wrapped__}return m.__wrapped__=r,o}function zV(){var r=this.__wrapped__;if(r instanceof Ae){var o=r;return this.__actions__.length&&(o=new Ae(this)),o=o.reverse(),o.__actions__.push({func:Xa,args:[bc],thisArg:t}),new Ht(o,this.__chain__)}return this.thru(bc)}function ZV(){return Gf(this.__wrapped__,this.__actions__)}var UV=ja(function(r,o,l){$e.call(r,l)?++r[l]:Mn(r,l,1)});function jV(r,o,l){var f=ke(r)?sf:DS;return l&&vt(r,o,l)&&(o=t),f(r,ue(o,3))}function WV(r,o){var l=ke(r)?ar:Of;return l(r,ue(o,3))}var HV=op(Sp),qV=op(Tp);function GV(r,o){return ut(Qa(r,o),1)}function KV(r,o){return ut(Qa(r,o),Ce)}function YV(r,o,l){return l=l===t?1:Ee(l),ut(Qa(r,o),l)}function Rp(r,o){var l=ke(r)?jt:dr;return l(r,ue(o,3))}function Dp(r,o){var l=ke(r)?mE:Bf;return l(r,ue(o,3))}var JV=ja(function(r,o,l){$e.call(r,l)?r[l].push(o):Mn(r,l,[o])});function XV(r,o,l,f){r=Tt(r)?r:xi(r),l=l&&!f?Ee(l):0;var m=r.length;return l<0&&(l=ot(m+l,0)),is(r)?l<=m&&r.indexOf(o,l)>-1:!!m&&di(r,o,l)>-1}var QV=Ne(function(r,o,l){var f=-1,m=typeof o=="function",_=Tt(r)?D(r.length):[];return dr(r,function(b){_[++f]=m?Mt(o,b,l):Vo(b,o,l)}),_}),eN=ja(function(r,o,l){Mn(r,l,o)});function Qa(r,o){var l=ke(r)?He:Pf;return l(r,ue(o,3))}function tN(r,o,l,f){return r==null?[]:(ke(o)||(o=o==null?[]:[o]),l=f?t:l,ke(l)||(l=l==null?[]:[l]),zf(r,o,l))}var nN=ja(function(r,o,l){r[l?0:1].push(o)},function(){return[[],[]]});function rN(r,o,l){var f=ke(r)?Rl:uf,m=arguments.length<3;return f(r,ue(o,4),l,m,dr)}function iN(r,o,l){var f=ke(r)?gE:uf,m=arguments.length<3;return f(r,ue(o,4),l,m,Bf)}function oN(r,o){var l=ke(r)?ar:Of;return l(r,ns(ue(o,3)))}function aN(r){var o=ke(r)?Sf:XS;return o(r)}function sN(r,o,l){(l?vt(r,o,l):o===t)?o=1:o=Ee(o);var f=ke(r)?NS:QS;return f(r,o)}function lN(r){var o=ke(r)?BS:tT;return o(r)}function cN(r){if(r==null)return 0;if(Tt(r))return is(r)?fi(r):r.length;var o=yt(r);return o==pn||o==hn?r.size:Xl(r).length}function dN(r,o,l){var f=ke(r)?Dl:nT;return l&&vt(r,o,l)&&(o=t),f(r,ue(o,3))}var uN=Ne(function(r,o){if(r==null)return[];var l=o.length;return l>1&&vt(r,o[0],o[1])?o=[]:l>2&&vt(o[0],o[1],o[2])&&(o=[o[0]]),zf(r,ut(o,1),[])}),es=WE||function(){return dt.Date.now()};function fN(r,o){if(typeof o!="function")throw new Wt(d);return r=Ee(r),function(){if(--r<1)return o.apply(this,arguments)}}function Ip(r,o,l){return o=l?t:o,o=r&&o==null?r.length:o,Pn(r,O,t,t,t,t,o)}function Mp(r,o){var l;if(typeof o!="function")throw new Wt(d);return r=Ee(r),function(){return--r>0&&(l=o.apply(this,arguments)),r<=1&&(o=t),l}}var xc=Ne(function(r,o,l){var f=S;if(l.length){var m=lr(l,bi(xc));f|=z}return Pn(r,f,o,l,m)}),Pp=Ne(function(r,o,l){var f=S|v;if(l.length){var m=lr(l,bi(Pp));f|=z}return Pn(o,f,r,l,m)});function Lp(r,o,l){o=l?t:o;var f=Pn(r,K,t,t,t,t,t,o);return f.placeholder=Lp.placeholder,f}function Fp(r,o,l){o=l?t:o;var f=Pn(r,j,t,t,t,t,t,o);return f.placeholder=Fp.placeholder,f}function $p(r,o,l){var f,m,_,b,E,N,F=0,$=!1,U=!1,X=!0;if(typeof r!="function")throw new Wt(d);o=Yt(o)||0,Je(l)&&($=!!l.leading,U="maxWait"in l,_=U?ot(Yt(l.maxWait)||0,o):_,X="trailing"in l?!!l.trailing:X);function se(tt){var _n=f,Zn=m;return f=m=t,F=tt,b=r.apply(Zn,_n),b}function pe(tt){return F=tt,E=Ro(Oe,o),$?se(tt):b}function Ve(tt){var _n=tt-N,Zn=tt-F,oh=o-_n;return U?gt(oh,_-Zn):oh}function he(tt){var _n=tt-N,Zn=tt-F;return N===t||_n>=o||_n<0||U&&Zn>=_}function Oe(){var tt=es();if(he(tt))return Re(tt);E=Ro(Oe,Ve(tt))}function Re(tt){return E=t,X&&f?se(tt):(f=m=t,b)}function $t(){E!==t&&Yf(E),F=0,f=N=m=E=t}function Ct(){return E===t?b:Re(es())}function zt(){var tt=es(),_n=he(tt);if(f=arguments,m=this,N=tt,_n){if(E===t)return pe(N);if(U)return Yf(E),E=Ro(Oe,o),se(N)}return E===t&&(E=Ro(Oe,o)),b}return zt.cancel=$t,zt.flush=Ct,zt}var pN=Ne(function(r,o){return Nf(r,1,o)}),hN=Ne(function(r,o,l){return Nf(r,Yt(o)||0,l)});function mN(r){return Pn(r,P)}function ts(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new Wt(d);var l=function(){var f=arguments,m=o?o.apply(this,f):f[0],_=l.cache;if(_.has(m))return _.get(m);var b=r.apply(this,f);return l.cache=_.set(m,b)||_,b};return l.cache=new(ts.Cache||In),l}ts.Cache=In;function ns(r){if(typeof r!="function")throw new Wt(d);return function(){var o=arguments;switch(o.length){case 0:return!r.call(this);case 1:return!r.call(this,o[0]);case 2:return!r.call(this,o[0],o[1]);case 3:return!r.call(this,o[0],o[1],o[2])}return!r.apply(this,o)}}function gN(r){return Mp(2,r)}var yN=rT(function(r,o){o=o.length==1&&ke(o[0])?He(o[0],Pt(ue())):He(ut(o,1),Pt(ue()));var l=o.length;return Ne(function(f){for(var m=-1,_=gt(f.length,l);++m<_;)f[m]=o[m].call(this,f[m]);return Mt(r,this,f)})}),vc=Ne(function(r,o){var l=lr(o,bi(vc));return Pn(r,z,t,o,l)}),zp=Ne(function(r,o){var l=lr(o,bi(zp));return Pn(r,W,t,o,l)}),_N=Ln(function(r,o){return Pn(r,B,t,t,t,o)});function wN(r,o){if(typeof r!="function")throw new Wt(d);return o=o===t?o:Ee(o),Ne(r,o)}function bN(r,o){if(typeof r!="function")throw new Wt(d);return o=o==null?0:ot(Ee(o),0),Ne(function(l){var f=l[o],m=pr(l,0,o);return f&&sr(m,f),Mt(r,this,m)})}function kN(r,o,l){var f=!0,m=!0;if(typeof r!="function")throw new Wt(d);return Je(l)&&(f="leading"in l?!!l.leading:f,m="trailing"in l?!!l.trailing:m),$p(r,o,{leading:f,maxWait:o,trailing:m})}function xN(r){return Ip(r,1)}function vN(r,o){return vc(sc(o),r)}function CN(){if(!arguments.length)return[];var r=arguments[0];return ke(r)?r:[r]}function EN(r){return qt(r,T)}function SN(r,o){return o=typeof o=="function"?o:t,qt(r,T,o)}function TN(r){return qt(r,x|T)}function VN(r,o){return o=typeof o=="function"?o:t,qt(r,x|T,o)}function NN(r,o){return o==null||Vf(r,o,ct(o))}function yn(r,o){return r===o||r!==r&&o!==o}var BN=Ga(Kl),ON=Ga(function(r,o){return r>=o}),zr=Df(function(){return arguments}())?Df:function(r){return Xe(r)&&$e.call(r,"callee")&&!bf.call(r,"callee")},ke=D.isArray,AN=ef?Pt(ef):$S;function Tt(r){return r!=null&&rs(r.length)&&!$n(r)}function et(r){return Xe(r)&&Tt(r)}function RN(r){return r===!0||r===!1||Xe(r)&&xt(r)==po}var hr=qE||Dc,DN=tf?Pt(tf):zS;function IN(r){return Xe(r)&&r.nodeType===1&&!Do(r)}function MN(r){if(r==null)return!0;if(Tt(r)&&(ke(r)||typeof r=="string"||typeof r.splice=="function"||hr(r)||ki(r)||zr(r)))return!r.length;var o=yt(r);if(o==pn||o==hn)return!r.size;if(Ao(r))return!Xl(r).length;for(var l in r)if($e.call(r,l))return!1;return!0}function PN(r,o){return No(r,o)}function LN(r,o,l){l=typeof l=="function"?l:t;var f=l?l(r,o):t;return f===t?No(r,o,t,l):!!f}function Cc(r){if(!Xe(r))return!1;var o=xt(r);return o==ma||o==sC||typeof r.message=="string"&&typeof r.name=="string"&&!Do(r)}function FN(r){return typeof r=="number"&&xf(r)}function $n(r){if(!Je(r))return!1;var o=xt(r);return o==ga||o==Vu||o==aC||o==cC}function Zp(r){return typeof r=="number"&&r==Ee(r)}function rs(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Be}function Je(r){var o=typeof r;return r!=null&&(o=="object"||o=="function")}function Xe(r){return r!=null&&typeof r=="object"}var Up=nf?Pt(nf):US;function $N(r,o){return r===o||Jl(r,o,hc(o))}function zN(r,o,l){return l=typeof l=="function"?l:t,Jl(r,o,hc(o),l)}function ZN(r){return jp(r)&&r!=+r}function UN(r){if(ST(r))throw new be(c);return If(r)}function jN(r){return r===null}function WN(r){return r==null}function jp(r){return typeof r=="number"||Xe(r)&&xt(r)==mo}function Do(r){if(!Xe(r)||xt(r)!=Rn)return!1;var o=Ba(r);if(o===null)return!0;var l=$e.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&Sa.call(l)==zE}var Ec=rf?Pt(rf):jS;function HN(r){return Zp(r)&&r>=-Be&&r<=Be}var Wp=of?Pt(of):WS;function is(r){return typeof r=="string"||!ke(r)&&Xe(r)&&xt(r)==yo}function Ft(r){return typeof r=="symbol"||Xe(r)&&xt(r)==ya}var ki=af?Pt(af):HS;function qN(r){return r===t}function GN(r){return Xe(r)&&yt(r)==_o}function KN(r){return Xe(r)&&xt(r)==uC}var YN=Ga(Ql),JN=Ga(function(r,o){return r<=o});function Hp(r){if(!r)return[];if(Tt(r))return is(r)?mn(r):St(r);if(ko&&r[ko])return NE(r[ko]());var o=yt(r),l=o==pn?$l:o==hn?va:xi;return l(r)}function zn(r){if(!r)return r===0?r:0;if(r=Yt(r),r===Ce||r===-Ce){var o=r<0?-1:1;return o*Ar}return r===r?r:0}function Ee(r){var o=zn(r),l=o%1;return o===o?l?o-l:o:0}function qp(r){return r?Pr(Ee(r),0,Et):0}function Yt(r){if(typeof r=="number")return r;if(Ft(r))return or;if(Je(r)){var o=typeof r.valueOf=="function"?r.valueOf():r;r=Je(o)?o+"":o}if(typeof r!="string")return r===0?r:+r;r=ff(r);var l=AC.test(r);return l||DC.test(r)?fE(r.slice(2),l?2:8):OC.test(r)?or:+r}function Gp(r){return Sn(r,Vt(r))}function XN(r){return r?Pr(Ee(r),-Be,Be):r===0?r:0}function Fe(r){return r==null?"":Lt(r)}var QN=_i(function(r,o){if(Ao(o)||Tt(o)){Sn(o,ct(o),r);return}for(var l in o)$e.call(o,l)&&So(r,l,o[l])}),Kp=_i(function(r,o){Sn(o,Vt(o),r)}),os=_i(function(r,o,l,f){Sn(o,Vt(o),r,f)}),eB=_i(function(r,o,l,f){Sn(o,ct(o),r,f)}),tB=Ln(Hl);function nB(r,o){var l=yi(r);return o==null?l:Tf(l,o)}var rB=Ne(function(r,o){r=ze(r);var l=-1,f=o.length,m=f>2?o[2]:t;for(m&&vt(o[0],o[1],m)&&(f=1);++l<f;)for(var _=o[l],b=Vt(_),E=-1,N=b.length;++E<N;){var F=b[E],$=r[F];($===t||yn($,hi[F])&&!$e.call(r,F))&&(r[F]=_[F])}return r}),iB=Ne(function(r){return r.push(t,fp),Mt(Yp,t,r)});function oB(r,o){return lf(r,ue(o,3),En)}function aB(r,o){return lf(r,ue(o,3),Gl)}function sB(r,o){return r==null?r:ql(r,ue(o,3),Vt)}function lB(r,o){return r==null?r:Af(r,ue(o,3),Vt)}function cB(r,o){return r&&En(r,ue(o,3))}function dB(r,o){return r&&Gl(r,ue(o,3))}function uB(r){return r==null?[]:$a(r,ct(r))}function fB(r){return r==null?[]:$a(r,Vt(r))}function Sc(r,o,l){var f=r==null?t:Lr(r,o);return f===t?l:f}function pB(r,o){return r!=null&&mp(r,o,MS)}function Tc(r,o){return r!=null&&mp(r,o,PS)}var hB=sp(function(r,o,l){o!=null&&typeof o.toString!="function"&&(o=Ta.call(o)),r[o]=l},Nc(Nt)),mB=sp(function(r,o,l){o!=null&&typeof o.toString!="function"&&(o=Ta.call(o)),$e.call(r,o)?r[o].push(l):r[o]=[l]},ue),gB=Ne(Vo);function ct(r){return Tt(r)?Ef(r):Xl(r)}function Vt(r){return Tt(r)?Ef(r,!0):qS(r)}function yB(r,o){var l={};return o=ue(o,3),En(r,function(f,m,_){Mn(l,o(f,m,_),f)}),l}function _B(r,o){var l={};return o=ue(o,3),En(r,function(f,m,_){Mn(l,m,o(f,m,_))}),l}var wB=_i(function(r,o,l){za(r,o,l)}),Yp=_i(function(r,o,l,f){za(r,o,l,f)}),bB=Ln(function(r,o){var l={};if(r==null)return l;var f=!1;o=He(o,function(_){return _=fr(_,r),f||(f=_.length>1),_}),Sn(r,fc(r),l),f&&(l=qt(l,x|R|T,hT));for(var m=o.length;m--;)ic(l,o[m]);return l});function kB(r,o){return Jp(r,ns(ue(o)))}var xB=Ln(function(r,o){return r==null?{}:KS(r,o)});function Jp(r,o){if(r==null)return{};var l=He(fc(r),function(f){return[f]});return o=ue(o),Zf(r,l,function(f,m){return o(f,m[0])})}function vB(r,o,l){o=fr(o,r);var f=-1,m=o.length;for(m||(m=1,r=t);++f<m;){var _=r==null?t:r[Tn(o[f])];_===t&&(f=m,_=l),r=$n(_)?_.call(r):_}return r}function CB(r,o,l){return r==null?r:Bo(r,o,l)}function EB(r,o,l,f){return f=typeof f=="function"?f:t,r==null?r:Bo(r,o,l,f)}var Xp=dp(ct),Qp=dp(Vt);function SB(r,o,l){var f=ke(r),m=f||hr(r)||ki(r);if(o=ue(o,4),l==null){var _=r&&r.constructor;m?l=f?new _:[]:Je(r)?l=$n(_)?yi(Ba(r)):{}:l={}}return(m?jt:En)(r,function(b,E,N){return o(l,b,E,N)}),l}function TB(r,o){return r==null?!0:ic(r,o)}function VB(r,o,l){return r==null?r:qf(r,o,sc(l))}function NB(r,o,l,f){return f=typeof f=="function"?f:t,r==null?r:qf(r,o,sc(l),f)}function xi(r){return r==null?[]:Fl(r,ct(r))}function BB(r){return r==null?[]:Fl(r,Vt(r))}function OB(r,o,l){return l===t&&(l=o,o=t),l!==t&&(l=Yt(l),l=l===l?l:0),o!==t&&(o=Yt(o),o=o===o?o:0),Pr(Yt(r),o,l)}function AB(r,o,l){return o=zn(o),l===t?(l=o,o=0):l=zn(l),r=Yt(r),LS(r,o,l)}function RB(r,o,l){if(l&&typeof l!="boolean"&&vt(r,o,l)&&(o=l=t),l===t&&(typeof o=="boolean"?(l=o,o=t):typeof r=="boolean"&&(l=r,r=t)),r===t&&o===t?(r=0,o=1):(r=zn(r),o===t?(o=r,r=0):o=zn(o)),r>o){var f=r;r=o,o=f}if(l||r%1||o%1){var m=vf();return gt(r+m*(o-r+uE("1e-"+((m+"").length-1))),o)}return tc(r,o)}var DB=wi(function(r,o,l){return o=o.toLowerCase(),r+(l?eh(o):o)});function eh(r){return Vc(Fe(r).toLowerCase())}function th(r){return r=Fe(r),r&&r.replace(MC,CE).replace(tE,"")}function IB(r,o,l){r=Fe(r),o=Lt(o);var f=r.length;l=l===t?f:Pr(Ee(l),0,f);var m=l;return l-=o.length,l>=0&&r.slice(l,m)==o}function MB(r){return r=Fe(r),r&&gC.test(r)?r.replace(Ou,EE):r}function PB(r){return r=Fe(r),r&&xC.test(r)?r.replace(vl,"\\$&"):r}var LB=wi(function(r,o,l){return r+(l?"-":"")+o.toLowerCase()}),FB=wi(function(r,o,l){return r+(l?" ":"")+o.toLowerCase()}),$B=ip("toLowerCase");function zB(r,o,l){r=Fe(r),o=Ee(o);var f=o?fi(r):0;if(!o||f>=o)return r;var m=(o-f)/2;return qa(Da(m),l)+r+qa(Ra(m),l)}function ZB(r,o,l){r=Fe(r),o=Ee(o);var f=o?fi(r):0;return o&&f<o?r+qa(o-f,l):r}function UB(r,o,l){r=Fe(r),o=Ee(o);var f=o?fi(r):0;return o&&f<o?qa(o-f,l)+r:r}function jB(r,o,l){return l||o==null?o=0:o&&(o=+o),JE(Fe(r).replace(Cl,""),o||0)}function WB(r,o,l){return(l?vt(r,o,l):o===t)?o=1:o=Ee(o),nc(Fe(r),o)}function HB(){var r=arguments,o=Fe(r[0]);return r.length<3?o:o.replace(r[1],r[2])}var qB=wi(function(r,o,l){return r+(l?"_":"")+o.toLowerCase()});function GB(r,o,l){return l&&typeof l!="number"&&vt(r,o,l)&&(o=l=t),l=l===t?Et:l>>>0,l?(r=Fe(r),r&&(typeof o=="string"||o!=null&&!Ec(o))&&(o=Lt(o),!o&&ui(r))?pr(mn(r),0,l):r.split(o,l)):[]}var KB=wi(function(r,o,l){return r+(l?" ":"")+Vc(o)});function YB(r,o,l){return r=Fe(r),l=l==null?0:Pr(Ee(l),0,r.length),o=Lt(o),r.slice(l,l+o.length)==o}function JB(r,o,l){var f=y.templateSettings;l&&vt(r,o,l)&&(o=t),r=Fe(r),o=os({},o,f,up);var m=os({},o.imports,f.imports,up),_=ct(m),b=Fl(m,_),E,N,F=0,$=o.interpolate||_a,U="__p += '",X=zl((o.escape||_a).source+"|"+$.source+"|"+($===Au?BC:_a).source+"|"+(o.evaluate||_a).source+"|$","g"),se="//# sourceURL="+($e.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++aE+"]")+`
31
+ `;r.replace(X,function(he,Oe,Re,$t,Ct,zt){return Re||(Re=$t),U+=r.slice(F,zt).replace(PC,SE),Oe&&(E=!0,U+=`' +
32
+ __e(`+Oe+`) +
33
+ '`),Ct&&(N=!0,U+=`';
34
+ `+Ct+`;
35
+ __p += '`),Re&&(U+=`' +
36
+ ((__t = (`+Re+`)) == null ? '' : __t) +
37
+ '`),F=zt+he.length,he}),U+=`';
38
+ `;var pe=$e.call(o,"variable")&&o.variable;if(!pe)U=`with (obj) {
39
+ `+U+`
242
40
  }
243
- `;else if(Az.test(Se))throw new Pe(a);Y=(O?Y.replace(gz,""):Y).replace(fz,"$1").replace(mz,"$1;"),Y="function("+(Se||"obj")+`) {
244
- `+(Se?"":`obj || (obj = {});
245
- `)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(O?`, __j = Array.prototype.join;
41
+ `;else if(VC.test(pe))throw new be(u);U=(N?U.replace(fC,""):U).replace(pC,"$1").replace(hC,"$1;"),U="function("+(pe||"obj")+`) {
42
+ `+(pe?"":`obj || (obj = {});
43
+ `)+"var __t, __p = ''"+(E?", __e = _.escape":"")+(N?`, __j = Array.prototype.join;
246
44
  function print() { __p += __j.call(arguments, '') }
247
45
  `:`;
248
- `)+Y+`return __p
249
- }`;var Oe=uy(function(){return qe(E,pe+"return "+Y).apply(i,D)});if(Oe.source=Y,Jp(Oe))throw Oe;return Oe}function e5(c){return Qe(c).toLowerCase()}function t5(c){return Qe(c).toUpperCase()}function i5(c,u,g){if(c=Qe(c),c&&(g||u===i))return Sw(c);if(!c||!(u=Si(u)))return c;var C=ls(c),y=ls(u),E=yw(C,y),D=bw(C,y)+1;return Tn(C,E,D).join("")}function s5(c,u,g){if(c=Qe(c),c&&(g||u===i))return c.slice(0,Fw(c)+1);if(!c||!(u=Si(u)))return c;var C=ls(c),y=bw(C,ls(u))+1;return Tn(C,0,y).join("")}function n5(c,u,g){if(c=Qe(c),c&&(g||u===i))return c.replace(Jh,"");if(!c||!(u=Si(u)))return c;var C=ls(c),y=yw(C,ls(u));return Tn(C,y).join("")}function o5(c,u){var g=$,C=U;if(pt(u)){var y="separator"in u?u.separator:y;g="length"in u?Ie(u.length):g,C="omission"in u?Si(u.omission):C}c=Qe(c);var E=c.length;if(rr(c)){var D=ls(c);E=D.length}if(g>=E)return c;var M=g-lr(C);if(M<1)return C;var O=D?Tn(D,0,M).join(""):c.slice(0,M);if(y===i)return O+C;if(D&&(M+=O.length-M),eg(y)){if(c.slice(M).search(y)){var j,Z=O;for(y.global||(y=mp(y.source,Qe(Wv.exec(y))+"g")),y.lastIndex=0;j=y.exec(Z);)var Y=j.index;O=O.slice(0,Y===i?M:Y)}}else if(c.indexOf(Si(y),M)!=M){var se=O.lastIndexOf(y);se>-1&&(O=O.slice(0,se))}return O+C}function r5(c){return c=Qe(c),c&&Cz.test(c)?c.replace(Bv,_U):c}var l5=gr(function(c,u,g){return c+(g?" ":"")+u.toUpperCase()}),sg=hS("toUpperCase");function dy(c,u,g){return c=Qe(c),u=g?i:u,u===i?AU(c)?NU(c):yU(c):c.match(u)||[]}var uy=Ne(function(c,u){try{return vi(c,i,u)}catch(g){return Jp(g)?g:new Pe(g)}}),a5=Us(function(c,u){return Mi(u,function(g){g=Es(g),Ws(c,g,Qp(c[g],c))}),c});function c5(c){var u=c==null?0:c.length,g=ve();return c=u?at(c,function(C){if(typeof C[1]!="function")throw new ki(r);return[g(C[0]),C[1]]}):[],Ne(function(C){for(var y=-1;++y<u;){var E=c[y];if(vi(E[0],this,C))return vi(E[1],this,C)}})}function d5(c){return _2(Li(c,f))}function ng(c){return function(){return c}}function u5(c,u){return c==null||c!==c?u:c}var h5=gS(),p5=gS(!0);function ai(c){return c}function og(c){return Uw(typeof c=="function"?c:Li(c,f))}function g5(c){return Kw(Li(c,f))}function f5(c,u){return jw(c,Li(u,f))}var m5=Ne(function(c,u){return function(g){return $l(g,c,u)}}),C5=Ne(function(c,u){return function(g){return $l(c,g,u)}});function rg(c,u,g){var C=Dt(u),y=Hc(u,C);g==null&&!(pt(u)&&(y.length||!C.length))&&(g=u,u=c,c=this,y=Hc(u,Dt(u)));var E=!(pt(g)&&"chain"in g)||!!g.chain,D=Ks(c);return Mi(y,function(M){var O=u[M];c[M]=O,D&&(c.prototype[M]=function(){var j=this.__chain__;if(E||j){var Z=c(this.__wrapped__),Y=Z.__actions__=oi(this.__actions__);return Y.push({func:O,args:arguments,thisArg:c}),Z.__chain__=j,Z}return O.apply(c,Rn([this.value()],arguments))})}),c}function v5(){return At._===this&&(At._=UU),this}function lg(){}function w5(c){return c=Ie(c),Ne(function(u){return Zw(u,c)})}var S5=Np(at),y5=Np(fw),b5=Np(cp);function hy(c){return $p(c)?dp(Es(c)):X2(c)}function R5(c){return function(u){return c==null?i:po(c,u)}}var F5=mS(),E5=mS(!0);function ag(){return[]}function cg(){return!1}function x5(){return{}}function P5(){return""}function D5(){return!0}function T5(c,u){if(c=Ie(c),c<1||c>Ge)return[];var g=ni,C=Gt(c,ni);u=ve(u),c-=ni;for(var y=pp(C,u);++g<c;)u(g);return y}function A5(c){return De(c)?at(c,Es):yi(c)?[c]:oi(kS(Qe(c)))}function M5(c){var u=++WU;return Qe(c)+u}var k5=jc(function(c,u){return c+u},0),I5=Bp("ceil"),L5=jc(function(c,u){return c/u},1),_5=Bp("floor");function O5(c){return c&&c.length?Gc(c,ai,Fp):i}function V5(c,u){return c&&c.length?Gc(c,ve(u,2),Fp):i}function N5(c){return vw(c,ai)}function B5(c,u){return vw(c,ve(u,2))}function G5(c){return c&&c.length?Gc(c,ai,Dp):i}function H5(c,u){return c&&c.length?Gc(c,ve(u,2),Dp):i}var W5=jc(function(c,u){return c*u},1),z5=Bp("round"),U5=jc(function(c,u){return c-u},0);function $5(c){return c&&c.length?hp(c,ai):0}function K5(c,u){return c&&c.length?hp(c,ve(u,2)):0}return F.after=gK,F.ary=zS,F.assign=t4,F.assignIn=sy,F.assignInWith=rd,F.assignWith=i4,F.at=s4,F.before=US,F.bind=Qp,F.bindAll=a5,F.bindKey=$S,F.castArray=xK,F.chain=GS,F.chunk=_$,F.compact=O$,F.concat=V$,F.cond=c5,F.conforms=d5,F.constant=ng,F.countBy=$3,F.create=n4,F.curry=KS,F.curryRight=jS,F.debounce=ZS,F.defaults=o4,F.defaultsDeep=r4,F.defer=fK,F.delay=mK,F.difference=N$,F.differenceBy=B$,F.differenceWith=G$,F.drop=H$,F.dropRight=W$,F.dropRightWhile=z$,F.dropWhile=U$,F.fill=$$,F.filter=j3,F.flatMap=Y3,F.flatMapDeep=Q3,F.flatMapDepth=X3,F.flatten=OS,F.flattenDeep=K$,F.flattenDepth=j$,F.flip=CK,F.flow=h5,F.flowRight=p5,F.fromPairs=Z$,F.functions=p4,F.functionsIn=g4,F.groupBy=J3,F.initial=Y$,F.intersection=Q$,F.intersectionBy=X$,F.intersectionWith=J$,F.invert=m4,F.invertBy=C4,F.invokeMap=tK,F.iteratee=og,F.keyBy=iK,F.keys=Dt,F.keysIn=li,F.map=ed,F.mapKeys=w4,F.mapValues=S4,F.matches=g5,F.matchesProperty=f5,F.memoize=id,F.merge=y4,F.mergeWith=ny,F.method=m5,F.methodOf=C5,F.mixin=rg,F.negate=sd,F.nthArg=w5,F.omit=b4,F.omitBy=R4,F.once=vK,F.orderBy=sK,F.over=S5,F.overArgs=wK,F.overEvery=y5,F.overSome=b5,F.partial=Xp,F.partialRight=qS,F.partition=nK,F.pick=F4,F.pickBy=oy,F.property=hy,F.propertyOf=R5,F.pull=s3,F.pullAll=NS,F.pullAllBy=n3,F.pullAllWith=o3,F.pullAt=r3,F.range=F5,F.rangeRight=E5,F.rearg=SK,F.reject=lK,F.remove=l3,F.rest=yK,F.reverse=qp,F.sampleSize=cK,F.set=x4,F.setWith=P4,F.shuffle=dK,F.slice=a3,F.sortBy=pK,F.sortedUniq=f3,F.sortedUniqBy=m3,F.split=Y4,F.spread=bK,F.tail=C3,F.take=v3,F.takeRight=w3,F.takeRightWhile=S3,F.takeWhile=y3,F.tap=O3,F.throttle=RK,F.thru=Jc,F.toArray=ey,F.toPairs=ry,F.toPairsIn=ly,F.toPath=A5,F.toPlainObject=iy,F.transform=D4,F.unary=FK,F.union=b3,F.unionBy=R3,F.unionWith=F3,F.uniq=E3,F.uniqBy=x3,F.uniqWith=P3,F.unset=T4,F.unzip=Yp,F.unzipWith=BS,F.update=A4,F.updateWith=M4,F.values=Cr,F.valuesIn=k4,F.without=D3,F.words=dy,F.wrap=EK,F.xor=T3,F.xorBy=A3,F.xorWith=M3,F.zip=k3,F.zipObject=I3,F.zipObjectDeep=L3,F.zipWith=_3,F.entries=ry,F.entriesIn=ly,F.extend=sy,F.extendWith=rd,rg(F,F),F.add=k5,F.attempt=uy,F.camelCase=O4,F.capitalize=ay,F.ceil=I5,F.clamp=I4,F.clone=PK,F.cloneDeep=TK,F.cloneDeepWith=AK,F.cloneWith=DK,F.conformsTo=MK,F.deburr=cy,F.defaultTo=u5,F.divide=L5,F.endsWith=V4,F.eq=cs,F.escape=N4,F.escapeRegExp=B4,F.every=K3,F.find=Z3,F.findIndex=LS,F.findKey=l4,F.findLast=q3,F.findLastIndex=_S,F.findLastKey=a4,F.floor=_5,F.forEach=HS,F.forEachRight=WS,F.forIn=c4,F.forInRight=d4,F.forOwn=u4,F.forOwnRight=h4,F.get=tg,F.gt=kK,F.gte=IK,F.has=f4,F.hasIn=ig,F.head=VS,F.identity=ai,F.includes=eK,F.indexOf=q$,F.inRange=L4,F.invoke=v4,F.isArguments=mo,F.isArray=De,F.isArrayBuffer=LK,F.isArrayLike=ri,F.isArrayLikeObject=Ct,F.isBoolean=_K,F.isBuffer=An,F.isDate=OK,F.isElement=VK,F.isEmpty=NK,F.isEqual=BK,F.isEqualWith=GK,F.isError=Jp,F.isFinite=HK,F.isFunction=Ks,F.isInteger=YS,F.isLength=nd,F.isMap=QS,F.isMatch=WK,F.isMatchWith=zK,F.isNaN=UK,F.isNative=$K,F.isNil=jK,F.isNull=KK,F.isNumber=XS,F.isObject=pt,F.isObjectLike=gt,F.isPlainObject=Ql,F.isRegExp=eg,F.isSafeInteger=ZK,F.isSet=JS,F.isString=od,F.isSymbol=yi,F.isTypedArray=mr,F.isUndefined=qK,F.isWeakMap=YK,F.isWeakSet=QK,F.join=e3,F.kebabCase=G4,F.last=Oi,F.lastIndexOf=t3,F.lowerCase=H4,F.lowerFirst=W4,F.lt=XK,F.lte=JK,F.max=O5,F.maxBy=V5,F.mean=N5,F.meanBy=B5,F.min=G5,F.minBy=H5,F.stubArray=ag,F.stubFalse=cg,F.stubObject=x5,F.stubString=P5,F.stubTrue=D5,F.multiply=W5,F.nth=i3,F.noConflict=v5,F.noop=lg,F.now=td,F.pad=z4,F.padEnd=U4,F.padStart=$4,F.parseInt=K4,F.random=_4,F.reduce=oK,F.reduceRight=rK,F.repeat=j4,F.replace=Z4,F.result=E4,F.round=z5,F.runInContext=_,F.sample=aK,F.size=uK,F.snakeCase=q4,F.some=hK,F.sortedIndex=c3,F.sortedIndexBy=d3,F.sortedIndexOf=u3,F.sortedLastIndex=h3,F.sortedLastIndexBy=p3,F.sortedLastIndexOf=g3,F.startCase=Q4,F.startsWith=X4,F.subtract=U5,F.sum=$5,F.sumBy=K5,F.template=J4,F.times=T5,F.toFinite=js,F.toInteger=Ie,F.toLength=ty,F.toLower=e5,F.toNumber=Vi,F.toSafeInteger=e4,F.toString=Qe,F.toUpper=t5,F.trim=i5,F.trimEnd=s5,F.trimStart=n5,F.truncate=o5,F.unescape=r5,F.uniqueId=M5,F.upperCase=l5,F.upperFirst=sg,F.each=HS,F.eachRight=WS,F.first=VS,rg(F,function(){var c={};return Rs(F,function(u,g){Xe.call(F.prototype,g)||(c[g]=u)}),c}(),{chain:!1}),F.VERSION=s,Mi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){F[c].placeholder=F}),Mi(["drop","take"],function(c,u){ze.prototype[c]=function(g){g=g===i?1:bt(Ie(g),0);var C=this.__filtered__&&!u?new ze(this):this.clone();return C.__filtered__?C.__takeCount__=Gt(g,C.__takeCount__):C.__views__.push({size:Gt(g,ni),type:c+(C.__dir__<0?"Right":"")}),C},ze.prototype[c+"Right"]=function(g){return this.reverse()[c](g).reverse()}}),Mi(["filter","map","takeWhile"],function(c,u){var g=u+1,C=g==me||g==ie;ze.prototype[c]=function(y){var E=this.clone();return E.__iteratees__.push({iteratee:ve(y,3),type:g}),E.__filtered__=E.__filtered__||C,E}}),Mi(["head","last"],function(c,u){var g="take"+(u?"Right":"");ze.prototype[c]=function(){return this[g](1).value()[0]}}),Mi(["initial","tail"],function(c,u){var g="drop"+(u?"":"Right");ze.prototype[c]=function(){return this.__filtered__?new ze(this):this[g](1)}}),ze.prototype.compact=function(){return this.filter(ai)},ze.prototype.find=function(c){return this.filter(c).head()},ze.prototype.findLast=function(c){return this.reverse().find(c)},ze.prototype.invokeMap=Ne(function(c,u){return typeof c=="function"?new ze(this):this.map(function(g){return $l(g,c,u)})}),ze.prototype.reject=function(c){return this.filter(sd(ve(c)))},ze.prototype.slice=function(c,u){c=Ie(c);var g=this;return g.__filtered__&&(c>0||u<0)?new ze(g):(c<0?g=g.takeRight(-c):c&&(g=g.drop(c)),u!==i&&(u=Ie(u),g=u<0?g.dropRight(-u):g.take(u-c)),g)},ze.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},ze.prototype.toArray=function(){return this.take(ni)},Rs(ze.prototype,function(c,u){var g=/^(?:filter|find|map|reject)|While$/.test(u),C=/^(?:head|last)$/.test(u),y=F[C?"take"+(u=="last"?"Right":""):u],E=C||/^find/.test(u);y&&(F.prototype[u]=function(){var D=this.__wrapped__,M=C?[1]:arguments,O=D instanceof ze,j=M[0],Z=O||De(D),Y=function(He){var Ue=y.apply(F,Rn([He],M));return C&&se?Ue[0]:Ue};Z&&g&&typeof j=="function"&&j.length!=1&&(O=Z=!1);var se=this.__chain__,pe=!!this.__actions__.length,Se=E&&!se,Oe=O&&!pe;if(!E&&Z){D=Oe?D:new ze(this);var ye=c.apply(D,M);return ye.__actions__.push({func:Jc,args:[Y],thisArg:i}),new Ii(ye,se)}return Se&&Oe?c.apply(this,M):(ye=this.thru(Y),Se?C?ye.value()[0]:ye.value():ye)})}),Mi(["pop","push","shift","sort","splice","unshift"],function(c){var u=Ec[c],g=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",C=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var y=arguments;if(C&&!this.__chain__){var E=this.value();return u.apply(De(E)?E:[],y)}return this[g](function(D){return u.apply(De(D)?D:[],y)})}}),Rs(ze.prototype,function(c,u){var g=F[u];if(g){var C=g.name+"";Xe.call(ur,C)||(ur[C]=[]),ur[C].push({name:u,func:g})}}),ur[Kc(i,R).name]=[{name:"wrapper",func:i}],ze.prototype.clone=r2,ze.prototype.reverse=l2,ze.prototype.value=a2,F.prototype.at=V3,F.prototype.chain=N3,F.prototype.commit=B3,F.prototype.next=G3,F.prototype.plant=W3,F.prototype.reverse=z3,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=U3,F.prototype.first=F.prototype.head,Nl&&(F.prototype[Nl]=H3),F},ar=BU();lo?((lo.exports=ar)._=ar,op._=ar):At._=ar}).call(vr)}(uc,uc.exports);var ht=uc.exports;const TW={class:"grid-overlay-container"},Rv=l.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(e){return(t,i)=>(l.openBlock(),l.createElementBlock("div",TW,[t.params.notReady?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[i[0]||(i[0]=l.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),i[1]||(i[1]=l.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[i[2]||(i[2]=l.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),i[3]||(i[3]=l.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),AW={},MW={class:"grid-overlay-container"};function kW(e,t){return l.openBlock(),l.createElementBlock("div",MW,t[0]||(t[0]=[l.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),l.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Fv=xh(AW,[["render",kW]]);async function IW(e,t,i){throw Error("not implemented")}function LW(e){return e.axesSpec.filter(t=>{var i;return((i=t.annotations)==null?void 0:i["pl7.app/axisNature"])==="heterogeneous"})}function _W(e,t){const i=[];for(const s of t)if(e[s].type==="column"){const n=LW(e[s].spec);for(const o of n){if(o.type!=="String"){console.warn("heterogeneous axis with string type expected, got",o,"skipping");continue}const r=tC(o),a=e.findIndex(d=>ht.isEqual(d.id,r));if(a===-1)throw console.error("axis not found",s,r,e),Error("axis not found");i.push({columnIdx:s,axisIdx:a})}}return i}const Ev=(e,t)=>(e+t).toString();function OW(e,t,i,s,n,o){if(e.length>1)throw Error("hColumns.length > 1 is not supported");const r=e[0];let a=-1,d=-1;for(let f=0;f<o.length;++f)o[f]===r.axisIdx&&(a=f),o[f]===r.columnIdx&&(d=f);const h=(()=>{const m=s[a].data.filter(v=>v!==null);return Array.from(new Set(m))})();h.sort(),d>a?(i.splice(d,1),i.splice(a,1)):(i.splice(a,1),i.splice(d,1));const p=VW(n,s,a,d,h,t.rows);for(let f=0;f<h.length;++f){const m=h[f],v=m+"@"+f;i.push({colId:v,field:Ev(s.length,f),headerName:m,valueFormatter:xv})}return{rowModelType:"clientSide",columnDefs:i,rowData:p}}function VW(e,t,i,s,n,o){const r=new Map;let a=0;for(let h=0;h<o;h++){const p={};for(let S=0;S<t.length;++S){if(S===i||S===s)continue;const b=e[S].toString();p[b]=t[S].data[h]}let f;const m=wr(Object.values(p))??"";r.has(m)?f=r.get(m):(r.set(m,p),f=p,f.id=a.toString(),a++);const v=n.indexOf(t[i].data[h]);if(v===-1)throw Error("index not found");const w=Ev(t.length,v);f[w]=t[s].data[h]}return Array.from(r.values())}function NW(e){return wr({type:e.type,id:e.id})}function BW(e){return JSON.parse(e)}const xv=e=>e?e.value===void 0?"NULL":e.value===null?"NA":e.value.toString():"ERROR";function GW(e,t){var i,s;return{colId:NW(t),field:e.toString(),headerName:((s=(i=t.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:s.trim())??"Unlabeled "+t.type+" "+e.toString(),lockPosition:t.type==="axis",valueFormatter:xv,cellDataType:(n=>{switch(n){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${n}`)}})(t.type==="axis"?t.spec.type:t.spec.valueType)}}function Pv(e,t){switch(t){case"Int":return e;case"Long":return typeof e=="bigint"?Number(e):e;case"Float":return e;case"Double":return e;case"String":return e;case"Bytes":return Buffer.from(e).toString("hex");default:throw Error(`unsupported data type: ${t}`)}}function Dv(e){const t=[];return ja(e,i=>(t.push(i),i)),t}async function HW(e,t,i){return i.length?(await e.findColumns(t,{columnFilter:{name:["pl7.app/label"]},compatibleWith:ht.uniqWith(i.map(n=>Wu(n.spec.axesSpec).map(ht.cloneDeep)).flat(),ht.isEqual),strictlyCompatible:!0})).hits.filter(n=>n.spec.axesSpec.length===1):[]}async function WW(e,t,i){const s=Dv(i),o=(await HW(e,t,s)).filter(r=>!ht.find(s,a=>r.columnId===a.columnId));return o.length===0?i:{type:"outer",primary:i,secondary:o.map(r=>({type:"column",column:r}))}}async function zW(e,t,i,s){const n=i.filter(p=>p.type!=="Bytes"),o=Dv(s),r=n.map(p=>[]),a=n.map(p=>null);for(let p=0;p<o.length;++p){const f=Wu(o[p].spec.axesSpec);for(let m=0;m<f.length;++m){const v=ht.findIndex(n,w=>ht.isEqual(w,f[m]));v===-1||a[v]||(f.length===1&&o[p].spec.name==="pl7.app/label"?(r[v]=[[p,m]],a[v]=o[p].columnId):r[v].push([p,m]))}}for(let p=n.length-1;p>=0;--p)r[p].length||(a.splice(p,1),r.splice(p,1),n.splice(p,1));const d=100,h=n.map(p=>new Set);e:for(let p=n.length-1;p>=0;--p){for(const[f,m]of r[p]){const v=await e.getUniqueValues(t,{columnId:o[f].columnId,...!a[p]&&{axis:ht.cloneDeep(n[p])},filters:[],limit:d});if(v.overflow){a.splice(p,1),r.splice(p,1),n.splice(p,1);continue e}const w=v.values.type;for(const S of v.values.data)if(!(eC(S,w)||S===null)&&(h[p].add(Pv(S,w)),h[p].size===d)){a.splice(p,1),r.splice(p,1),n.splice(p,1);continue e}}if(!h[p].size){a.splice(p,1),r.splice(p,1),n.splice(p,1);continue e}}return n.map((p,f)=>{const m=[...h[f]].map(w=>({value:w,text:w.toString()})),v=m[0].value;return{axis:ht.cloneDeep(p),...a[f]&&{column:a[f]},options:m,defaultValue:v}})}function UW(e,t){const i=t.length,s=[];for(let n=0;n<t[0].data.length;++n){const o={};for(let r=0;r<i;++r){const a=e[r].toString(),d=t[r].data[n],h=t[r].type;uk(t[r].absent,n)?o[a]=void 0:eC(d,h)||d===null?o[a]=null:o[a]=Pv(d,h)}o.id=n.toString(),s.push(o)}return s}const $W=e=>e.type==="column"&&e.spec.axesSpec.length===1&&e.spec.name==="pl7.app/label";async function KW(e,t,i,s){const n=await t.getSpec(i),o=[...n.keys()].filter(v=>!ht.find(s,w=>ht.isEqual(w.axis,n[v].id)||ht.isEqual(w.column,n[v].id))),r=ht.cloneDeep(o),a=_W(n,o);for(let v=o.length-1;v>=0;--v){const w=o[v];if(!$W(n[w]))continue;const S=Wu(n[w].spec.axesSpec)[0],b=ht.findIndex(o,R=>ht.isEqual(n[R].id,S));if(b!==-1){o[b]=w;for(const R of a)R.axisIdx===w&&(R.axisIdx=b);o.splice(v,1),r.splice(v,1)}}const d=await t.getShape(i),h=d.rows,p=r.map(v=>GW(v,n[v]));if(a.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",a.length," transposition will not be applied."),a.length===1)return OW(a,d,p,await t.getData(i,o),r,o);let f;return{rowModelType:"infinite",columnDefs:p,datasource:{rowCount:h,getRows:async v=>{e.setGridOption("loading",!0);try{if(h==0){v.successCallback([],h),e.setGridOption("loading",!1),e.showNoRowsOverlay();return}if(f&&!ht.isEqual(f.sortModel,v.sortModel)){f=void 0,v.failCallback();return}f=v;const w=v.endRow-v.startRow;let S=[];if(w>0){const b=await t.getData(i,o,{offset:v.startRow,length:w});S=UW(r,b)}v.successCallback(S,d.rows),e.setGridOption("loading",!1),e.autoSizeAllColumns()}catch{v.failCallback()}}}}}const jW={class:"ap-ag-data-table-container"},ZW={key:0,class:"ap-ag-data-table-sheets"},qW=xh(l.defineComponent({__name:"PlAgDataTable",props:l.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(e){Is.registerModules([MH,wW,GH,DW]);const t=l.useModel(e,"modelValue"),i=e,{settings:s}=l.toRefs(i);l.watch(()=>s.value,async(w,S)=>{if(w.sourceType!=="pframe"||!w.pFrame||!w.join||S&&S.sourceType==="pframe"&&ht.isEqual(w.pFrame,S.pFrame)&&ht.isEqual(w.join,S.join))return;const b=window.platforma;if(!b)throw Error("platforma not set");const R=b.pFrameDriver;if(!R)throw Error("platforma.pFrameDriver not set");const x=await WW(R,w.pFrame,w.join),T=t.value;T.pTableParams||(T.pTableParams={sorting:[],filters:[]}),T.pTableParams.join=x,t.value=T});const n=Tv(()=>s.value.sourceType,async w=>{var b;const S=s.value.sourceType;switch(S){case"pframe":{const R=window.platforma;if(!R)throw Error("platforma not set");const x=R.pFrameDriver;if(!x)throw Error("platforma.pFrameDriver not set");if(!s.value.pFrame)return[];const T=s.value.pFrame,I=(b=t.value.pTableParams)==null?void 0:b.join;return I?await zW(x,T,s.value.sheetAxes,I):[]}case"ptable":return s.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${S}`)}});function o(w){if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return(w==null?void 0:w.sortModel.map(S=>({column:BW(S.colId),ascending:S.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const r=l.computed({get:()=>{const w=t.value;return{columnOrder:w.gridState.columnOrder,sort:w.gridState.sort}},set:w=>{const S=t.value,b=f.rowModelType==="clientSide"?void 0:o(w.sort);S.gridState.columnOrder=w.columnOrder,S.gridState.sort=w.sort,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(S.pTableParams||(S.pTableParams={sorting:[],filters:[]}),S.pTableParams.sorting=b),t.value=S}}),a=w=>wr(w);function d(w){var S;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((S=n.value)==null?void 0:S.map(b=>({type:"bySingleColumn",column:b.column?{type:"column",id:b.column}:{type:"axis",id:b.axis},predicate:{operator:"Equal",reference:w[a(b.axis)]}})))??[]}const h=l.computed({get:()=>t.value.gridState.sheets??{},set:w=>{const S=d(w),b=t.value;b.gridState.sheets=w,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(b.pTableParams||(b.pTableParams={sorting:[],filters:[]}),b.pTableParams.filters=S),t.value=b}});l.watch(()=>[s.value,n.value],(w,S)=>{const[b,R]=w;if(!R)return;if(S){const[T,I]=S;if((b.sourceType==="ptable"||b.sourceType==="pframe")&&b.sourceType===(T==null?void 0:T.sourceType)&&ht.isEqual(R,I))return}if(b.sourceType!=="ptable"&&b.sourceType!=="pframe"){h.value={};return}const x=h.value;for(const T of R){const I=a(T.axis);x[I]||(x[I]=T.defaultValue??T.options[0].value)}h.value=x},{immediate:!0});const p=l.shallowRef(),f={animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:t.value.gridState,onGridReady:w=>{p.value=w.api},onStateUpdated:w=>{r.value={columnOrder:w.state.columnOrder,sort:w.state.sort}},autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:w=>{w.api.autoSizeAllColumns()},maxBlocksInCache:1e4,cacheBlockSize:100,getRowId:w=>w.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Rv,noRowsOverlayComponent:Fv},m=l.ref(0);l.watch(()=>[p.value,r.value],(w,S)=>{if(ht.isEqual(w,S))return;const[b,R]=w;if(!b)return;const x=b.getState();ht.isEqual(R.columnOrder,x.columnOrder)&&ht.isEqual(R.sort,x.sort)||(f.initialState=R,++m.value)});const v=(w,S)=>{const b=h.value;b[w]!==S&&(b[w]=S,h.value=b)};return l.watch(()=>[p.value,s.value,n.value],async(w,S)=>{if(ht.isEqual(w,S))return;const[b,R,x]=w;if(!b)return;const T=window.platforma;if(!T)throw Error("platforma not set");const I=R.sourceType;switch(I){case"pframe":case"ptable":{const V=T.pFrameDriver;if(!V)throw Error("platforma.pFrameDriver not set");const L=R.pTable;if(!L||!x)return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const A=await KW(b,V,L,x);return b.updateGridOptions({loading:A.rowModelType==="infinite",loadingOverlayComponentParams:{notReady:!1},...A})}case"xsv":{const V=T.blobDriver;if(!V)throw Error("platforma.blobDriver not set");const L=R.xsvFile;if(!(L!=null&&L.ok)||!L.value)return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const A=await IW(b,V,L.value);return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...A})}default:throw Error(`unsupported source type: ${I}`)}}),(w,S)=>(l.openBlock(),l.createElementBlock("div",jW,[l.createVNode(l.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:l.withCtx(()=>[l.unref(n).value&&l.unref(n).value.length>0?(l.openBlock(),l.createElementBlock("div",ZW,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(n).value,(b,R)=>(l.openBlock(),l.createBlock(l.unref($C),{key:R,"model-value":h.value[a(b.axis)],options:b.options,"onUpdate:modelValue":x=>v(a(b.axis),x)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):l.createCommentVNode("",!0)]),_:1}),l.createVNode(l.unref(eW),{class:"ap-ag-data-table-grid","grid-options":f})]))}}),[["__scopeId","data-v-b1fc3f2f"]]),YW={key:1,class:"alert-error"},QW={key:2},XW=l.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(e){const t=e,i=l.computed(()=>t.valueOrError&&t.valueOrError.ok?t.valueOrError.value:void 0),s=l.computed(()=>t.valueOrError&&!t.valueOrError.ok?t.valueOrError.errors:void 0),n=l.computed(()=>i.value===void 0&&s.value===void 0);return(o,r)=>(l.openBlock(),l.createElementBlock("div",null,[i.value!==void 0?l.renderSlot(o.$slots,"default",l.normalizeProps(l.mergeProps({key:0},{value:i.value}))):l.createCommentVNode("",!0),s.value?(l.openBlock(),l.createElementBlock("div",YW,l.toDisplayString(s.value),1)):l.createCommentVNode("",!0),n.value?(l.openBlock(),l.createElementBlock("div",QW,"Unresolved")):l.createCommentVNode("",!0)]))}}),hc=new Map;function JW(e,t){const i=l.getCurrentScope()??l.effectScope(),s=i.run(()=>(l.onScopeDispose(()=>{hc.delete(e)}),l.reactive(t())));return s[Symbol.dispose]=()=>{i.stop()},s}function ez(e){const t=Symbol();return()=>(hc.has(t)||hc.set(t,JW(t,e)),hc.get(t))}function tz(e){return l.computed(()=>{try{return vg(e())}catch(t){return{errors:[String(t)],value:void 0}}})}function Tv(e,t,i){const s=l.ref(0),n=l.reactive({loading:l.computed(()=>s.value>0),loadingRef:s,value:void 0,error:void 0}),o=Ey(t);return l.watch(e,async r=>{n.error=void 0,s.value++,o(r).then(a=>{a.ok&&(n.value=a.value)}).catch(a=>{n.value=void 0,n.error=a}).finally(()=>{s.value--})},Object.assign({immediate:!0,deep:!0},i??{})),n}const Qo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Av=new Set,Nh=typeof process=="object"&&process?process:{},Mv=(e,t,i,s)=>{typeof Nh.emitWarning=="function"?Nh.emitWarning(e,t,i,s):console.error(`[${i}] ${t}: ${e}`)};let pc=globalThis.AbortController,kv=globalThis.AbortSignal;if(typeof pc>"u"){kv=class{constructor(){Ye(this,"onabort");Ye(this,"_onabort",[]);Ye(this,"reason");Ye(this,"aborted",!1)}addEventListener(s,n){this._onabort.push(n)}},pc=class{constructor(){Ye(this,"signal",new kv);t()}abort(s){var n,o;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const r of this.signal._onabort)r(s);(o=(n=this.signal).onabort)==null||o.call(n,s)}}};let e=((Lv=Nh.env)==null?void 0:Lv.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,Mv("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",t))}}const iz=e=>!Av.has(e),wn=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Iv=e=>wn(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?gc:null:null;class gc extends Array{constructor(t){super(t),this.fill(0)}}const io=class io{constructor(t,i){Ye(this,"heap");Ye(this,"length");if(!P(io,Xo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}static create(t){const i=Iv(t);if(!i)return[];we(io,Xo,!0);const s=new io(t,i);return we(io,Xo,!1),s}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};Xo=new WeakMap,je(io,Xo,!1);let Bh=io;const Wh=class Wh{constructor(t){je(this,te);je(this,Qi);je(this,gi);je(this,Xi);je(this,Ji);je(this,Jo);je(this,er);Ye(this,"ttl");Ye(this,"ttlResolution");Ye(this,"ttlAutopurge");Ye(this,"updateAgeOnGet");Ye(this,"updateAgeOnHas");Ye(this,"allowStale");Ye(this,"noDisposeOnSet");Ye(this,"noUpdateTTL");Ye(this,"maxEntrySize");Ye(this,"sizeCalculation");Ye(this,"noDeleteOnFetchRejection");Ye(this,"noDeleteOnStaleGet");Ye(this,"allowStaleOnFetchAbort");Ye(this,"allowStaleOnFetchRejection");Ye(this,"ignoreFetchAbort");je(this,St);je(this,es);je(this,wt);je(this,nt);je(this,xe);je(this,qt);je(this,fi);je(this,Bt);je(this,xt);je(this,ts);je(this,Pt);je(this,is);je(this,ss);je(this,mi);je(this,ns);je(this,Sn);je(this,Yt);je(this,so,()=>{});je(this,Ns,()=>{});je(this,Dl,()=>{});je(this,Ci,()=>!1);je(this,no,t=>{});je(this,tr,(t,i,s)=>{});je(this,Tl,(t,i,s,n)=>{if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ye(this,_v,"LRUCache");const{max:i=0,ttl:s,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:r,updateAgeOnHas:a,allowStale:d,dispose:h,disposeAfter:p,noDisposeOnSet:f,noUpdateTTL:m,maxSize:v=0,maxEntrySize:w=0,sizeCalculation:S,fetchMethod:b,memoMethod:R,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:V,ignoreFetchAbort:L}=t;if(i!==0&&!wn(i))throw new TypeError("max option must be a nonnegative integer");const A=i?Iv(i):Array;if(!A)throw new Error("invalid max value: "+i);if(we(this,Qi,i),we(this,gi,v),this.maxEntrySize=w||P(this,gi),this.sizeCalculation=S,this.sizeCalculation){if(!P(this,gi)&&!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(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(we(this,er,R),b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(we(this,Jo,b),we(this,Sn,!!b),we(this,wt,new Map),we(this,nt,new Array(i).fill(void 0)),we(this,xe,new Array(i).fill(void 0)),we(this,qt,new A(i)),we(this,fi,new A(i)),we(this,Bt,0),we(this,xt,0),we(this,ts,Bh.create(i)),we(this,St,0),we(this,es,0),typeof h=="function"&&we(this,Xi,h),typeof p=="function"?(we(this,Ji,p),we(this,Pt,[])):(we(this,Ji,void 0),we(this,Pt,void 0)),we(this,ns,!!P(this,Xi)),we(this,Yt,!!P(this,Ji)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(P(this,gi)!==0&&!wn(P(this,gi)))throw new TypeError("maxSize must be a positive integer if specified");if(!wn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");de(this,te,Fy).call(this)}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!a,this.ttlResolution=wn(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!wn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");de(this,te,pg).call(this)}if(P(this,Qi)===0&&this.ttl===0&&P(this,gi)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!P(this,Qi)&&!P(this,gi)){const k="LRU_CACHE_UNBOUNDED";iz(k)&&(Av.add(k),Mv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,Wh))}}static unsafeExposeInternals(t){return{starts:P(t,ss),ttls:P(t,mi),sizes:P(t,is),keyMap:P(t,wt),keyList:P(t,nt),valList:P(t,xe),next:P(t,qt),prev:P(t,fi),get head(){return P(t,Bt)},get tail(){return P(t,xt)},free:P(t,ts),isBackgroundFetch:i=>{var s;return de(s=t,te,rt).call(s,i)},backgroundFetch:(i,s,n,o)=>{var r;return de(r=t,te,dd).call(r,i,s,n,o)},moveToTail:i=>{var s;return de(s=t,te,Jl).call(s,i)},indexes:i=>{var s;return de(s=t,te,kn).call(s,i)},rindexes:i=>{var s;return de(s=t,te,In).call(s,i)},isStale:i=>{var s;return P(s=t,Ci).call(s,i)}}}get max(){return P(this,Qi)}get maxSize(){return P(this,gi)}get calculatedSize(){return P(this,es)}get size(){return P(this,St)}get fetchMethod(){return P(this,Jo)}get memoMethod(){return P(this,er)}get dispose(){return P(this,Xi)}get disposeAfter(){return P(this,Ji)}getRemainingTTL(t){return P(this,wt).has(t)?1/0:0}*entries(){for(const t of de(this,te,kn).call(this))P(this,xe)[t]!==void 0&&P(this,nt)[t]!==void 0&&!de(this,te,rt).call(this,P(this,xe)[t])&&(yield[P(this,nt)[t],P(this,xe)[t]])}*rentries(){for(const t of de(this,te,In).call(this))P(this,xe)[t]!==void 0&&P(this,nt)[t]!==void 0&&!de(this,te,rt).call(this,P(this,xe)[t])&&(yield[P(this,nt)[t],P(this,xe)[t]])}*keys(){for(const t of de(this,te,kn).call(this)){const i=P(this,nt)[t];i!==void 0&&!de(this,te,rt).call(this,P(this,xe)[t])&&(yield i)}}*rkeys(){for(const t of de(this,te,In).call(this)){const i=P(this,nt)[t];i!==void 0&&!de(this,te,rt).call(this,P(this,xe)[t])&&(yield i)}}*values(){for(const t of de(this,te,kn).call(this))P(this,xe)[t]!==void 0&&!de(this,te,rt).call(this,P(this,xe)[t])&&(yield P(this,xe)[t])}*rvalues(){for(const t of de(this,te,In).call(this))P(this,xe)[t]!==void 0&&!de(this,te,rt).call(this,P(this,xe)[t])&&(yield P(this,xe)[t])}[(Ov=Symbol.iterator,_v=Symbol.toStringTag,Ov)](){return this.entries()}find(t,i={}){for(const s of de(this,te,kn).call(this)){const n=P(this,xe)[s],o=de(this,te,rt).call(this,n)?n.__staleWhileFetching:n;if(o!==void 0&&t(o,P(this,nt)[s],this))return this.get(P(this,nt)[s],i)}}forEach(t,i=this){for(const s of de(this,te,kn).call(this)){const n=P(this,xe)[s],o=de(this,te,rt).call(this,n)?n.__staleWhileFetching:n;o!==void 0&&t.call(i,o,P(this,nt)[s],this)}}rforEach(t,i=this){for(const s of de(this,te,In).call(this)){const n=P(this,xe)[s],o=de(this,te,rt).call(this,n)?n.__staleWhileFetching:n;o!==void 0&&t.call(i,o,P(this,nt)[s],this)}}purgeStale(){let t=!1;for(const i of de(this,te,In).call(this,{allowStale:!0}))P(this,Ci).call(this,i)&&(de(this,te,Ln).call(this,P(this,nt)[i],"expire"),t=!0);return t}info(t){const i=P(this,wt).get(t);if(i===void 0)return;const s=P(this,xe)[i],n=de(this,te,rt).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;const o={value:n};if(P(this,mi)&&P(this,ss)){const r=P(this,mi)[i],a=P(this,ss)[i];if(r&&a){const d=r-(Qo.now()-a);o.ttl=d,o.start=Date.now()}}return P(this,is)&&(o.size=P(this,is)[i]),o}dump(){const t=[];for(const i of de(this,te,kn).call(this,{allowStale:!0})){const s=P(this,nt)[i],n=P(this,xe)[i],o=de(this,te,rt).call(this,n)?n.__staleWhileFetching:n;if(o===void 0||s===void 0)continue;const r={value:o};if(P(this,mi)&&P(this,ss)){r.ttl=P(this,mi)[i];const a=Qo.now()-P(this,ss)[i];r.start=Math.floor(Date.now()-a)}P(this,is)&&(r.size=P(this,is)[i]),t.unshift([s,r])}return t}load(t){this.clear();for(const[i,s]of t){if(s.start){const n=Date.now()-s.start;s.start=Qo.now()-n}this.set(i,s.value,s)}}set(t,i,s={}){var m,v,w,S,b;if(i===void 0)return this.delete(t),this;const{ttl:n=this.ttl,start:o,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:d}=s;let{noUpdateTTL:h=this.noUpdateTTL}=s;const p=P(this,Tl).call(this,t,i,s.size||0,a);if(this.maxEntrySize&&p>this.maxEntrySize)return d&&(d.set="miss",d.maxEntrySizeExceeded=!0),de(this,te,Ln).call(this,t,"set"),this;let f=P(this,St)===0?void 0:P(this,wt).get(t);if(f===void 0)f=P(this,St)===0?P(this,xt):P(this,ts).length!==0?P(this,ts).pop():P(this,St)===P(this,Qi)?de(this,te,cd).call(this,!1):P(this,St),P(this,nt)[f]=t,P(this,xe)[f]=i,P(this,wt).set(t,f),P(this,qt)[P(this,xt)]=f,P(this,fi)[f]=P(this,xt),we(this,xt,f),ld(this,St)._++,P(this,tr).call(this,f,p,d),d&&(d.set="add"),h=!1;else{de(this,te,Jl).call(this,f);const R=P(this,xe)[f];if(i!==R){if(P(this,Sn)&&de(this,te,rt).call(this,R)){R.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:x}=R;x!==void 0&&!r&&(P(this,ns)&&((m=P(this,Xi))==null||m.call(this,x,t,"set")),P(this,Yt)&&((v=P(this,Pt))==null||v.push([x,t,"set"])))}else r||(P(this,ns)&&((w=P(this,Xi))==null||w.call(this,R,t,"set")),P(this,Yt)&&((S=P(this,Pt))==null||S.push([R,t,"set"])));if(P(this,no).call(this,f),P(this,tr).call(this,f,p,d),P(this,xe)[f]=i,d){d.set="replace";const x=R&&de(this,te,rt).call(this,R)?R.__staleWhileFetching:R;x!==void 0&&(d.oldValue=x)}}else d&&(d.set="update")}if(n!==0&&!P(this,mi)&&de(this,te,pg).call(this),P(this,mi)&&(h||P(this,Dl).call(this,f,n,o),d&&P(this,Ns).call(this,d,f)),!r&&P(this,Yt)&&P(this,Pt)){const R=P(this,Pt);let x;for(;x=R==null?void 0:R.shift();)(b=P(this,Ji))==null||b.call(this,...x)}return this}pop(){var t;try{for(;P(this,St);){const i=P(this,xe)[P(this,Bt)];if(de(this,te,cd).call(this,!0),de(this,te,rt).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(P(this,Yt)&&P(this,Pt)){const i=P(this,Pt);let s;for(;s=i==null?void 0:i.shift();)(t=P(this,Ji))==null||t.call(this,...s)}}}has(t,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=i,o=P(this,wt).get(t);if(o!==void 0){const r=P(this,xe)[o];if(de(this,te,rt).call(this,r)&&r.__staleWhileFetching===void 0)return!1;if(P(this,Ci).call(this,o))n&&(n.has="stale",P(this,Ns).call(this,n,o));else return s&&P(this,so).call(this,o),n&&(n.has="hit",P(this,Ns).call(this,n,o)),!0}else n&&(n.has="miss");return!1}peek(t,i={}){const{allowStale:s=this.allowStale}=i,n=P(this,wt).get(t);if(n===void 0||!s&&P(this,Ci).call(this,n))return;const o=P(this,xe)[n];return de(this,te,rt).call(this,o)?o.__staleWhileFetching:o}async fetch(t,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:d=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:p=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:R,signal:x}=i;if(!P(this,Sn))return R&&(R.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:R});const T={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:r,noDisposeOnSet:a,size:d,sizeCalculation:h,noUpdateTTL:p,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:w,ignoreFetchAbort:v,status:R,signal:x};let I=P(this,wt).get(t);if(I===void 0){R&&(R.fetch="miss");const V=de(this,te,dd).call(this,t,I,T,S);return V.__returned=V}else{const V=P(this,xe)[I];if(de(this,te,rt).call(this,V)){const $=s&&V.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",$&&(R.returnedStale=!0)),$?V.__staleWhileFetching:V.__returned=V}const L=P(this,Ci).call(this,I);if(!b&&!L)return R&&(R.fetch="hit"),de(this,te,Jl).call(this,I),n&&P(this,so).call(this,I),R&&P(this,Ns).call(this,R,I),V;const A=de(this,te,dd).call(this,t,I,T,S),N=A.__staleWhileFetching!==void 0&&s;return R&&(R.fetch=L?"stale":"refresh",N&&L&&(R.returnedStale=!0)),N?A.__staleWhileFetching:A.__returned=A}}async forceFetch(t,i={}){const s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){const s=P(this,er);if(!s)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:o,...r}=i,a=this.get(t,r);if(!o&&a!==void 0)return a;const d=s(t,a,{options:r,context:n});return this.set(t,d,r),d}get(t,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:r}=i,a=P(this,wt).get(t);if(a!==void 0){const d=P(this,xe)[a],h=de(this,te,rt).call(this,d);return r&&P(this,Ns).call(this,r,a),P(this,Ci).call(this,a)?(r&&(r.get="stale"),h?(r&&s&&d.__staleWhileFetching!==void 0&&(r.returnedStale=!0),s?d.__staleWhileFetching:void 0):(o||de(this,te,Ln).call(this,t,"expire"),r&&s&&(r.returnedStale=!0),s?d:void 0)):(r&&(r.get="hit"),h?d.__staleWhileFetching:(de(this,te,Jl).call(this,a),n&&P(this,so).call(this,a),d))}else r&&(r.get="miss")}delete(t){return de(this,te,Ln).call(this,t,"delete")}clear(){return de(this,te,mg).call(this,"delete")}};Qi=new WeakMap,gi=new WeakMap,Xi=new WeakMap,Ji=new WeakMap,Jo=new WeakMap,er=new WeakMap,St=new WeakMap,es=new WeakMap,wt=new WeakMap,nt=new WeakMap,xe=new WeakMap,qt=new WeakMap,fi=new WeakMap,Bt=new WeakMap,xt=new WeakMap,ts=new WeakMap,Pt=new WeakMap,is=new WeakMap,ss=new WeakMap,mi=new WeakMap,ns=new WeakMap,Sn=new WeakMap,Yt=new WeakMap,te=new WeakSet,pg=function(){const t=new gc(P(this,Qi)),i=new gc(P(this,Qi));we(this,mi,t),we(this,ss,i),we(this,Dl,(o,r,a=Qo.now())=>{if(i[o]=r!==0?a:0,t[o]=r,r!==0&&this.ttlAutopurge){const d=setTimeout(()=>{P(this,Ci).call(this,o)&&de(this,te,Ln).call(this,P(this,nt)[o],"expire")},r+1);d.unref&&d.unref()}}),we(this,so,o=>{i[o]=t[o]!==0?Qo.now():0}),we(this,Ns,(o,r)=>{if(t[r]){const a=t[r],d=i[r];if(!a||!d)return;o.ttl=a,o.start=d,o.now=s||n();const h=o.now-d;o.remainingTTL=a-h}});let s=0;const n=()=>{const o=Qo.now();if(this.ttlResolution>0){s=o;const r=setTimeout(()=>s=0,this.ttlResolution);r.unref&&r.unref()}return o};this.getRemainingTTL=o=>{const r=P(this,wt).get(o);if(r===void 0)return 0;const a=t[r],d=i[r];if(!a||!d)return 1/0;const h=(s||n())-d;return a-h},we(this,Ci,o=>{const r=i[o],a=t[o];return!!a&&!!r&&(s||n())-r>a})},so=new WeakMap,Ns=new WeakMap,Dl=new WeakMap,Ci=new WeakMap,Fy=function(){const t=new gc(P(this,Qi));we(this,es,0),we(this,is,t),we(this,no,i=>{we(this,es,P(this,es)-t[i]),t[i]=0}),we(this,Tl,(i,s,n,o)=>{if(de(this,te,rt).call(this,s))return 0;if(!wn(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(s,i),!wn(n))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 n}),we(this,tr,(i,s,n)=>{if(t[i]=s,P(this,gi)){const o=P(this,gi)-t[i];for(;P(this,es)>o;)de(this,te,cd).call(this,!0)}we(this,es,P(this,es)+t[i]),n&&(n.entrySize=s,n.totalCalculatedSize=P(this,es))})},no=new WeakMap,tr=new WeakMap,Tl=new WeakMap,kn=function*({allowStale:t=this.allowStale}={}){if(P(this,St))for(let i=P(this,xt);!(!de(this,te,gg).call(this,i)||((t||!P(this,Ci).call(this,i))&&(yield i),i===P(this,Bt)));)i=P(this,fi)[i]},In=function*({allowStale:t=this.allowStale}={}){if(P(this,St))for(let i=P(this,Bt);!(!de(this,te,gg).call(this,i)||((t||!P(this,Ci).call(this,i))&&(yield i),i===P(this,xt)));)i=P(this,qt)[i]},gg=function(t){return t!==void 0&&P(this,wt).get(P(this,nt)[t])===t},cd=function(t){var o,r;const i=P(this,Bt),s=P(this,nt)[i],n=P(this,xe)[i];return P(this,Sn)&&de(this,te,rt).call(this,n)?n.__abortController.abort(new Error("evicted")):(P(this,ns)||P(this,Yt))&&(P(this,ns)&&((o=P(this,Xi))==null||o.call(this,n,s,"evict")),P(this,Yt)&&((r=P(this,Pt))==null||r.push([n,s,"evict"]))),P(this,no).call(this,i),t&&(P(this,nt)[i]=void 0,P(this,xe)[i]=void 0,P(this,ts).push(i)),P(this,St)===1?(we(this,Bt,we(this,xt,0)),P(this,ts).length=0):we(this,Bt,P(this,qt)[i]),P(this,wt).delete(s),ld(this,St)._--,i},dd=function(t,i,s,n){const o=i===void 0?void 0:P(this,xe)[i];if(de(this,te,rt).call(this,o))return o;const r=new pc,{signal:a}=s;a==null||a.addEventListener("abort",()=>r.abort(a.reason),{signal:r.signal});const d={signal:r.signal,options:s,context:n},h=(S,b=!1)=>{const{aborted:R}=r.signal,x=s.ignoreFetchAbort&&S!==void 0;if(s.status&&(R&&!b?(s.status.fetchAborted=!0,s.status.fetchError=r.signal.reason,x&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),R&&!x&&!b)return f(r.signal.reason);const T=v;return P(this,xe)[i]===v&&(S===void 0?T.__staleWhileFetching?P(this,xe)[i]=T.__staleWhileFetching:de(this,te,Ln).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,S,d.options))),S},p=S=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=S),f(S)),f=S=>{const{aborted:b}=r.signal,R=b&&s.allowStaleOnFetchAbort,x=R||s.allowStaleOnFetchRejection,T=x||s.noDeleteOnFetchRejection,I=v;if(P(this,xe)[i]===v&&(!T||I.__staleWhileFetching===void 0?de(this,te,Ln).call(this,t,"fetch"):R||(P(this,xe)[i]=I.__staleWhileFetching)),x)return s.status&&I.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw S},m=(S,b)=>{var x;const R=(x=P(this,Jo))==null?void 0:x.call(this,t,o,d);R&&R instanceof Promise&&R.then(T=>S(T===void 0?void 0:T),b),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(S(void 0),s.allowStaleOnFetchAbort&&(S=T=>h(T,!0)))})};s.status&&(s.status.fetchDispatched=!0);const v=new Promise(m).then(h,p),w=Object.assign(v,{__abortController:r,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(t,w,{...d.options,status:void 0}),i=P(this,wt).get(t)):P(this,xe)[i]=w,w},rt=function(t){if(!P(this,Sn))return!1;const i=t;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof pc},fg=function(t,i){P(this,fi)[i]=t,P(this,qt)[t]=i},Jl=function(t){t!==P(this,xt)&&(t===P(this,Bt)?we(this,Bt,P(this,qt)[t]):de(this,te,fg).call(this,P(this,fi)[t],P(this,qt)[t]),de(this,te,fg).call(this,P(this,xt),t),we(this,xt,t))},Ln=function(t,i){var n,o,r,a;let s=!1;if(P(this,St)!==0){const d=P(this,wt).get(t);if(d!==void 0)if(s=!0,P(this,St)===1)de(this,te,mg).call(this,i);else{P(this,no).call(this,d);const h=P(this,xe)[d];if(de(this,te,rt).call(this,h)?h.__abortController.abort(new Error("deleted")):(P(this,ns)||P(this,Yt))&&(P(this,ns)&&((n=P(this,Xi))==null||n.call(this,h,t,i)),P(this,Yt)&&((o=P(this,Pt))==null||o.push([h,t,i]))),P(this,wt).delete(t),P(this,nt)[d]=void 0,P(this,xe)[d]=void 0,d===P(this,xt))we(this,xt,P(this,fi)[d]);else if(d===P(this,Bt))we(this,Bt,P(this,qt)[d]);else{const p=P(this,fi)[d];P(this,qt)[p]=P(this,qt)[d];const f=P(this,qt)[d];P(this,fi)[f]=P(this,fi)[d]}ld(this,St)._--,P(this,ts).push(d)}}if(P(this,Yt)&&((r=P(this,Pt))!=null&&r.length)){const d=P(this,Pt);let h;for(;h=d==null?void 0:d.shift();)(a=P(this,Ji))==null||a.call(this,...h)}return s},mg=function(t){var i,s,n;for(const o of de(this,te,In).call(this,{allowStale:!0})){const r=P(this,xe)[o];if(de(this,te,rt).call(this,r))r.__abortController.abort(new Error("deleted"));else{const a=P(this,nt)[o];P(this,ns)&&((i=P(this,Xi))==null||i.call(this,r,a,t)),P(this,Yt)&&((s=P(this,Pt))==null||s.push([r,a,t]))}}if(P(this,wt).clear(),P(this,xe).fill(void 0),P(this,nt).fill(void 0),P(this,mi)&&P(this,ss)&&(P(this,mi).fill(0),P(this,ss).fill(0)),P(this,is)&&P(this,is).fill(0),we(this,Bt,0),we(this,xt,0),P(this,ts).length=0,we(this,es,0),we(this,St,0),P(this,Yt)&&P(this,Pt)){const o=P(this,Pt);let r;for(;r=o==null?void 0:o.shift();)(n=P(this,Ji))==null||n.call(this,...r)}};let Gh=Wh;const sz={cacheSize:15e6};class nz{constructor(t){Ye(this,"_str");Ye(this,"_rawJson");Ye(this,"_zodSchema");Ye(this,"_validatedJson");this.bytes=t}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(t){return this._zodSchema!==t&&(this._validatedJson=t.parse(this.rawJson),this._zodSchema=t),this._validatedJson}}const oo=class oo{constructor(t){Ye(this,"fileDataCache");Ye(this,"fileDataRefs",new Map);const i={...sz,...t??{}};this.fileDataCache=new Gh({maxSize:i.cacheSize,fetchMethod:async s=>new nz(await pk().blobDriver.getContent(s)),sizeCalculation:s=>s.bytes.length,dispose:(s,n)=>{this.fileDataRefs.delete(n)}})}getDataRef(t){const i=this.fileDataRefs.get(t);if(i!==void 0)return i;const s=l.shallowRef();return this.fileDataRefs.set(t,s),(async()=>{try{const n=await this.fileDataCache.fetch(t);s.value=n}catch(n){console.error(n)}})(),s}getContentBytes(t){if(t===void 0)return;const i=this.getDataRef(t);return l.computed(()=>{var s;return(s=i.value)==null?void 0:s.bytes})}getContentString(t){if(t===void 0)return;const i=this.getDataRef(t);return l.computed(()=>{var s;return(s=i==null?void 0:i.value)==null?void 0:s.str})}getContentJson(t,i){if(t===void 0)return;const s=this.getDataRef(t);return l.computed(()=>{var n,o;return i===void 0?(n=s==null?void 0:s.value)==null?void 0:n.rawJson:(o=s==null?void 0:s.value)==null?void 0:o.validatedJson(i)})}static getContentBytes(t){return oo.globalInstance.getContentBytes(t)}static getContentString(t){return oo.globalInstance.getContentString(t)}static getContentJson(t,i){return oo.globalInstance.getContentJson(t,i)}};Ye(oo,"globalInstance",new oo);let Hh=oo;W.BlockLayout=dH,W.ContextProvider=wB,W.DataTable=KL,W.DemoData=tH,W.DropdownListItem=ec,W.GridTable=qI,W.LongText=UC,W.MaskIcon16=cl,W.MaskIcon24=Xn,W.MultiError=pd,W.PlAgDataTable=qW,W.PlAgOverlayLoading=Rv,W.PlAgOverlayNoRows=Fv,W.PlAlert=S_,W.PlBlockPage=o_,W.PlBtnAccent=E_,W.PlBtnGhost=IC,W.PlBtnGroup=j_,W.PlBtnLink=T_,W.PlBtnPrimary=kC,W.PlBtnSecondary=dh,W.PlCheckbox=FV,W.PlCheckboxGroup=DV,W.PlChip=Ch,W.PlContainer=l_,W.PlDialogModal=KC,W.PlDropdown=mh,W.PlDropdownLine=$C,W.PlDropdownMulti=bV,W.PlDropdownRef=NO,W.PlFileDialog=jC,W.PlFileInput=vB,W.PlGrid=g_,W.PlLogView=zV,W.PlNumberField=lV,W.PlProgressBar=eV,W.PlRow=c_,W.PlSlideModal=VV,W.PlSpacer=h_,W.PlTextArea=mO,W.PlTextField=GC,W.PlToggleSwitch=GV,W.PlTooltip=Ti,W.ReactiveFileContent=Hh,W.Scrollable=d1,W.Slider=AB,W.SliderRange=r1,W.SliderRangeTriple=ZB,W.ThemeSwitcher=XL,W.UnresolvedError=hd,W.ValueOrErrorsComponent=XW,W.activateAgGrid=iC,W.animate=RC,W.animateInfinite=jI,W.call=vC,W.computedResult=tz,W.createModel=wd,W.debounce=FC,W.defineApp=fk,W.defineStore=ez,W.delay=wC,W.detectOutside=CO,W.ensureError=md,W.eventListener=gh,W.formatZodError=vd,W.getElementScrollPosition=WC,W.identity=fd,W.isDefined=Ay,W.isElementVisible=HC,W.isJsonEqual=gd,W.isZodError=Cd,W.listToOptions=ZI,W.makeEaseInOut=KI,W.makeEaseOut=bC,W.maskIcons16=JG,W.maskIcons24=eH,W.normalizeListOptions=zo,W.notEmpty=Ju,W.randomInt=yC,W.randomString=$I,W.requestTick=eh,W.scrollIntoView=Ja,W.showContextMenu=sh,W.throttle=th,W.timeout=SC,W.unwrapOptionalResult=Ty,W.unwrapValueOrErrors=Cg,W.useClickOutside=Xa,W.useDraggable=VB,W.useEventListener=dt,W.useFormState=_B,W.useHover=Xu,W.useInterval=LB,W.useLabelNotch=Qn,W.useLocalStorage=DC,W.useMouse=Qu,W.useMouseCapture=un,W.usePosition=LC,W.useQuery=OB,W.useResizeObserver=av,W.useScroll=MB,W.useSdkPlugin=zu,W.useSortable=IB,W.useTheme=AC,W.useWatchFetch=Tv,W.wrapOptionalResult=vg,W.wrapValueOrErrors=Dy,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
46
+ `)+U+`return __p
47
+ }`;var Ve=rh(function(){return Pe(_,se+"return "+U).apply(t,b)});if(Ve.source=U,Cc(Ve))throw Ve;return Ve}function XB(r){return Fe(r).toLowerCase()}function QB(r){return Fe(r).toUpperCase()}function e2(r,o,l){if(r=Fe(r),r&&(l||o===t))return ff(r);if(!r||!(o=Lt(o)))return r;var f=mn(r),m=mn(o),_=pf(f,m),b=hf(f,m)+1;return pr(f,_,b).join("")}function t2(r,o,l){if(r=Fe(r),r&&(l||o===t))return r.slice(0,gf(r)+1);if(!r||!(o=Lt(o)))return r;var f=mn(r),m=hf(f,mn(o))+1;return pr(f,0,m).join("")}function n2(r,o,l){if(r=Fe(r),r&&(l||o===t))return r.replace(Cl,"");if(!r||!(o=Lt(o)))return r;var f=mn(r),m=pf(f,mn(o));return pr(f,m).join("")}function r2(r,o){var l=Z,f=L;if(Je(o)){var m="separator"in o?o.separator:m;l="length"in o?Ee(o.length):l,f="omission"in o?Lt(o.omission):f}r=Fe(r);var _=r.length;if(ui(r)){var b=mn(r);_=b.length}if(l>=_)return r;var E=l-fi(f);if(E<1)return f;var N=b?pr(b,0,E).join(""):r.slice(0,E);if(m===t)return N+f;if(b&&(E+=N.length-E),Ec(m)){if(r.slice(E).search(m)){var F,$=N;for(m.global||(m=zl(m.source,Fe(Ru.exec(m))+"g")),m.lastIndex=0;F=m.exec($);)var U=F.index;N=N.slice(0,U===t?E:U)}}else if(r.indexOf(Lt(m),E)!=E){var X=N.lastIndexOf(m);X>-1&&(N=N.slice(0,X))}return N+f}function i2(r){return r=Fe(r),r&&mC.test(r)?r.replace(Bu,RE):r}var o2=wi(function(r,o,l){return r+(l?" ":"")+o.toUpperCase()}),Vc=ip("toUpperCase");function nh(r,o,l){return r=Fe(r),o=l?t:o,o===t?VE(r)?ME(r):wE(r):r.match(o)||[]}var rh=Ne(function(r,o){try{return Mt(r,t,o)}catch(l){return Cc(l)?l:new be(l)}}),a2=Ln(function(r,o){return jt(o,function(l){l=Tn(l),Mn(r,l,xc(r[l],r))}),r});function s2(r){var o=r==null?0:r.length,l=ue();return r=o?He(r,function(f){if(typeof f[1]!="function")throw new Wt(d);return[l(f[0]),f[1]]}):[],Ne(function(f){for(var m=-1;++m<o;){var _=r[m];if(Mt(_[0],this,f))return Mt(_[1],this,f)}})}function l2(r){return RS(qt(r,x))}function Nc(r){return function(){return r}}function c2(r,o){return r==null||r!==r?o:r}var d2=ap(),u2=ap(!0);function Nt(r){return r}function Bc(r){return Mf(typeof r=="function"?r:qt(r,x))}function f2(r){return Lf(qt(r,x))}function p2(r,o){return Ff(r,qt(o,x))}var h2=Ne(function(r,o){return function(l){return Vo(l,r,o)}}),m2=Ne(function(r,o){return function(l){return Vo(r,l,o)}});function Oc(r,o,l){var f=ct(o),m=$a(o,f);l==null&&!(Je(o)&&(m.length||!f.length))&&(l=o,o=r,r=this,m=$a(o,ct(o)));var _=!(Je(l)&&"chain"in l)||!!l.chain,b=$n(r);return jt(m,function(E){var N=o[E];r[E]=N,b&&(r.prototype[E]=function(){var F=this.__chain__;if(_||F){var $=r(this.__wrapped__),U=$.__actions__=St(this.__actions__);return U.push({func:N,args:arguments,thisArg:r}),$.__chain__=F,$}return N.apply(r,sr([this.value()],arguments))})}),r}function g2(){return dt._===this&&(dt._=ZE),this}function Ac(){}function y2(r){return r=Ee(r),Ne(function(o){return $f(o,r)})}var _2=cc(He),w2=cc(sf),b2=cc(Dl);function ih(r){return gc(r)?Il(Tn(r)):YS(r)}function k2(r){return function(o){return r==null?t:Lr(r,o)}}var x2=lp(),v2=lp(!0);function Rc(){return[]}function Dc(){return!1}function C2(){return{}}function E2(){return""}function S2(){return!0}function T2(r,o){if(r=Ee(r),r<1||r>Be)return[];var l=Et,f=gt(r,Et);o=ue(o),r-=Et;for(var m=Ll(f,o);++l<r;)o(l);return m}function V2(r){return ke(r)?He(r,Tn):Ft(r)?[r]:St(Cp(Fe(r)))}function N2(r){var o=++$E;return Fe(r)+o}var B2=Ha(function(r,o){return r+o},0),O2=dc("ceil"),A2=Ha(function(r,o){return r/o},1),R2=dc("floor");function D2(r){return r&&r.length?Fa(r,Nt,Kl):t}function I2(r,o){return r&&r.length?Fa(r,ue(o,2),Kl):t}function M2(r){return df(r,Nt)}function P2(r,o){return df(r,ue(o,2))}function L2(r){return r&&r.length?Fa(r,Nt,Ql):t}function F2(r,o){return r&&r.length?Fa(r,ue(o,2),Ql):t}var $2=Ha(function(r,o){return r*o},1),z2=dc("round"),Z2=Ha(function(r,o){return r-o},0);function U2(r){return r&&r.length?Pl(r,Nt):0}function j2(r,o){return r&&r.length?Pl(r,ue(o,2)):0}return y.after=fN,y.ary=Ip,y.assign=QN,y.assignIn=Kp,y.assignInWith=os,y.assignWith=eB,y.at=tB,y.before=Mp,y.bind=xc,y.bindAll=a2,y.bindKey=Pp,y.castArray=CN,y.chain=Ap,y.chunk=RT,y.compact=DT,y.concat=IT,y.cond=s2,y.conforms=l2,y.constant=Nc,y.countBy=UV,y.create=nB,y.curry=Lp,y.curryRight=Fp,y.debounce=$p,y.defaults=rB,y.defaultsDeep=iB,y.defer=pN,y.delay=hN,y.difference=MT,y.differenceBy=PT,y.differenceWith=LT,y.drop=FT,y.dropRight=$T,y.dropRightWhile=zT,y.dropWhile=ZT,y.fill=UT,y.filter=WV,y.flatMap=GV,y.flatMapDeep=KV,y.flatMapDepth=YV,y.flatten=Vp,y.flattenDeep=jT,y.flattenDepth=WT,y.flip=mN,y.flow=d2,y.flowRight=u2,y.fromPairs=HT,y.functions=uB,y.functionsIn=fB,y.groupBy=JV,y.initial=GT,y.intersection=KT,y.intersectionBy=YT,y.intersectionWith=JT,y.invert=hB,y.invertBy=mB,y.invokeMap=QV,y.iteratee=Bc,y.keyBy=eN,y.keys=ct,y.keysIn=Vt,y.map=Qa,y.mapKeys=yB,y.mapValues=_B,y.matches=f2,y.matchesProperty=p2,y.memoize=ts,y.merge=wB,y.mergeWith=Yp,y.method=h2,y.methodOf=m2,y.mixin=Oc,y.negate=ns,y.nthArg=y2,y.omit=bB,y.omitBy=kB,y.once=gN,y.orderBy=tN,y.over=_2,y.overArgs=yN,y.overEvery=w2,y.overSome=b2,y.partial=vc,y.partialRight=zp,y.partition=nN,y.pick=xB,y.pickBy=Jp,y.property=ih,y.propertyOf=k2,y.pull=tV,y.pullAll=Bp,y.pullAllBy=nV,y.pullAllWith=rV,y.pullAt=iV,y.range=x2,y.rangeRight=v2,y.rearg=_N,y.reject=oN,y.remove=oV,y.rest=wN,y.reverse=bc,y.sampleSize=sN,y.set=CB,y.setWith=EB,y.shuffle=lN,y.slice=aV,y.sortBy=uN,y.sortedUniq=pV,y.sortedUniqBy=hV,y.split=GB,y.spread=bN,y.tail=mV,y.take=gV,y.takeRight=yV,y.takeRightWhile=_V,y.takeWhile=wV,y.tap=DV,y.throttle=kN,y.thru=Xa,y.toArray=Hp,y.toPairs=Xp,y.toPairsIn=Qp,y.toPath=V2,y.toPlainObject=Gp,y.transform=SB,y.unary=xN,y.union=bV,y.unionBy=kV,y.unionWith=xV,y.uniq=vV,y.uniqBy=CV,y.uniqWith=EV,y.unset=TB,y.unzip=kc,y.unzipWith=Op,y.update=VB,y.updateWith=NB,y.values=xi,y.valuesIn=BB,y.without=SV,y.words=nh,y.wrap=vN,y.xor=TV,y.xorBy=VV,y.xorWith=NV,y.zip=BV,y.zipObject=OV,y.zipObjectDeep=AV,y.zipWith=RV,y.entries=Xp,y.entriesIn=Qp,y.extend=Kp,y.extendWith=os,Oc(y,y),y.add=B2,y.attempt=rh,y.camelCase=DB,y.capitalize=eh,y.ceil=O2,y.clamp=OB,y.clone=EN,y.cloneDeep=TN,y.cloneDeepWith=VN,y.cloneWith=SN,y.conformsTo=NN,y.deburr=th,y.defaultTo=c2,y.divide=A2,y.endsWith=IB,y.eq=yn,y.escape=MB,y.escapeRegExp=PB,y.every=jV,y.find=HV,y.findIndex=Sp,y.findKey=oB,y.findLast=qV,y.findLastIndex=Tp,y.findLastKey=aB,y.floor=R2,y.forEach=Rp,y.forEachRight=Dp,y.forIn=sB,y.forInRight=lB,y.forOwn=cB,y.forOwnRight=dB,y.get=Sc,y.gt=BN,y.gte=ON,y.has=pB,y.hasIn=Tc,y.head=Np,y.identity=Nt,y.includes=XV,y.indexOf=qT,y.inRange=AB,y.invoke=gB,y.isArguments=zr,y.isArray=ke,y.isArrayBuffer=AN,y.isArrayLike=Tt,y.isArrayLikeObject=et,y.isBoolean=RN,y.isBuffer=hr,y.isDate=DN,y.isElement=IN,y.isEmpty=MN,y.isEqual=PN,y.isEqualWith=LN,y.isError=Cc,y.isFinite=FN,y.isFunction=$n,y.isInteger=Zp,y.isLength=rs,y.isMap=Up,y.isMatch=$N,y.isMatchWith=zN,y.isNaN=ZN,y.isNative=UN,y.isNil=WN,y.isNull=jN,y.isNumber=jp,y.isObject=Je,y.isObjectLike=Xe,y.isPlainObject=Do,y.isRegExp=Ec,y.isSafeInteger=HN,y.isSet=Wp,y.isString=is,y.isSymbol=Ft,y.isTypedArray=ki,y.isUndefined=qN,y.isWeakMap=GN,y.isWeakSet=KN,y.join=XT,y.kebabCase=LB,y.last=Kt,y.lastIndexOf=QT,y.lowerCase=FB,y.lowerFirst=$B,y.lt=YN,y.lte=JN,y.max=D2,y.maxBy=I2,y.mean=M2,y.meanBy=P2,y.min=L2,y.minBy=F2,y.stubArray=Rc,y.stubFalse=Dc,y.stubObject=C2,y.stubString=E2,y.stubTrue=S2,y.multiply=$2,y.nth=eV,y.noConflict=g2,y.noop=Ac,y.now=es,y.pad=zB,y.padEnd=ZB,y.padStart=UB,y.parseInt=jB,y.random=RB,y.reduce=rN,y.reduceRight=iN,y.repeat=WB,y.replace=HB,y.result=vB,y.round=z2,y.runInContext=V,y.sample=aN,y.size=cN,y.snakeCase=qB,y.some=dN,y.sortedIndex=sV,y.sortedIndexBy=lV,y.sortedIndexOf=cV,y.sortedLastIndex=dV,y.sortedLastIndexBy=uV,y.sortedLastIndexOf=fV,y.startCase=KB,y.startsWith=YB,y.subtract=Z2,y.sum=U2,y.sumBy=j2,y.template=JB,y.times=T2,y.toFinite=zn,y.toInteger=Ee,y.toLength=qp,y.toLower=XB,y.toNumber=Yt,y.toSafeInteger=XN,y.toString=Fe,y.toUpper=QB,y.trim=e2,y.trimEnd=t2,y.trimStart=n2,y.truncate=r2,y.unescape=i2,y.uniqueId=N2,y.upperCase=o2,y.upperFirst=Vc,y.each=Rp,y.eachRight=Dp,y.first=Np,Oc(y,function(){var r={};return En(y,function(o,l){$e.call(y.prototype,l)||(r[l]=o)}),r}(),{chain:!1}),y.VERSION=a,jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){y[r].placeholder=y}),jt(["drop","take"],function(r,o){Ae.prototype[r]=function(l){l=l===t?1:ot(Ee(l),0);var f=this.__filtered__&&!o?new Ae(this):this.clone();return f.__filtered__?f.__takeCount__=gt(l,f.__takeCount__):f.__views__.push({size:gt(l,Et),type:r+(f.__dir__<0?"Right":"")}),f},Ae.prototype[r+"Right"]=function(l){return this.reverse()[r](l).reverse()}}),jt(["filter","map","takeWhile"],function(r,o){var l=o+1,f=l==de||l==J;Ae.prototype[r]=function(m){var _=this.clone();return _.__iteratees__.push({iteratee:ue(m,3),type:l}),_.__filtered__=_.__filtered__||f,_}}),jt(["head","last"],function(r,o){var l="take"+(o?"Right":"");Ae.prototype[r]=function(){return this[l](1).value()[0]}}),jt(["initial","tail"],function(r,o){var l="drop"+(o?"":"Right");Ae.prototype[r]=function(){return this.__filtered__?new Ae(this):this[l](1)}}),Ae.prototype.compact=function(){return this.filter(Nt)},Ae.prototype.find=function(r){return this.filter(r).head()},Ae.prototype.findLast=function(r){return this.reverse().find(r)},Ae.prototype.invokeMap=Ne(function(r,o){return typeof r=="function"?new Ae(this):this.map(function(l){return Vo(l,r,o)})}),Ae.prototype.reject=function(r){return this.filter(ns(ue(r)))},Ae.prototype.slice=function(r,o){r=Ee(r);var l=this;return l.__filtered__&&(r>0||o<0)?new Ae(l):(r<0?l=l.takeRight(-r):r&&(l=l.drop(r)),o!==t&&(o=Ee(o),l=o<0?l.dropRight(-o):l.take(o-r)),l)},Ae.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Ae.prototype.toArray=function(){return this.take(Et)},En(Ae.prototype,function(r,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),f=/^(?:head|last)$/.test(o),m=y[f?"take"+(o=="last"?"Right":""):o],_=f||/^find/.test(o);m&&(y.prototype[o]=function(){var b=this.__wrapped__,E=f?[1]:arguments,N=b instanceof Ae,F=E[0],$=N||ke(b),U=function(Oe){var Re=m.apply(y,sr([Oe],E));return f&&X?Re[0]:Re};$&&l&&typeof F=="function"&&F.length!=1&&(N=$=!1);var X=this.__chain__,se=!!this.__actions__.length,pe=_&&!X,Ve=N&&!se;if(!_&&$){b=Ve?b:new Ae(this);var he=r.apply(b,E);return he.__actions__.push({func:Xa,args:[U],thisArg:t}),new Ht(he,X)}return pe&&Ve?r.apply(this,E):(he=this.thru(U),pe?f?he.value()[0]:he.value():he)})}),jt(["pop","push","shift","sort","splice","unshift"],function(r){var o=Ca[r],l=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",f=/^(?:pop|shift)$/.test(r);y.prototype[r]=function(){var m=arguments;if(f&&!this.__chain__){var _=this.value();return o.apply(ke(_)?_:[],m)}return this[l](function(b){return o.apply(ke(b)?b:[],m)})}}),En(Ae.prototype,function(r,o){var l=y[o];if(l){var f=l.name+"";$e.call(gi,f)||(gi[f]=[]),gi[f].push({name:o,func:l})}}),gi[Wa(t,v).name]=[{name:"wrapper",func:t}],Ae.prototype.clone=iS,Ae.prototype.reverse=oS,Ae.prototype.value=aS,y.prototype.at=IV,y.prototype.chain=MV,y.prototype.commit=PV,y.prototype.next=LV,y.prototype.plant=$V,y.prototype.reverse=zV,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=ZV,y.prototype.first=y.prototype.head,ko&&(y.prototype[ko]=FV),y},pi=PE();Rr?((Rr.exports=pi)._=pi,Bl._=pi):dt._=pi}).call(vi)}(da,da.exports);var Ye=da.exports;const Tv={class:"grid-overlay-container"},hu=n.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(i){return(e,t)=>(n.openBlock(),n.createElementBlock("div",Tv,[e.params.notReady?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[t[0]||(t[0]=n.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),t[1]||(t[1]=n.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t[2]||(t[2]=n.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),t[3]||(t[3]=n.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),Vv={},Nv={class:"grid-overlay-container"};function Bv(i,e){return n.openBlock(),n.createElementBlock("div",Nv,e[0]||(e[0]=[n.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),n.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const mu=ll(Vv,[["render",Bv]]);async function Ov(i,e,t){throw Error("not implemented")}function Av(i){return i.axesSpec.filter(e=>{var t;return((t=e.annotations)==null?void 0:t["pl7.app/axisNature"])==="heterogeneous"})}function Rv(i,e){const t=[];for(const a of e)if(i[a].type==="column"){const s=Av(i[a].spec);for(const c of s){if(c.type!=="String"){console.warn("heterogeneous axis with string type expected, got",c,"skipping");continue}const d=od(c),u=i.findIndex(p=>Ye.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",a,d,i),Error("axis not found");t.push({columnIdx:a,axisIdx:u})}}return t}const gu=(i,e)=>(i+e).toString();function Dv(i,e,t,a,s,c){if(i.length>1)throw Error("hColumns.length > 1 is not supported");const d=i[0];let u=-1,p=-1;for(let x=0;x<c.length;++x)c[x]===d.axisIdx&&(u=x),c[x]===d.columnIdx&&(p=x);const h=(()=>{const R=a[u].data.filter(T=>T!==null);return Array.from(new Set(R))})();h.sort(),p>u?(t.splice(p,1),t.splice(u,1)):(t.splice(u,1),t.splice(p,1));const g=Iv(s,a,u,p,h,e.rows);for(let x=0;x<h.length;++x){const R=h[x],T=R+"@"+x;t.push({colId:T,field:gu(a.length,x),headerName:R,valueFormatter:yu})}return{rowModelType:"clientSide",columnDefs:t,rowData:g}}function Iv(i,e,t,a,s,c){const d=new Map;let u=0;for(let h=0;h<c;h++){const g={};for(let k=0;k<e.length;++k){if(k===t||k===a)continue;const S=i[k].toString();g[S]=e[k].data[h]}let x;const R=Ci(Object.values(g))??"";d.has(R)?x=d.get(R):(d.set(R,g),x=g,x.id=u.toString(),u++);const T=s.indexOf(e[t].data[h]);if(T===-1)throw Error("index not found");const C=gu(e.length,T);x[C]=e[a].data[h]}return Array.from(d.values())}function Mv(i){return Ci({type:i.type,id:i.id})}function Pv(i){return JSON.parse(i)}const yu=i=>i?i.value===void 0?"NULL":i.value===null?"NA":i.value.toString():"ERROR";function Lv(i,e){var t,a;return{colId:Mv(e),field:i.toString(),headerName:((a=(t=e.spec.annotations)==null?void 0:t["pl7.app/label"])==null?void 0:a.trim())??"Unlabeled "+e.type+" "+i.toString(),lockPosition:e.type==="axis",valueFormatter:yu,cellDataType:(s=>{switch(s){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${s}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function _u(i,e){switch(e){case"Int":return i;case"Long":return typeof i=="bigint"?Number(i):i;case"Float":return i;case"Double":return i;case"String":return i;case"Bytes":return Buffer.from(i).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function wu(i){const e=[];return Ho(i,t=>(e.push(t),t)),e}async function Fv(i,e,t){return t.length?(await i.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Ye.uniqWith(t.map(s=>Cs(s.spec.axesSpec).map(Ye.cloneDeep)).flat(),Ye.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function $v(i,e,t){const a=wu(t),c=(await Fv(i,e,a)).filter(d=>!Ye.find(a,u=>d.columnId===u.columnId));return c.length===0?t:{type:"outer",primary:t,secondary:c.map(d=>({type:"column",column:d}))}}async function zv(i,e,t,a){const s=t.filter(g=>g.type!=="Bytes"),c=wu(a),d=s.map(g=>[]),u=s.map(g=>null);for(let g=0;g<c.length;++g){const x=Cs(c[g].spec.axesSpec);for(let R=0;R<x.length;++R){const T=Ye.findIndex(s,C=>Ye.isEqual(C,x[R]));T===-1||u[T]||(x.length===1&&c[g].spec.name==="pl7.app/label"?(d[T]=[[g,R]],u[T]=c[g].columnId):d[T].push([g,R]))}}for(let g=s.length-1;g>=0;--g)d[g].length||(u.splice(g,1),d.splice(g,1),s.splice(g,1));const p=100,h=s.map(g=>new Set);e:for(let g=s.length-1;g>=0;--g){for(const[x,R]of d[g]){const T=await i.getUniqueValues(e,{columnId:c[x].columnId,...!u[g]&&{axis:Ye.cloneDeep(s[g])},filters:[],limit:p});if(T.overflow){u.splice(g,1),d.splice(g,1),s.splice(g,1);continue e}const C=T.values.type;for(const k of T.values.data)if(!(id(k,C)||k===null)&&(h[g].add(_u(k,C)),h[g].size===p)){u.splice(g,1),d.splice(g,1),s.splice(g,1);continue e}}if(!h[g].size){u.splice(g,1),d.splice(g,1),s.splice(g,1);continue e}}return s.map((g,x)=>{const R=[...h[x]].map(C=>({value:C,text:C.toString()})),T=R[0].value;return{axis:Ye.cloneDeep(g),...u[x]&&{column:u[x]},options:R,defaultValue:T}})}function Zv(i,e){const t=e.length,a=[];for(let s=0;s<e[0].data.length;++s){const c={};for(let d=0;d<t;++d){const u=i[d].toString(),p=e[d].data[s],h=e[d].type;Tm(e[d].absent,s)?c[u]=void 0:id(p,h)||p===null?c[u]=null:c[u]=_u(p,h)}c.id=s.toString(),a.push(c)}return a}const Uv=i=>i.type==="column"&&i.spec.axesSpec.length===1&&i.spec.name==="pl7.app/label";async function jv(i,e,t,a){const s=await e.getSpec(t),c=[...s.keys()].filter(T=>!Ye.find(a,C=>Ye.isEqual(C.axis,s[T].id)||Ye.isEqual(C.column,s[T].id))),d=Ye.cloneDeep(c),u=Rv(s,c);for(let T=c.length-1;T>=0;--T){const C=c[T];if(!Uv(s[C]))continue;const k=Cs(s[C].spec.axesSpec)[0],S=Ye.findIndex(c,v=>Ye.isEqual(s[v].id,k));if(S!==-1){c[S]=C;for(const v of u)v.axisIdx===C&&(v.axisIdx=S);c.splice(T,1),d.splice(T,1)}}const p=await e.getShape(t),h=p.rows,g=d.map(T=>Lv(T,s[T]));if(u.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",u.length," transposition will not be applied."),u.length===1)return Dv(u,p,g,await e.getData(t,c),d,c);let x;return{rowModelType:"infinite",columnDefs:g,datasource:{rowCount:h,getRows:async T=>{i.setGridOption("loading",!0);try{if(h==0){T.successCallback([],h),i.setGridOption("loading",!1),i.showNoRowsOverlay();return}if(x&&!Ye.isEqual(x.sortModel,T.sortModel)){x=void 0,T.failCallback();return}x=T;const C=T.endRow-T.startRow;let k=[];if(C>0){const S=await e.getData(t,c,{offset:T.startRow,length:C});k=Zv(d,S)}T.successCallback(k,p.rows),i.setGridOption("loading",!1),i.autoSizeAllColumns()}catch{T.failCallback()}}}}}const Wv={class:"ap-ag-data-table-container"},Hv={key:0,class:"ap-ag-data-table-sheets"},qv=ll(n.defineComponent({__name:"PlAgDataTable",props:n.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(i){_r.ModuleRegistry.registerModules([Mo.ClientSideRowModelModule,zc.ClipboardModule,$c.InfiniteRowModelModule,Zc.RangeSelectionModule]);const e=n.useModel(i,"modelValue"),t=i,{settings:a}=n.toRefs(t);n.watch(()=>a.value,async(C,k)=>{if(C.sourceType!=="pframe"||!C.pFrame||!C.join||k&&k.sourceType==="pframe"&&Ye.isEqual(C.pFrame,k.pFrame)&&Ye.isEqual(C.join,k.join))return;const S=window.platforma;if(!S)throw Error("platforma not set");const v=S.pFrameDriver;if(!v)throw Error("platforma.pFrameDriver not set");const I=await $v(v,C.pFrame,C.join),K=e.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=I,e.value=K});const s=bu(()=>a.value.sourceType,async C=>{var S;const k=a.value.sourceType;switch(k){case"pframe":{const v=window.platforma;if(!v)throw Error("platforma not set");const I=v.pFrameDriver;if(!I)throw Error("platforma.pFrameDriver not set");if(!a.value.pFrame)return[];const K=a.value.pFrame,j=(S=e.value.pTableParams)==null?void 0:S.join;return j?await zv(I,K,a.value.sheetAxes,j):[]}case"ptable":return a.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${k}`)}});function c(C){if(!(a.value.sourceType!=="ptable"&&a.value.sourceType!=="pframe"))return(C==null?void 0:C.sortModel.map(k=>({column:Pv(k.colId),ascending:k.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const d=n.computed({get:()=>{const C=e.value;return{columnOrder:C.gridState.columnOrder,sort:C.gridState.sort}},set:C=>{const k=e.value,S=x.rowModelType==="clientSide"?void 0:c(C.sort);k.gridState.columnOrder=C.columnOrder,k.gridState.sort=C.sort,(a.value.sourceType==="ptable"||a.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.sorting=S),e.value=k}}),u=C=>Ci(C);function p(C){var k;if(!(a.value.sourceType!=="ptable"&&a.value.sourceType!=="pframe"))return((k=s.value)==null?void 0:k.map(S=>({type:"bySingleColumn",column:S.column?{type:"column",id:S.column}:{type:"axis",id:S.axis},predicate:{operator:"Equal",reference:C[u(S.axis)]}})))??[]}const h=n.computed({get:()=>e.value.gridState.sheets??{},set:C=>{const k=p(C),S=e.value;S.gridState.sheets=C,(a.value.sourceType==="ptable"||a.value.sourceType==="pframe")&&(S.pTableParams||(S.pTableParams={sorting:[],filters:[]}),S.pTableParams.filters=k),e.value=S}});n.watch(()=>[a.value,s.value],(C,k)=>{const[S,v]=C;if(!v)return;if(k){const[K,j]=k;if((S.sourceType==="ptable"||S.sourceType==="pframe")&&S.sourceType===(K==null?void 0:K.sourceType)&&Ye.isEqual(v,j))return}if(S.sourceType!=="ptable"&&S.sourceType!=="pframe"){h.value={};return}const I=h.value;for(const K of v){const j=u(K.axis);I[j]||(I[j]=K.defaultValue??K.options[0].value)}h.value=I},{immediate:!0});const g=n.shallowRef(),x={animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:e.value.gridState,onGridReady:C=>{g.value=C.api},onStateUpdated:C=>{d.value={columnOrder:C.state.columnOrder,sort:C.state.sort}},autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:C=>{C.api.autoSizeAllColumns()},maxBlocksInCache:1e4,cacheBlockSize:100,getRowId:C=>C.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:hu,noRowsOverlayComponent:mu},R=n.ref(0);n.watch(()=>[g.value,d.value],(C,k)=>{if(Ye.isEqual(C,k))return;const[S,v]=C;if(!S)return;const I=S.getState();Ye.isEqual(v.columnOrder,I.columnOrder)&&Ye.isEqual(v.sort,I.sort)||(x.initialState=v,++R.value)});const T=(C,k)=>{const S=h.value;S[C]!==k&&(S[C]=k,h.value=S)};return n.watch(()=>[g.value,a.value,s.value],async(C,k)=>{if(Ye.isEqual(C,k))return;const[S,v,I]=C;if(!S)return;const K=window.platforma;if(!K)throw Error("platforma not set");const j=v.sourceType;switch(j){case"pframe":case"ptable":{const z=K.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const W=v.pTable;if(!W||!I)return S.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const O=await jv(S,z,W,I);return S.updateGridOptions({loading:O.rowModelType==="infinite",loadingOverlayComponentParams:{notReady:!1},...O})}case"xsv":{const z=K.blobDriver;if(!z)throw Error("platforma.blobDriver not set");const W=v.xsvFile;if(!(W!=null&&W.ok)||!W.value)return S.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const O=await Ov(S,z,W.value);return S.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...O})}default:throw Error(`unsupported source type: ${j}`)}}),(C,k)=>(n.openBlock(),n.createElementBlock("div",Wv,[n.createVNode(n.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:n.withCtx(()=>[n.unref(s).value&&n.unref(s).value.length>0?(n.openBlock(),n.createElementBlock("div",Hv,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(s).value,(S,v)=>(n.openBlock(),n.createBlock(n.unref(Kd),{key:v,"model-value":h.value[u(S.axis)],options:S.options,"onUpdate:modelValue":I=>T(u(S.axis),I)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):n.createCommentVNode("",!0)]),_:1}),n.createVNode(n.unref(fh.AgGridVue),{class:"ap-ag-data-table-grid","grid-options":x})]))}}),[["__scopeId","data-v-690a491e"]]),Gv={key:1,class:"alert-error"},Kv={key:2},Yv=n.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(i){const e=i,t=n.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),a=n.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=n.computed(()=>t.value===void 0&&a.value===void 0);return(c,d)=>(n.openBlock(),n.createElementBlock("div",null,[t.value!==void 0?n.renderSlot(c.$slots,"default",n.normalizeProps(n.mergeProps({key:0},{value:t.value}))):n.createCommentVNode("",!0),a.value?(n.openBlock(),n.createElementBlock("div",Gv,n.toDisplayString(a.value),1)):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("div",Kv,"Unresolved")):n.createCommentVNode("",!0)]))}}),ua=new Map;function Jv(i,e){const t=n.getCurrentScope()??n.effectScope(),a=t.run(()=>(n.onScopeDispose(()=>{ua.delete(i)}),n.reactive(e())));return a[Symbol.dispose]=()=>{t.stop()},a}function Xv(i){const e=Symbol();return()=>(ua.has(e)||ua.set(e,Jv(e,i)),ua.get(e))}function Qv(i){return n.computed(()=>{try{return jc(i())}catch(e){return{errors:[String(e)],value:void 0}}})}function bu(i,e,t){const a=n.ref(0),s=n.reactive({loading:n.computed(()=>a.value>0),loadingRef:a,value:void 0,error:void 0}),c=mh(e);return n.watch(i,async d=>{s.error=void 0,a.value++,c(d).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{a.value--})},Object.assign({immediate:!0,deep:!0},t??{})),s}const ni=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ku=new Set,cl=typeof process=="object"&&process?process:{},xu=(i,e,t,a)=>{typeof cl.emitWarning=="function"?cl.emitWarning(i,e,t,a):console.error(`[${t}] ${e}: ${i}`)};let fa=globalThis.AbortController,vu=globalThis.AbortSignal;if(typeof fa>"u"){vu=class{constructor(){Le(this,"onabort");Le(this,"_onabort",[]);Le(this,"reason");Le(this,"aborted",!1)}addEventListener(a,s){this._onabort.push(s)}},fa=class{constructor(){Le(this,"signal",new vu);e()}abort(a){var s,c;if(!this.signal.aborted){this.signal.reason=a,this.signal.aborted=!0;for(const d of this.signal._onabort)d(a);(c=(s=this.signal).onabort)==null||c.call(s,a)}}};let i=((Eu=cl.env)==null?void 0:Eu.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{i&&(i=!1,xu("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 eC=i=>!ku.has(i),rr=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Cu=i=>rr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?pa:null:null;class pa extends Array{constructor(e){super(e),this.fill(0)}}const Vr=class Vr{constructor(e,t){Le(this,"heap");Le(this,"length");if(!w(Vr,ri))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=Cu(e);if(!t)return[];fe(Vr,ri,!0);const a=new Vr(e,t);return fe(Vr,ri,!1),a}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ri=new WeakMap,Me(Vr,ri,!1);let dl=Vr;const pl=class pl{constructor(e){Me(this,Y);Me(this,on);Me(this,At);Me(this,an);Me(this,sn);Me(this,ii);Me(this,oi);Le(this,"ttl");Le(this,"ttlResolution");Le(this,"ttlAutopurge");Le(this,"updateAgeOnGet");Le(this,"updateAgeOnHas");Le(this,"allowStale");Le(this,"noDisposeOnSet");Le(this,"noUpdateTTL");Le(this,"maxEntrySize");Le(this,"sizeCalculation");Le(this,"noDeleteOnFetchRejection");Le(this,"noDeleteOnStaleGet");Le(this,"allowStaleOnFetchAbort");Le(this,"allowStaleOnFetchRejection");Le(this,"ignoreFetchAbort");Me(this,rt);Me(this,ln);Me(this,nt);Me(this,Ue);Me(this,we);Me(this,bt);Me(this,Rt);Me(this,mt);Me(this,st);Me(this,cn);Me(this,lt);Me(this,dn);Me(this,un);Me(this,Dt);Me(this,fn);Me(this,ir);Me(this,kt);Me(this,Nr,()=>{});Me(this,An,()=>{});Me(this,uo,()=>{});Me(this,It,()=>!1);Me(this,Br,e=>{});Me(this,ai,(e,t,a)=>{});Me(this,fo,(e,t,a,s)=>{if(a||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Le(this,Su,"LRUCache");const{max:t=0,ttl:a,ttlResolution:s=1,ttlAutopurge:c,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:h,disposeAfter:g,noDisposeOnSet:x,noUpdateTTL:R,maxSize:T=0,maxEntrySize:C=0,sizeCalculation:k,fetchMethod:S,memoMethod:v,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:K,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:z,ignoreFetchAbort:W}=e;if(t!==0&&!rr(t))throw new TypeError("max option must be a nonnegative integer");const O=t?Cu(t):Array;if(!O)throw new Error("invalid max value: "+t);if(fe(this,on,t),fe(this,At,T),this.maxEntrySize=C||w(this,At),this.sizeCalculation=k,this.sizeCalculation){if(!w(this,At)&&!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(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(fe(this,oi,v),S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,ii,S),fe(this,ir,!!S),fe(this,nt,new Map),fe(this,Ue,new Array(t).fill(void 0)),fe(this,we,new Array(t).fill(void 0)),fe(this,bt,new O(t)),fe(this,Rt,new O(t)),fe(this,mt,0),fe(this,st,0),fe(this,cn,dl.create(t)),fe(this,rt,0),fe(this,ln,0),typeof h=="function"&&fe(this,an,h),typeof g=="function"?(fe(this,sn,g),fe(this,lt,[])):(fe(this,sn,void 0),fe(this,lt,void 0)),fe(this,fn,!!w(this,an)),fe(this,kt,!!w(this,sn)),this.noDisposeOnSet=!!x,this.noUpdateTTL=!!R,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!j,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(w(this,At)!==0&&!rr(w(this,At)))throw new TypeError("maxSize must be a positive integer if specified");if(!rr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ie(this,Y,sh).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!K,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=rr(s)||s===0?s:1,this.ttlAutopurge=!!c,this.ttl=a||0,this.ttl){if(!rr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ie(this,Y,Mc).call(this)}if(w(this,on)===0&&this.ttl===0&&w(this,At)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,on)&&!w(this,At)){const B="LRU_CACHE_UNBOUNDED";eC(B)&&(ku.add(B),xu("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,pl))}}static unsafeExposeInternals(e){return{starts:w(e,un),ttls:w(e,Dt),sizes:w(e,dn),keyMap:w(e,nt),keyList:w(e,Ue),valList:w(e,we),next:w(e,bt),prev:w(e,Rt),get head(){return w(e,mt)},get tail(){return w(e,st)},free:w(e,cn),isBackgroundFetch:t=>{var a;return ie(a=e,Y,We).call(a,t)},backgroundFetch:(t,a,s,c)=>{var d;return ie(d=e,Y,ls).call(d,t,a,s,c)},moveToTail:t=>{var a;return ie(a=e,Y,Io).call(a,t)},indexes:t=>{var a;return ie(a=e,Y,mr).call(a,t)},rindexes:t=>{var a;return ie(a=e,Y,gr).call(a,t)},isStale:t=>{var a;return w(a=e,It).call(a,t)}}}get max(){return w(this,on)}get maxSize(){return w(this,At)}get calculatedSize(){return w(this,ln)}get size(){return w(this,rt)}get fetchMethod(){return w(this,ii)}get memoMethod(){return w(this,oi)}get dispose(){return w(this,an)}get disposeAfter(){return w(this,sn)}getRemainingTTL(e){return w(this,nt).has(e)?1/0:0}*entries(){for(const e of ie(this,Y,mr).call(this))w(this,we)[e]!==void 0&&w(this,Ue)[e]!==void 0&&!ie(this,Y,We).call(this,w(this,we)[e])&&(yield[w(this,Ue)[e],w(this,we)[e]])}*rentries(){for(const e of ie(this,Y,gr).call(this))w(this,we)[e]!==void 0&&w(this,Ue)[e]!==void 0&&!ie(this,Y,We).call(this,w(this,we)[e])&&(yield[w(this,Ue)[e],w(this,we)[e]])}*keys(){for(const e of ie(this,Y,mr).call(this)){const t=w(this,Ue)[e];t!==void 0&&!ie(this,Y,We).call(this,w(this,we)[e])&&(yield t)}}*rkeys(){for(const e of ie(this,Y,gr).call(this)){const t=w(this,Ue)[e];t!==void 0&&!ie(this,Y,We).call(this,w(this,we)[e])&&(yield t)}}*values(){for(const e of ie(this,Y,mr).call(this))w(this,we)[e]!==void 0&&!ie(this,Y,We).call(this,w(this,we)[e])&&(yield w(this,we)[e])}*rvalues(){for(const e of ie(this,Y,gr).call(this))w(this,we)[e]!==void 0&&!ie(this,Y,We).call(this,w(this,we)[e])&&(yield w(this,we)[e])}[(Tu=Symbol.iterator,Su=Symbol.toStringTag,Tu)](){return this.entries()}find(e,t={}){for(const a of ie(this,Y,mr).call(this)){const s=w(this,we)[a],c=ie(this,Y,We).call(this,s)?s.__staleWhileFetching:s;if(c!==void 0&&e(c,w(this,Ue)[a],this))return this.get(w(this,Ue)[a],t)}}forEach(e,t=this){for(const a of ie(this,Y,mr).call(this)){const s=w(this,we)[a],c=ie(this,Y,We).call(this,s)?s.__staleWhileFetching:s;c!==void 0&&e.call(t,c,w(this,Ue)[a],this)}}rforEach(e,t=this){for(const a of ie(this,Y,gr).call(this)){const s=w(this,we)[a],c=ie(this,Y,We).call(this,s)?s.__staleWhileFetching:s;c!==void 0&&e.call(t,c,w(this,Ue)[a],this)}}purgeStale(){let e=!1;for(const t of ie(this,Y,gr).call(this,{allowStale:!0}))w(this,It).call(this,t)&&(ie(this,Y,yr).call(this,w(this,Ue)[t],"expire"),e=!0);return e}info(e){const t=w(this,nt).get(e);if(t===void 0)return;const a=w(this,we)[t],s=ie(this,Y,We).call(this,a)?a.__staleWhileFetching:a;if(s===void 0)return;const c={value:s};if(w(this,Dt)&&w(this,un)){const d=w(this,Dt)[t],u=w(this,un)[t];if(d&&u){const p=d-(ni.now()-u);c.ttl=p,c.start=Date.now()}}return w(this,dn)&&(c.size=w(this,dn)[t]),c}dump(){const e=[];for(const t of ie(this,Y,mr).call(this,{allowStale:!0})){const a=w(this,Ue)[t],s=w(this,we)[t],c=ie(this,Y,We).call(this,s)?s.__staleWhileFetching:s;if(c===void 0||a===void 0)continue;const d={value:c};if(w(this,Dt)&&w(this,un)){d.ttl=w(this,Dt)[t];const u=ni.now()-w(this,un)[t];d.start=Math.floor(Date.now()-u)}w(this,dn)&&(d.size=w(this,dn)[t]),e.unshift([a,d])}return e}load(e){this.clear();for(const[t,a]of e){if(a.start){const s=Date.now()-a.start;a.start=ni.now()-s}this.set(t,a.value,a)}}set(e,t,a={}){var R,T,C,k,S;if(t===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:c,noDisposeOnSet:d=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=a;let{noUpdateTTL:h=this.noUpdateTTL}=a;const g=w(this,fo).call(this,e,t,a.size||0,u);if(this.maxEntrySize&&g>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ie(this,Y,yr).call(this,e,"set"),this;let x=w(this,rt)===0?void 0:w(this,nt).get(e);if(x===void 0)x=w(this,rt)===0?w(this,st):w(this,cn).length!==0?w(this,cn).pop():w(this,rt)===w(this,on)?ie(this,Y,ss).call(this,!1):w(this,rt),w(this,Ue)[x]=e,w(this,we)[x]=t,w(this,nt).set(e,x),w(this,bt)[w(this,st)]=x,w(this,Rt)[x]=w(this,st),fe(this,st,x),as(this,rt)._++,w(this,ai).call(this,x,g,p),p&&(p.set="add"),h=!1;else{ie(this,Y,Io).call(this,x);const v=w(this,we)[x];if(t!==v){if(w(this,ir)&&ie(this,Y,We).call(this,v)){v.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:I}=v;I!==void 0&&!d&&(w(this,fn)&&((R=w(this,an))==null||R.call(this,I,e,"set")),w(this,kt)&&((T=w(this,lt))==null||T.push([I,e,"set"])))}else d||(w(this,fn)&&((C=w(this,an))==null||C.call(this,v,e,"set")),w(this,kt)&&((k=w(this,lt))==null||k.push([v,e,"set"])));if(w(this,Br).call(this,x),w(this,ai).call(this,x,g,p),w(this,we)[x]=t,p){p.set="replace";const I=v&&ie(this,Y,We).call(this,v)?v.__staleWhileFetching:v;I!==void 0&&(p.oldValue=I)}}else p&&(p.set="update")}if(s!==0&&!w(this,Dt)&&ie(this,Y,Mc).call(this),w(this,Dt)&&(h||w(this,uo).call(this,x,s,c),p&&w(this,An).call(this,p,x)),!d&&w(this,kt)&&w(this,lt)){const v=w(this,lt);let I;for(;I=v==null?void 0:v.shift();)(S=w(this,sn))==null||S.call(this,...I)}return this}pop(){var e;try{for(;w(this,rt);){const t=w(this,we)[w(this,mt)];if(ie(this,Y,ss).call(this,!0),ie(this,Y,We).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(w(this,kt)&&w(this,lt)){const t=w(this,lt);let a;for(;a=t==null?void 0:t.shift();)(e=w(this,sn))==null||e.call(this,...a)}}}has(e,t={}){const{updateAgeOnHas:a=this.updateAgeOnHas,status:s}=t,c=w(this,nt).get(e);if(c!==void 0){const d=w(this,we)[c];if(ie(this,Y,We).call(this,d)&&d.__staleWhileFetching===void 0)return!1;if(w(this,It).call(this,c))s&&(s.has="stale",w(this,An).call(this,s,c));else return a&&w(this,Nr).call(this,c),s&&(s.has="hit",w(this,An).call(this,s,c)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){const{allowStale:a=this.allowStale}=t,s=w(this,nt).get(e);if(s===void 0||!a&&w(this,It).call(this,s))return;const c=w(this,we)[s];return ie(this,Y,We).call(this,c)?c.__staleWhileFetching:c}async fetch(e,t={}){const{allowStale:a=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:c=this.noDeleteOnStaleGet,ttl:d=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL,noDeleteOnFetchRejection:x=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:R=this.allowStaleOnFetchRejection,ignoreFetchAbort:T=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:k,forceRefresh:S=!1,status:v,signal:I}=t;if(!w(this,ir))return v&&(v.fetch="get"),this.get(e,{allowStale:a,updateAgeOnGet:s,noDeleteOnStaleGet:c,status:v});const K={allowStale:a,updateAgeOnGet:s,noDeleteOnStaleGet:c,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:h,noUpdateTTL:g,noDeleteOnFetchRejection:x,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:C,ignoreFetchAbort:T,status:v,signal:I};let j=w(this,nt).get(e);if(j===void 0){v&&(v.fetch="miss");const z=ie(this,Y,ls).call(this,e,j,K,k);return z.__returned=z}else{const z=w(this,we)[j];if(ie(this,Y,We).call(this,z)){const Z=a&&z.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",Z&&(v.returnedStale=!0)),Z?z.__staleWhileFetching:z.__returned=z}const W=w(this,It).call(this,j);if(!S&&!W)return v&&(v.fetch="hit"),ie(this,Y,Io).call(this,j),s&&w(this,Nr).call(this,j),v&&w(this,An).call(this,v,j),z;const O=ie(this,Y,ls).call(this,e,j,K,k),P=O.__staleWhileFetching!==void 0&&a;return v&&(v.fetch=W?"stale":"refresh",P&&W&&(v.returnedStale=!0)),P?O.__staleWhileFetching:O.__returned=O}}async forceFetch(e,t={}){const a=await this.fetch(e,t);if(a===void 0)throw new Error("fetch() returned undefined");return a}memo(e,t={}){const a=w(this,oi);if(!a)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:c,...d}=t,u=this.get(e,d);if(!c&&u!==void 0)return u;const p=a(e,u,{options:d,context:s});return this.set(e,p,d),p}get(e,t={}){const{allowStale:a=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:c=this.noDeleteOnStaleGet,status:d}=t,u=w(this,nt).get(e);if(u!==void 0){const p=w(this,we)[u],h=ie(this,Y,We).call(this,p);return d&&w(this,An).call(this,d,u),w(this,It).call(this,u)?(d&&(d.get="stale"),h?(d&&a&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),a?p.__staleWhileFetching:void 0):(c||ie(this,Y,yr).call(this,e,"expire"),d&&a&&(d.returnedStale=!0),a?p:void 0)):(d&&(d.get="hit"),h?p.__staleWhileFetching:(ie(this,Y,Io).call(this,u),s&&w(this,Nr).call(this,u),p))}else d&&(d.get="miss")}delete(e){return ie(this,Y,yr).call(this,e,"delete")}clear(){return ie(this,Y,Fc).call(this,"delete")}};on=new WeakMap,At=new WeakMap,an=new WeakMap,sn=new WeakMap,ii=new WeakMap,oi=new WeakMap,rt=new WeakMap,ln=new WeakMap,nt=new WeakMap,Ue=new WeakMap,we=new WeakMap,bt=new WeakMap,Rt=new WeakMap,mt=new WeakMap,st=new WeakMap,cn=new WeakMap,lt=new WeakMap,dn=new WeakMap,un=new WeakMap,Dt=new WeakMap,fn=new WeakMap,ir=new WeakMap,kt=new WeakMap,Y=new WeakSet,Mc=function(){const e=new pa(w(this,on)),t=new pa(w(this,on));fe(this,Dt,e),fe(this,un,t),fe(this,uo,(c,d,u=ni.now())=>{if(t[c]=d!==0?u:0,e[c]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,It).call(this,c)&&ie(this,Y,yr).call(this,w(this,Ue)[c],"expire")},d+1);p.unref&&p.unref()}}),fe(this,Nr,c=>{t[c]=e[c]!==0?ni.now():0}),fe(this,An,(c,d)=>{if(e[d]){const u=e[d],p=t[d];if(!u||!p)return;c.ttl=u,c.start=p,c.now=a||s();const h=c.now-p;c.remainingTTL=u-h}});let a=0;const s=()=>{const c=ni.now();if(this.ttlResolution>0){a=c;const d=setTimeout(()=>a=0,this.ttlResolution);d.unref&&d.unref()}return c};this.getRemainingTTL=c=>{const d=w(this,nt).get(c);if(d===void 0)return 0;const u=e[d],p=t[d];if(!u||!p)return 1/0;const h=(a||s())-p;return u-h},fe(this,It,c=>{const d=t[c],u=e[c];return!!u&&!!d&&(a||s())-d>u})},Nr=new WeakMap,An=new WeakMap,uo=new WeakMap,It=new WeakMap,sh=function(){const e=new pa(w(this,on));fe(this,ln,0),fe(this,dn,e),fe(this,Br,t=>{fe(this,ln,w(this,ln)-e[t]),e[t]=0}),fe(this,fo,(t,a,s,c)=>{if(ie(this,Y,We).call(this,a))return 0;if(!rr(s))if(c){if(typeof c!="function")throw new TypeError("sizeCalculation must be a function");if(s=c(a,t),!rr(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,ai,(t,a,s)=>{if(e[t]=a,w(this,At)){const c=w(this,At)-e[t];for(;w(this,ln)>c;)ie(this,Y,ss).call(this,!0)}fe(this,ln,w(this,ln)+e[t]),s&&(s.entrySize=a,s.totalCalculatedSize=w(this,ln))})},Br=new WeakMap,ai=new WeakMap,fo=new WeakMap,mr=function*({allowStale:e=this.allowStale}={}){if(w(this,rt))for(let t=w(this,st);!(!ie(this,Y,Pc).call(this,t)||((e||!w(this,It).call(this,t))&&(yield t),t===w(this,mt)));)t=w(this,Rt)[t]},gr=function*({allowStale:e=this.allowStale}={}){if(w(this,rt))for(let t=w(this,mt);!(!ie(this,Y,Pc).call(this,t)||((e||!w(this,It).call(this,t))&&(yield t),t===w(this,st)));)t=w(this,bt)[t]},Pc=function(e){return e!==void 0&&w(this,nt).get(w(this,Ue)[e])===e},ss=function(e){var c,d;const t=w(this,mt),a=w(this,Ue)[t],s=w(this,we)[t];return w(this,ir)&&ie(this,Y,We).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,fn)||w(this,kt))&&(w(this,fn)&&((c=w(this,an))==null||c.call(this,s,a,"evict")),w(this,kt)&&((d=w(this,lt))==null||d.push([s,a,"evict"]))),w(this,Br).call(this,t),e&&(w(this,Ue)[t]=void 0,w(this,we)[t]=void 0,w(this,cn).push(t)),w(this,rt)===1?(fe(this,mt,fe(this,st,0)),w(this,cn).length=0):fe(this,mt,w(this,bt)[t]),w(this,nt).delete(a),as(this,rt)._--,t},ls=function(e,t,a,s){const c=t===void 0?void 0:w(this,we)[t];if(ie(this,Y,We).call(this,c))return c;const d=new fa,{signal:u}=a;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:a,context:s},h=(k,S=!1)=>{const{aborted:v}=d.signal,I=a.ignoreFetchAbort&&k!==void 0;if(a.status&&(v&&!S?(a.status.fetchAborted=!0,a.status.fetchError=d.signal.reason,I&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),v&&!I&&!S)return x(d.signal.reason);const K=T;return w(this,we)[t]===T&&(k===void 0?K.__staleWhileFetching?w(this,we)[t]=K.__staleWhileFetching:ie(this,Y,yr).call(this,e,"fetch"):(a.status&&(a.status.fetchUpdated=!0),this.set(e,k,p.options))),k},g=k=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=k),x(k)),x=k=>{const{aborted:S}=d.signal,v=S&&a.allowStaleOnFetchAbort,I=v||a.allowStaleOnFetchRejection,K=I||a.noDeleteOnFetchRejection,j=T;if(w(this,we)[t]===T&&(!K||j.__staleWhileFetching===void 0?ie(this,Y,yr).call(this,e,"fetch"):v||(w(this,we)[t]=j.__staleWhileFetching)),I)return a.status&&j.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),j.__staleWhileFetching;if(j.__returned===j)throw k},R=(k,S)=>{var I;const v=(I=w(this,ii))==null?void 0:I.call(this,e,c,p);v&&v instanceof Promise&&v.then(K=>k(K===void 0?void 0:K),S),d.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(k(void 0),a.allowStaleOnFetchAbort&&(k=K=>h(K,!0)))})};a.status&&(a.status.fetchDispatched=!0);const T=new Promise(R).then(h,g),C=Object.assign(T,{__abortController:d,__staleWhileFetching:c,__returned:void 0});return t===void 0?(this.set(e,C,{...p.options,status:void 0}),t=w(this,nt).get(e)):w(this,we)[t]=C,C},We=function(e){if(!w(this,ir))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof fa},Lc=function(e,t){w(this,Rt)[t]=e,w(this,bt)[e]=t},Io=function(e){e!==w(this,st)&&(e===w(this,mt)?fe(this,mt,w(this,bt)[e]):ie(this,Y,Lc).call(this,w(this,Rt)[e],w(this,bt)[e]),ie(this,Y,Lc).call(this,w(this,st),e),fe(this,st,e))},yr=function(e,t){var s,c,d,u;let a=!1;if(w(this,rt)!==0){const p=w(this,nt).get(e);if(p!==void 0)if(a=!0,w(this,rt)===1)ie(this,Y,Fc).call(this,t);else{w(this,Br).call(this,p);const h=w(this,we)[p];if(ie(this,Y,We).call(this,h)?h.__abortController.abort(new Error("deleted")):(w(this,fn)||w(this,kt))&&(w(this,fn)&&((s=w(this,an))==null||s.call(this,h,e,t)),w(this,kt)&&((c=w(this,lt))==null||c.push([h,e,t]))),w(this,nt).delete(e),w(this,Ue)[p]=void 0,w(this,we)[p]=void 0,p===w(this,st))fe(this,st,w(this,Rt)[p]);else if(p===w(this,mt))fe(this,mt,w(this,bt)[p]);else{const g=w(this,Rt)[p];w(this,bt)[g]=w(this,bt)[p];const x=w(this,bt)[p];w(this,Rt)[x]=w(this,Rt)[p]}as(this,rt)._--,w(this,cn).push(p)}}if(w(this,kt)&&((d=w(this,lt))!=null&&d.length)){const p=w(this,lt);let h;for(;h=p==null?void 0:p.shift();)(u=w(this,sn))==null||u.call(this,...h)}return a},Fc=function(e){var t,a,s;for(const c of ie(this,Y,gr).call(this,{allowStale:!0})){const d=w(this,we)[c];if(ie(this,Y,We).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=w(this,Ue)[c];w(this,fn)&&((t=w(this,an))==null||t.call(this,d,u,e)),w(this,kt)&&((a=w(this,lt))==null||a.push([d,u,e]))}}if(w(this,nt).clear(),w(this,we).fill(void 0),w(this,Ue).fill(void 0),w(this,Dt)&&w(this,un)&&(w(this,Dt).fill(0),w(this,un).fill(0)),w(this,dn)&&w(this,dn).fill(0),fe(this,mt,0),fe(this,st,0),w(this,cn).length=0,fe(this,ln,0),fe(this,rt,0),w(this,kt)&&w(this,lt)){const c=w(this,lt);let d;for(;d=c==null?void 0:c.shift();)(s=w(this,sn))==null||s.call(this,...d)}};let ul=pl;const tC={cacheSize:15e6};class nC{constructor(e){Le(this,"_str");Le(this,"_rawJson");Le(this,"_zodSchema");Le(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 Or=class Or{constructor(e){Le(this,"fileDataCache");Le(this,"fileDataRefs",new Map);const t={...tC,...e??{}};this.fileDataCache=new ul({maxSize:t.cacheSize,fetchMethod:async a=>new nC(await Nm().blobDriver.getContent(a)),sizeCalculation:a=>a.bytes.length,dispose:(a,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const t=this.fileDataRefs.get(e);if(t!==void 0)return t;const a=n.shallowRef();return this.fileDataRefs.set(e,a),(async()=>{try{const s=await this.fileDataCache.fetch(e);a.value=s}catch(s){console.error(s)}})(),a}getContentBytes(e){if(e===void 0)return;const t=this.getDataRef(e);return n.computed(()=>{var a;return(a=t.value)==null?void 0:a.bytes})}getContentString(e){if(e===void 0)return;const t=this.getDataRef(e);return n.computed(()=>{var a;return(a=t==null?void 0:t.value)==null?void 0:a.str})}getContentJson(e,t){if(e===void 0)return;const a=this.getDataRef(e);return n.computed(()=>{var s,c;return t===void 0?(s=a==null?void 0:a.value)==null?void 0:s.rawJson:(c=a==null?void 0:a.value)==null?void 0:c.validatedJson(t)})}static getContentBytes(e){return Or.globalInstance.getContentBytes(e)}static getContentString(e){return Or.globalInstance.getContentString(e)}static getContentJson(e,t){return Or.globalInstance.getContentJson(e,t)}};Le(Or,"globalInstance",new Or);let fl=Or;A.BlockLayout=Sv,A.ContextProvider=Ik,A.DataTable=l_,A.DemoData=yv,A.DropdownListItem=Qo,A.GridTable=uy,A.LongText=Gd,A.MaskIcon16=Wi,A.MaskIcon24=Cr,A.MultiError=us,A.PlAgDataTable=qv,A.PlAgOverlayLoading=hu,A.PlAgOverlayNoRows=mu,A.PlAlert=M_,A.PlBlockPage=k_,A.PlBtnAccent=z_,A.PlBtnGhost=Pd,A.PlBtnGroup=c0,A.PlBtnLink=W_,A.PlBtnPrimary=Md,A.PlBtnSecondary=Hs,A.PlCheckbox=$w,A.PlCheckboxGroup=jw,A.PlChip=Qs,A.PlContainer=v_,A.PlDialogModal=Yd,A.PlDropdown=Xs,A.PlDropdownLine=Kd,A.PlDropdownMulti=Lw,A.PlDropdownRef=ew,A.PlFileDialog=Jd,A.PlFileInput=Dk,A.PlGrid=B_,A.PlLogView=ob,A.PlNumberField=vw,A.PlProgressBar=gw,A.PlRow=E_,A.PlSlideModal=Qw,A.PlSpacer=V_,A.PlTextArea=A0,A.PlTextField=jd,A.PlToggleSwitch=nb,A.PlTooltip=Zt,A.ReactiveFileContent=fl,A.Scrollable=S1,A.Slider=Hk,A.SliderRange=x1,A.SliderRangeTriple=d1,A.ThemeSwitcher=h_,A.UnresolvedError=ds,A.ValueOrErrorsComponent=Yv,A.activateAgGrid=ad,A.animate=Td,A.animateInfinite=cy,A.call=xd,A.computedResult=Qv,A.createModel=ys,A.debounce=Vd,A.defineApp=Om,A.defineStore=Xv,A.delay=vd,A.detectOutside=R0,A.ensureError=hs,A.eventListener=Ys,A.formatZodError=gs,A.getElementScrollPosition=Hd,A.identity=ps,A.isDefined=bh,A.isElementVisible=Wd,A.isJsonEqual=fs,A.isZodError=ms,A.listToOptions=dy,A.makeEaseInOut=ly,A.makeEaseOut=Sd,A.maskIcons16=mv,A.maskIcons24=gv,A.normalizeListOptions=Gr,A.notEmpty=Is,A.randomInt=Ed,A.randomString=sy,A.requestTick=Ms,A.scrollIntoView=Xo,A.showContextMenu=Fs,A.throttle=Ps,A.timeout=Cd,A.unwrapOptionalResult=wh,A.unwrapValueOrErrors=Uc,A.useClickOutside=Jo,A.useDraggable=Qk,A.useEventListener=Ge,A.useFormState=Jk,A.useHover=Ds,A.useInterval=Yk,A.useLabelNotch=vr,A.useLocalStorage=Ad,A.useMouse=Rs,A.useMouseCapture=Kn,A.usePosition=Ld,A.useQuery=Xk,A.useResizeObserver=fu,A.useScroll=qk,A.useSdkPlugin=Es,A.useSortable=Kk,A.useTheme=Dd,A.useWatchFetch=bu,A.wrapOptionalResult=jc,A.wrapValueOrErrors=_h,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});